{"id":24757806,"url":"https://github.com/bashmocha/reinforcement-learning-in-airsim","last_synced_at":"2026-04-13T23:31:18.289Z","repository":{"id":272208339,"uuid":"912103556","full_name":"BashMocha/Reinforcement-Learning-in-AirSim","owner":"BashMocha","description":"Autonomous Driving in AirSim by Reinforcement Learning","archived":false,"fork":false,"pushed_at":"2025-03-08T12:45:30.000Z","size":6382,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-28T21:30:40.675Z","etag":null,"topics":["airsim","autonomous-driving","autonomous-vehicles","deep-q-learning","deep-reinforcement-learning","path-tracing","reinforcement-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BashMocha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-04T16:04:37.000Z","updated_at":"2025-07-10T02:25:13.000Z","dependencies_parsed_at":"2025-01-13T00:08:06.226Z","dependency_job_id":null,"html_url":"https://github.com/BashMocha/Reinforcement-Learning-in-AirSim","commit_stats":null,"previous_names":["bashmocha/reinforcement-learning-in-airsim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BashMocha/Reinforcement-Learning-in-AirSim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2FReinforcement-Learning-in-AirSim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2FReinforcement-Learning-in-AirSim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2FReinforcement-Learning-in-AirSim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2FReinforcement-Learning-in-AirSim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BashMocha","download_url":"https://codeload.github.com/BashMocha/Reinforcement-Learning-in-AirSim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2FReinforcement-Learning-in-AirSim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31775694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airsim","autonomous-driving","autonomous-vehicles","deep-q-learning","deep-reinforcement-learning","path-tracing","reinforcement-learning"],"created_at":"2025-01-28T15:35:49.540Z","updated_at":"2026-04-13T23:31:18.270Z","avatar_url":"https://github.com/BashMocha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Autonomous Driving in AirSim by Reinforcement Learning\n\n\u003e Autonomous driving for path tracking in AirSim by applying the Deep-Q Network algorithm. See the [documentation](https://github.com/BashMocha/Reinforcement-Learning-in-AirSim/blob/master/docs/Reinforcement_Learning_on_Autonomous_Vehicles.pdf) for a detailed explanation.\n\u003cbr\u003e\n\nhttps://github.com/user-attachments/assets/b0d4f22b-c0f4-4c71-89e6-18a2df161953\n\n\n---\n\n\n## Simulation Environment\n[AirSim's](https://github.com/microsoft/AirSim/) neighborhood environment [(AirSimNH)](https://github.com/microsoft/AirSim/releases/tag/v1.8.1-windows) is utilized due to its simple structure, making it well-suited for path-tracking algorithms. The project has been tested on Windows 11 but not on Linux; therefore, running the scripts on a Windows operating system is recommended.\n\nThe simulation environment can be downloaded from the project's [release page](https://github.com/microsoft/AirSim/releases/tag/v1.8.1-windows). To configure the environment, move the `settings.json` file to the `%userprofile%\\Documents\\AirSim` and run the `AirSimNH\\WindowsNoEditor\\AirsimNH.exe` from the environment folder. Once the simulation is running, a Python script containing the following lines can connect to the environment for API calls:\n\n```python\n    import airsim\n\n    client = airsim.CarClient()\n    client.confirmConnection()     \n    client.enableApiControl(True)  \n    car_controls = airsim.CarControls()\n```\n\n## Conda environment\nRun the following commands to create and activate the conda environment with the required dependencies\n```\n  conda env create -f environment.yml\n  conda activate airsim\n```\n\n## Usage\n\n### Training\nOnce the simulation environment is running, execute the `train.py` script to connect to it. By default, the agent is trained for 1000 epochs, but this can be adjusted using the `episodes` parameter in the script.\n```\n  python train.py\n```\n\nSince this is a path-tracking application, the reference route is specified by the `waypoints` list in the script.\n```python\nwaypoints = [\n        # Starting Street\n        airsim.Vector3r(-3.8146975356312396e-08, 7.445784285664558e-05, -0.5857376456260681),  # Starting point\n        airsim.Vector3r(21.836427688598633, -0.024445464834570885, -0.5837180614471436),       # White car\n        airsim.Vector3r(51.68717575073242, -0.5642141103744507, -0.584981381893158),           # Red car\n        airsim.Vector3r(80.388427734375, -1.1560953855514526, -0.5853434801101685),            # Near end of the street\n        ]\n```\n\nRun `custom_collect_poses.py` to control the car for position data collection. The collected position data will be stored in `%userprofile%\\Documents\\AirSim`.\n```\n  python custom_collect_poses.py\n```\n\n### Transfer Learning\nThe network weights will be saved after training. Running `load_model.py` will load and execute the saved weights.\n```\n  python load_model.py\n```\n\n## Path Evaluation\nTo evaluate the model's path-tracking performance, robotics navigation metrics (SR, OSR, NE, SDTW, NDTW, CLS) are provided in the `evaluation.py` script. Executing the script will generate a comparison plot of the resulting and reference trajectories.\n\nSee the [documentation](https://github.com/BashMocha/Reinforcement-Learning-in-AirSim/blob/master/docs/Reinforcement_Learning_on_Autonomous_Vehicles.pdf) for a detailed explanation of metrics.\n```\n  python evaluation.py\n```\n![trajectory-comp](https://github.com/user-attachments/assets/7101f733-4821-47eb-b740-276b05968c61)\n\n\n## DQN Algorithm\nA simple DQN is built to train the agents for the given path. RGB and GPS sensors are used as inputs to the network, and an action is obtained as the output. This approach enables the agent to track the path and avoid obstacles effectively.\n\nSee the [documentation](https://github.com/BashMocha/Reinforcement-Learning-in-AirSim/blob/master/docs/Reinforcement_Learning_on_Autonomous_Vehicles.pdf) for a detailed explanation of the utilized network.\n\n![scheme-updated(1)](https://github.com/user-attachments/assets/e8e0eee5-dfb0-4d72-87fd-4fd66ae67a49)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashmocha%2Freinforcement-learning-in-airsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbashmocha%2Freinforcement-learning-in-airsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashmocha%2Freinforcement-learning-in-airsim/lists"}