{"id":21077420,"url":"https://github.com/ros2jsguy/airsim-js","last_synced_at":"2026-01-12T05:51:38.433Z","repository":{"id":41142110,"uuid":"498102315","full_name":"ros2jsguy/airsim-js","owner":"ros2jsguy","description":"TypeScript client library for Microsoft AirSim Simulator","archived":false,"fork":false,"pushed_at":"2023-10-23T23:58:12.000Z","size":2741,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-17T21:38:37.618Z","etag":null,"topics":["airsim","drone","javascript","robotics","simulation","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ros2jsguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2022-05-30T21:33:18.000Z","updated_at":"2024-12-17T19:37:51.000Z","dependencies_parsed_at":"2025-05-16T08:33:29.320Z","dependency_job_id":"9f0e4121-9b41-457f-a6e2-d8ccca5e1d5a","html_url":"https://github.com/ros2jsguy/airsim-js","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":"santoshshinde2012/node-boilerplate","purl":"pkg:github/ros2jsguy/airsim-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ros2jsguy%2Fairsim-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ros2jsguy%2Fairsim-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ros2jsguy%2Fairsim-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ros2jsguy%2Fairsim-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ros2jsguy","download_url":"https://codeload.github.com/ros2jsguy/airsim-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ros2jsguy%2Fairsim-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","drone","javascript","robotics","simulation","typescript"],"created_at":"2024-11-19T19:36:41.161Z","updated_at":"2026-01-12T05:51:38.414Z","avatar_url":"https://github.com/ros2jsguy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# An AirSim client library for NodejsS\n\nProgrammatically configure and control the [Microsoft AirSim](https://microsoft.github.io/AirSim/) \nsimulation environment and hosted virtual cars and multirotor vehicles from a Nodejs app. The TypeScript\nAPI is documented and super easy to use. To facilitate your learning a wide range of examples and AirSim\nsettings files is provided.    \n\n![Blocks World](./blocks.png)\n# Quick Start\nYou will need to have the Nodejs environment installed on your system to complete this Quick Start. \nSee [here](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) for instructions.\n\n## Step-1\nCreate and intialize a Nodejs TypeScript package. Begin by entering the following cmds from a shell: \n```\nmkdir airsim-ping\ncd airsim-ping\nnpm init -y\nnpm i airsim-js\nnpm i typescript @types/node --save-dev\nnpx tsc -init\n```\n## Step-2\nCreate a file named `ping.ts` and add the following code.\n```typescript\n// ping.ts - Runs AirSim ping command\nimport { AirSim, Vehicle } from 'airsim-js';\n\nasync function main() {\n  // create airsim client; assumes AirSim server is on localhost\n  const airsim = new AirSim(Vehicle);\n  \n  let result = await airsim.connect();\n  console.log('connected: ', result);\n\n  console.log('Calling ping');\n  result = await airsim.ping();\n  console.log(`result: ${result}`);\n\n  await airsim.confirmConnection();\n  airsim.close();\n}\n\nmain();\n```\n## Step-3\nCompile ping.ts\n```\nnpx tsc\n```\n## Step-4\nNext start up an AirSim environment on localhost, e.g., Blocks.\nYou can find prebuilt AirSim binaries (Win,Linux) [here](https://github.com/Microsoft/AirSim/releases).\n\n## Step-5\nRun ping.js\n```\nnode ping.js\n```\nYour output should be similar to this:\n```\n$ node ping.js\nconnected:  true\nCalling ping\nresult: true\nConnected!\nClient Ver: 1 (Min Req: 1)\nServer Ver: 1 (Min Req: 1)\n```\n\nBingo! you've just developed your first AirSim-js client application.\n\nSee the wide range of exmples on github.\n\n# API Overview\nThe majority of the AirSim-js api is Promise-based as communications with\nan AirSim server is via msgpack-rpc over a TCP socket. The main components\nyou'll work with and their relationships are shown below.\n```\n\n    AirSim ---uses---\u003e Vehicle               CarState           BarometerData\n      |                /   ^                 CarControls        DistanceSensorData\n     uses             / inherits             CollisionInfo      GpsData\n      v              /     |                 CameraInfo         ImuData\n   Session\u003c---uses--/   --------             ImageType          LidarData\n                        |      |             ImageRequest       Box2\n                       Car  Multirotor       ImageResponse      Box3\n                                             KinematicsState    Vector2\n                                             MultirotorState    Vector3\n                                             DrivetrainType     Pose3\n                                             LandedState\n                                             YawMode\n```\n\n### AirSim\nThe AirSim class is the main entry point to the package. It creates and manages a Session and Vehicles instances. Use the AirSim class to access and control an AirSim environment such as the time-of-day, pause/step/resume, session recording, weather, external cameras, and dynamically add and delete vehicles and draw lines, arrows, messages and transforms.\n\n**AirSim Constructor**   \nAn AirSim environment host only Car or Multirotor vehicles, never both simultaneously. Therefore the `AirSim()` constructor requires that you provide a Vehicle type parameter so that `getVehciles()` \nknows the proper type of Vehicle to construct and return.\n\nExamples:\n```typescript\n  import { AirSim } from 'airsim-js';\n\n  // minimal parameters, default IP (localhost) and port (41451)\n  let airsim = new AirSim(Vehicle);\n  let airsim = new AirSim(Car);\n  let airsim = new AirSim(Multirotor);\n\n  // localhost, custom port\n  let airsim = new AirSim(Car, 80);\n\n  // remote server, default port\n  let airsim = new AirSim(Multirotor, undefined, '172.21.96.1');\n\n  // remote server, custom port and IP\n  let airsim = new AirSim(Vehicle, 41451, '172.21.96.1');\n```\n\n### Session\nThe Session class is a gateway for converting API function calls into msgpack-rpc requests/response over a TCP connection with an AirSim server. In general you will not need to directly interact with Session. This class is patterned\nafter the [AirSim Python client](https://github.com/microsoft/AirSim/blob/master/PythonClient/airsim/client.py). When needed use the low-level Session `_call()` method to interact directly at the msgpack-rpc layer.\n\n### Vehicle\nThe Vehicle class provides the common properties and behaviors for all AirSim vehicles such as a name, api control, \nposition and orientation, sensor data access, collision detection, camera information and requesting images.    \n\nexample import\n```\n  import { Vehicle } from 'airsim-js';\n```\n\n**NOTE**\nWhen accessing a vehicle's cameras with `getCameraInfo(cameraName)`, only use valid camera names. Using an unknown camera name frequently results in the AirSim environment crashing. Use `Vehicle.getDefaultCameraNames()` for a list of valid camera names. \n\n### Car\nThe Car class extends Vehicle with API for accessing a car's state\nand controlling its movement. Additionally can create new Car instances \nand dynamically add them to an AirSim environment. Key classes for working \nwith cars are `Car`, `CarState`, `CarControls` and sensor data access such \nas `LidarData`.    \n\u003c/b\u003e\nexample import\n```\n  import { Car } from 'airsim-js';\n```\n\n### MultiRotor, aka Drone\nThe Multirotor class extends Vehicle with API for accessing a drone's state and controlling its movement. High-level \ntask-oriented api include: `takeoff()`, `hover()`, \n`moveToPosition()`, `goHome()` and `land()`.\n\nSimilar to Car, a multirotor instance can be created dynamically and added to an AirSim environment. Key classes when working with multirotors incldue\n`Multirotor`, `MultirotorState`, `RotorStates`, `Camera` and the various sensor data.    \n\u003c/b\u003e\nexample import\n```\n  import { Multirotor } from 'airsim-js';\n```\n\n### Math\nThe api uses a standalone TypeScript version of the [Three.js](https://threejs.org/docs/index.html) math module for the following classes:\n* [Box2](https://ros2jsguy.github.io/three.math/classes/Box2.html)\n* [Box3](https://ros2jsguy.github.io/three.math/classes/Box3.html)\n* [Euler](https://ros2jsguy.github.io/three.math/classes/Euler.html)\n* [Quaternion](https://ros2jsguy.github.io/three.math/classes/Quaternion.html)\n* [Vector2](https://ros2jsguy.github.io/three.math/classes/Vector2.html)\n* [Vector3](https://ros2jsguy.github.io/three.math/classes/Vector3.html)\n\nAdditional three.js math classes are available for your application use. You can find more information including my updated fork of the three-math-ts library [here](https://ros2jsguy.github.io/three.math/index.html).\n# Examples, How-To's, FAQ - *work in progress*\n[AirSim-js wiki](https://github.com/ros2jsguy/airsim-js/wiki)    \n[API documentation](https://ros2jsguy.github.io/airsim-js/api)\n\n\u003c/br\u003e\n\n# Team\nPlease connect with me on Twitter [@ros2jsguy](https://twitter.com/ros2jsguy) \u0026 [https://medium.com/@ros2jsguy](https://medium.com/@ros2jsguy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fros2jsguy%2Fairsim-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fros2jsguy%2Fairsim-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fros2jsguy%2Fairsim-js/lists"}