Create a new instance.
The name of the vehicle.
The vehicle controller, default = SimpleFlight
Vehicle blueprint path, when undefined uses the default blueprint.
The low-level AirSim api and network connection.
Readonly
controllerReadonly
nameReadonly
pawnStatic
DEFAULT_Access the default controller (e.g., flight controller) of the vehicle.
The drone must be armed before it will fly. Set arm to true to arm the drone. On some drones arming may cause the motors to spin on low throttle, this is normal.
Promise
Experimental - Rotate a camera to point towards a target position.
A Promise
The name or id of the camera to move.
The position to point camera towards.
Set True when camera is mounting looking towards the rear of the vehicle, default = false.
Experimental - Rotate a camera to point towards a target position.
A Promise
The name or id of the camera to move.
The position to point camera towards.
Set True when camera is mounting looking towards the rear of the vehicle, default = false.
Terminate the current task execution.
Promise
Clear a detection search
A Promise
Disables API control.
A Promise
This will disable the motors, so don't do that unless the drone is on the ground! Arming the drone also sets the "home position" This home position is local position x=0,y=0,z=0. You can query what GPS location that is via getHomeGeo().
Promise
Enables API control.
A Promise
Find the detections in the camera field of view defined by the search details
Array of object detections
Access the data from an barometer sensor.
The barometer sensor data
Name of barometer to get data from, specified in settings.json
Get details about the vehicle camera.
Note if the cameraName is unknown to airsim, the server may crash.
A CameraInfo promise
Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Get the vehicle's collision state.
The collision state info.
Get details about the vehicle camera.
Note if the cameraName is unknown to airsim, the server may crash.
A CameraInfo promise
Access distance sensor data.
The distance data
Name of distance sensor to get data from, specified in settings.json
Get ground truth environment state The position inside the returned EnvironmentState is in the frame of the vehicle's starting point
Ground truth environment state
Get ground-truth kinematics of the vehicle The position inside the returned KinematicsState is in the frame of the vehicle's starting point
Ground truth of the vehicle
Get the Home NED-frame location (north, east, down) of the vehicle.
The Home location of the vehicle
Get a single image in compressed PNG format.
Promise
Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Type of image
Get multiple images
for details and examples
The ImageResponse(s)
Images required
Access the data from an IMU sensor.
The IMU sensor data
Name of IMU to get data from, specified in settings.json
Access the data from a LIDAR sensor.
The LIDAR sensor data
Name of IMU to get data from, specified in settings.json
Access the data from an magnetometer sensor.
The magnetometer sensor data
Name of Magnetometer to get data from, specified in settings.json
Access the vehicle's Pose
The vehicle pose.
Obtain the current state of all a multirotor's rotors. The state includes the speeds, thrusts and torques for all rotors.
RotorStates containing a timestamp, the speed, thrust and torque of all rotors
The position inside the returned MultirotorState is in the frame of the vehicle's starting point
The drone state
Initiate a return-to-home, i.e. Launch location, task which must be completed within timeoutSec.
Promise
Timeout (seconds) to complete task.
Hover at the current x, y, and z. If the drone is moving when this is called, it will try and move back to the location it was at when this command was received and hover there.
A void promise to await on.
Returns true if API control is established.
Promise
At any point this command will disable offboard control and land the drone at the current GPS location How quickly the drone descends is up to the drone. Some models will descend slowly if they have no lidar telling them how far it is to the ground, while others that can see the ground will descend more quickly until they get near the ground. None of that behavior is defined in this API because it is depends on what kind of hardware the drone has onboard. Pass non-zero timeoutSec if you want the method to wait until the drone reports it has landed, the timeout here is a bit tricky, depends on how high you are and what the drone's configured descent velocity is. If you don't want to wait pass zero. You can also periodically check getLandedState() to see if it has landed.
Promise
Timeout (seconds) for the vehicle to land
Apply radio controller data commands and settings.
A Promise
The radio controller settings to apply.
Move by velocity to the world (NED) XYZ axes.
Promise
Desired velocity in world (NED) X axis.
Desired velocity in world (NED) Y axis.
Desired velocityvin world (NED) Z axis.
Amount of time (seconds), to send this command.
The drivetrain mode to use.
The rate (deg/sec) or angle (deg) of yaw maneuvering
Move by velocity relative to the vehicle's XYZ axies.
Desired velocity in the X axis of the vehicle's local NED frame.
Desired velocity in the Y axis of the vehicle's local NED frame.
Desired velocity in the Z axis of the vehicle's local NED frame.
Desired amount of time (seconds), to send this command.
The drivetrain mode to use.
The rate (deg/sec) or angle (deg) of yaw maneuvering
Move by velocity to the world (NED) XY axes with fixed Z (NED) position.
Promise
Desired velocity in world (NED) X axis.
Desired velocity in world (NED) Y axis.
Desired Z position in world (NED) Z axis.
Amount of time (seconds), to send this command.
The drivetrain mode to use.
The rate (deg/sec) or angle (deg) of yaw maneuvering
Move by velocity relative to the vehicle's XY axies at Z altitude.
Desired velocity (m/s) in the X axis of the vehicle's local NED frame.
Desired velocity (m/s) in the Y axis of the vehicle's local NED frame.
Desired Z position (m) in vehicle's local NED frame.
Desired amount of time (seconds), to send this command.
The drivetrain mode to use.
The rate (deg/sec) or angle (deg) of yaw maneuvering
Initiate a task to follow a path consisting of waypoints.
Promise
The 3d points for the path trajectory
The target speed (m/s)
The maximum time (seconds) for this task to complete
The drivetrain mode to use
The yaw configuration
How far to look ahead on the path (default -1 means auto)
Whether to apply adaptive lookahead (1=yes, 0=no)
Initiate task to relocate vehile to a XY position with fixed Z (height) within timeoutSec.
A Promise
Target latitude (North, South) coordinate.
Target longitude (East, West) coordinate.
Altitude in meters
The velocity m/s by which to relocate.
The maximum time (seconds) to complete this relocation.
How far (m) to look ahead on the path (default -1 means auto)
Initiate task to relocate vehile to a new 3D position within timeoutSec.
A void promise to await on
The target position.
The velocity (m/s) by which to relocate.
The maximum time (seconds) to complete this relocation.
The drivetrain mode to use
The rate of yaw maneuvering
How far to look ahead on the path (default -1 means auto)
Whether to apply adaptive lookahead (1=yes, 0=no)
Initiate task to relocate vehile to a XY position with fixed Z (height) within timeoutSec.
A Promise
The target NED Z position (negative is up) in meters,.
The velocity m/s by which to relocate.
The maximum time (seconds) to complete this relocation.
The rate of yaw maneuvering
How far to look ahead on the path (default -1 means auto)
Whether to apply adaptive lookahead (1=yes, 0=no)
Rotate the drone to the specified yaw rate while remaining stationery at the current x, y, and z.
Promise
rate in degrees/second
length of time to apply this command
Initiate rotation task to absolute yaw angle (deg) of home position in degrees.
Promise
angle in degrees
maximum time in seconds to complete manuever
+/- allowable error in degrees
Control the field of view of a selected camera
A Promise
Name of the camera to be controlled
Value of field of view in degrees
Control the pose of a selected camera
A void promise to await on.
Name of the camera to be controlled
Pose representing the desired position and orientation of the camera
Set the kinematics state of the vehicle If you don't want to change position (or orientation) then just set components of position (or orientation) to floating point nan values
Desired Pose pf the vehicle
Whether to ignore any collision or not
Set the pose of the vehicle.
A Promise
The new pose.
Whether to ignore any collision or not
Modify the color and thickness of the line when tracing is enabled.
Tracing can be enabled by pressing T in the Editor or
setting EnableTrace
to True
in the Vehicle Settings
A Promise
the RGBA tuple or CSS color name.
Thickness of the line
Configure a camera to perform a computer vision search and detection of specific mesh object(s).
A Promise
Example for detecting all instances named "Car_*"
startDetectionSearch(
{
camera: 'front_center',
image_type: ImageType.Scene,
meshName: 'Car_*'
}
);
The search details
When armed you can tell the drone to takeoff. This will fly to a preset altitude of 3 metters above the home position. Once the drone is safely in the air you can use other commands to fly from there. If the drone is already flying takeoff will be ignored. Pass non-zer max_wait_seconds if you want the method to also wait until the takeoff altitude is achieved.
A boolean Promise
Timeout (seconds) for the vehicle to reach desired altitude. A value of 0 implies no timeout.
Returns whether the target point is visible from the perspective of the vehicle
Promise
Target point
Wait on the current task being executed.
Promise
seconds to wait for task completion.
The base class for AirSim vehicles providing access to a vehicle's state, position, orientation, sensor data, cameras and images, collision info and visibility to points test.