airsimdroneracinglab
¶
Submodules¶
Package Contents¶
Classes¶
|
|
|
|
|
|
Type of DrivetrainType |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Struct YawMode with two fields, yaw_or_rate and is_rate. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Struct to store values of PID gains. Used to transmit controller gain values while instantiating |
|
Struct to contain controller gains used by angle level PID controller |
|
Struct to contain controller gains used by angle rate PID controller |
|
Struct to contain controller gains used by velocity PID controller |
|
Struct to contain controller gains used by position PID controller |
|
Struct to contain trajectory tracker gains used by the pure pursuit controller for moveBySpline and moveBySplineVelConstraints |
|
|
Type of DrivetrainType |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Struct YawMode with two fields, yaw_or_rate and is_rate. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Struct to store values of PID gains. Used to transmit controller gain values while instantiating |
|
Struct to contain controller gains used by angle level PID controller |
|
Struct to contain controller gains used by angle rate PID controller |
|
Struct to contain controller gains used by velocity PID controller |
|
Struct to contain controller gains used by position PID controller |
|
Struct to contain trajectory tracker gains used by the pure pursuit controller for moveBySpline and moveBySplineVelConstraints |
|
|
Type of DrivetrainType |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Struct YawMode with two fields, yaw_or_rate and is_rate. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Struct to store values of PID gains. Used to transmit controller gain values while instantiating |
|
Struct to contain controller gains used by angle level PID controller |
|
Struct to contain controller gains used by angle rate PID controller |
|
Struct to contain controller gains used by velocity PID controller |
|
Struct to contain controller gains used by position PID controller |
|
Struct to contain trajectory tracker gains used by the pure pursuit controller for moveBySpline and moveBySplineVelConstraints |
|
Class for drone_2, which flies through gates using moveOnSpline when simStartRace is called. |
|
|
Type of DrivetrainType |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Struct YawMode with two fields, yaw_or_rate and is_rate. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Struct to store values of PID gains. Used to transmit controller gain values while instantiating |
|
Struct to contain controller gains used by angle level PID controller |
|
Struct to contain controller gains used by angle rate PID controller |
|
Struct to contain controller gains used by velocity PID controller |
|
Struct to contain controller gains used by position PID controller |
|
Struct to contain trajectory tracker gains used by the pure pursuit controller for moveBySpline and moveBySplineVelConstraints |
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Wait for a key press on the console and return it. |
|
Read a pfm file |
|
Write a pfm file |
|
image must be numpy array H X W X channels |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Wait for a key press on the console and return it. |
|
Read a pfm file |
|
Write a pfm file |
|
image must be numpy array H X W X channels |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Wait for a key press on the console and return it. |
|
Read a pfm file |
|
Write a pfm file |
|
image must be numpy array H X W X channels |
-
class
airsimdroneracinglab.
VehicleClient
(ip='', port=41451, timeout_value=3600)¶ -
__annotations__
¶
-
reset
(self)¶ Reset the vehicle to its original starting state
Note that you must call enableApiControl and armDisarm again after the call to reset
-
ping
(self)¶ If connection is established then this call will return true otherwise it will be blocked until timeout
- Returns
- Return type
-
getClientVersion
(self)¶
-
getServerVersion
(self)¶
-
getMinRequiredServerVersion
(self)¶
-
getMinRequiredClientVersion
(self)¶
-
enableApiControl
(self, vehicle_name='')¶ Enables API control for vehicle with name vehicle_name
-
disableApiControl
(self, vehicle_name='')¶ Disables API control for vehicle with name vehicle_name
-
isApiControlEnabled
(self, vehicle_name='')¶ Returns true if API control is established.
If false (which is default) then API calls would be ignored. After a successful call to enableApiControl, isApiControlEnabled should return true.
-
arm
(self, vehicle_name='')¶ Arms vehicle corresponding to vehicle_name
-
disarm
(self, vehicle_name='')¶ Disarms vehicle corresponding to vehicle_name.
-
simPause
(self, is_paused)¶ Pauses simulation
- Parameters
is_paused (bool) – True to pause the simulation, False to release
-
simIsPause
(self)¶ Returns true if the simulation is paused
- Returns
If the simulation is paused
- Return type
-
simContinueForTime
(self, seconds)¶ Continue the simulation for the specified number of seconds
- Parameters
seconds (float) – Time to run the simulation for
-
getHomeGeoPoint
(self, vehicle_name='')¶ Get the Home location of the vehicle
-
confirmConnection
(self)¶ Checks state of connection every 1 sec and reports it in Console so user can see the progress for connection.
-
simSwapTextures
(self, tags, tex_id=0, component_id=0, material_id=0)¶ Runtime Swap Texture API
See https://microsoft.github.io/AirSim/retexturing/ for details
- Parameters
tags (str) – string of “,” or “, ” delimited tags to identify on which actors to perform the swap
tex_id (int, optional) –
indexes the array of textures assigned to each actor undergoing a swap
If out-of-bounds for some object’s texture set, it will be taken modulo the number of textures that were available
component_id (int, optional) –
material_id (int, optional) –
- Returns
List of objects which matched the provided tags and had the texture swap perfomed
- Return type
-
simSetTimeOfDay
(self, is_enabled, start_datetime='', is_start_datetime_dst=False, celestial_clock_speed=1, update_interval_secs=60, move_sun=True)¶ Control the position of Sun in the environment
Sun’s position is computed using the coordinates specified in OriginGeopoint in settings for the date-time specified in the argument, else if the string is empty, current date & time is used
- Parameters
is_enabled (bool) – True to enable time-of-day effect, False to reset the position to original
start_datetime (str, optional) – Date & Time in %Y-%m-%d %H:%M:%S format, e.g. 2018-02-12 15:20:00
is_start_datetime_dst (bool, optional) – True to adjust for Daylight Savings Time
celestial_clock_speed (float, optional) – Run celestial clock faster or slower than simulation clock E.g. Value 100 means for every 1 second of simulation clock, Sun’s position is advanced by 100 seconds so Sun will move in sky much faster
update_interval_secs (float, optional) – Interval to update the Sun’s position
move_sun (bool, optional) – Whether or not to move the Sun
-
simEnableWeather
(self, enable)¶ Enable Weather effects. Needs to be called before using simSetWeatherParameter API
- Parameters
enable (bool) – True to enable, False to disable
-
simSetWeatherParameter
(self, param, val)¶ Enable various weather effects
- Parameters
param (WeatherParameter) – Weather effect to be enabled
val (float) – Intensity of the effect, Range 0-1
-
simSetTextureFromUrl
(self, object_name, url)¶ Set texture of an object from a URL resource.
- Parameters
object_name (string) – Name of object for which the texture is to be set
url (string) – URL of texture file
-
simGetImage
(self, camera_name, image_type, vehicle_name='')¶ Get a single image
Returns bytes of png format image which can be dumped into abinary file to create .png image string_to_uint8_array() can be used to convert into Numpy unit8 array See https://microsoft.github.io/AirSim/image_apis/ for details
-
simGetImages
(self, requests, vehicle_name='')¶ Get multiple images
See https://microsoft.github.io/AirSim/image_apis/ for details and examples
- Parameters
requests (list[ImageRequest]) – Images required
vehicle_name (str, optional) – Name of vehicle associated with the camera
- Returns
- Return type
-
simGetMeshPositionVertexBuffers
(self)¶ Returns the static meshes that make up the scene
See https://microsoft.github.io/AirSim/meshes/ for details and how to use this
- Returns
- Return type
-
simGetCollisionInfo
(self, vehicle_name='')¶ - Parameters
vehicle_name (str, optional) – Name of the Vehicle to get the info of
- Returns
- Return type
-
simSetVehiclePose
(self, pose, ignore_collison, vehicle_name='')¶ Set the pose 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
-
simGetVehiclePose
(self, vehicle_name='')¶
-
simSetTraceLine
(self, color_rgba, thickness=1.0, vehicle_name='')¶ 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
-
simGetObjectPose
(self, object_name)¶ Returns true pose if simstartrace is not called Returns true pose if simstartrace was called with tier=1 Returns noisy pose if simstartrace was called with tier=2 or tier=3
-
__internalGetObjectPose
(self, object_name)¶
-
simSetObjectPose
(self, object_name, pose, teleport=True)¶ Set the pose of the object(actor) in the environment
The specified actor must have Mobility set to movable, otherwise there will be undefined behaviour. See https://www.unrealengine.com/en-US/blog/moving-physical-objects for details on how to set Mobility and the effect of Teleport parameter
-
simGetNominalGateInnerDimensions
(self)¶ Return the dimensions of the drone racing gate cavity, with scale (width=1.0, thickness=1.0, height=1.0)
Use this API in conjunction with simGetObjectScale(), simSetObjectScale(), simSetObjectPose() to generate arbitrary sized checkered gates with arbitrary poses.
- Returns
width, thickness, height of the gate inner cavity in meters. See https://github.com/microsoft/AirSim-NeurIPS2019-Drone-Racing/issues/28 for gate coordinate system
- Return type
-
simGetNominalGateOuterDimensions
(self)¶ Return the outer dimensions of the drone racing gate, with scale (width=1.0, thickness=1.0, height=1.0)
Use this API in conjunction with simGetObjectScale(), simSetObjectScale(), simSetObjectPose() to generate arbitrary sized checkered gates with arbitrary poses.
- Returns
width, thickness, height of the gate inner cavity in meters. See https://github.com/microsoft/AirSim-NeurIPS2019-Drone-Racing/issues/28 for gate coordinate system
- Return type
-
simGetObjectScale
(self, object_name)¶
-
simGetObjectScaleInternal
(self, object_name)¶
-
simSetObjectScale
(self, object_name, scale_vector)¶
-
simLoadLevel
(self, level_name)¶ Loads desired level
- Parameters
level_name (str) – Description
- Returns
Description
- Return type
TYPE
-
simListSceneObjects
(self, name_regex='.*')¶ Lists the objects present in the environment
Default behaviour is to list all objects, regex can be used to return smaller list of matching objects or actors
-
simSetSegmentationObjectID
(self, mesh_name, object_id, is_name_regex=False)¶ Set segmentation ID for specific objects
See https://microsoft.github.io/AirSim/image_apis/#segmentation for details
- Parameters
mesh_name (str) – Name of the mesh to set the ID of (supports regex)
object_id (int) –
Object ID to be set, range 0-255
RBG values for IDs can be seen at https://microsoft.github.io/AirSim/seg_rgbs.txt
is_name_regex (bool, optional) – Whether the mesh name is a regex
- Returns
If the mesh was found
- Return type
-
simGetSegmentationObjectID
(self, mesh_name)¶ Returns Object ID for the given mesh name
Mapping of Object IDs to RGB values can be seen at https://microsoft.github.io/AirSim/seg_rgbs.txt
- Parameters
mesh_name (str) – Name of the mesh to get the ID of
-
simPrintLogMessage
(self, message, message_param='', severity=0)¶ Prints the specified message in the simulator’s window.
If message_param is supplied, then it’s printed next to the message and in that case if this API is called with same message value but different message_param again then previous line is overwritten with new line (instead of API creating new line on display).
For example, simPrintLogMessage(“Iteration: “, to_string(i)) keeps updating same line on display when API is called with different values of i. The valid values of severity parameter is 0 to 3 inclusive that corresponds to different colors.
-
simGetCameraInfo
(self, camera_name, vehicle_name='')¶ Get details about the camera
- Parameters
- Returns
- Return type
-
simSetCameraOrientation
(self, camera_name, orientation, vehicle_name='')¶ Control the orientation of a selected camera
- Parameters
camera_name (str) – Name of the camera to be controlled
orientation (Quaternionr) – Quaternion representing the desired orientation of the camera
vehicle_name (str, optional) – Name of vehicle which the camera corresponds to
-
simSetCameraFov
(self, camera_name, fov_degrees, vehicle_name='')¶ Control the field of view of a selected camera
-
simGetGroundTruthKinematics
(self, vehicle_name='')¶ Get Ground truth kinematics of the vehicle
- Parameters
vehicle_name (str, optional) – Name of the vehicle
- Returns
Ground truth of the vehicle
- Return type
-
simGetGroundTruthEnvironment
(self, vehicle_name='')¶ Get ground truth environment state
- Parameters
vehicle_name (str, optional) – Name of the vehicle
- Returns
Ground truth environment state
- Return type
-
getImuData
(self, imu_name='', vehicle_name='')¶
-
getBarometerData
(self, barometer_name='', vehicle_name='')¶ - Parameters
- Returns
- Return type
-
getMagnetometerData
(self, magnetometer_name='', vehicle_name='')¶ - Parameters
- Returns
- Return type
-
getGpsData
(self, gps_name='', vehicle_name='')¶
-
getDistanceSensorData
(self, distance_sensor_name='', vehicle_name='')¶ - Parameters
- Returns
- Return type
-
getLidarData
(self, lidar_name='', vehicle_name='')¶
-
simGetLidarSegmentation
(self, lidar_name='', vehicle_name='')¶ Returns Segmentation ID of each point’s collided object in the last Lidar update
-
simFlushPersistentMarkers
(self)¶ Clear any persistent markers - those plotted with setting is_persistent=True in the APIs below
-
simPlotPoints
(self, points, color_rgba=[1.0, 0.0, 0.0, 1.0], size=10.0, duration=- 1.0, is_persistent=False)¶ Plot a list of 3D points in World NED frame
-
simPlotLineStrip
(self, points, color_rgba=[1.0, 0.0, 0.0, 1.0], thickness=5.0, duration=- 1.0, is_persistent=False)¶ Plots a line strip in World NED frame, defined from points[0] to points[1], points[1] to points[2], … , points[n-2] to points[n-1]
- Parameters
points (list[Vector3r]) – List of 3D locations of line start and end points, specified as Vector3r objects
color_rgba (list, optional) – desired RGBA values from 0.0 to 1.0
thickness (float, optional) – Thickness of line
duration (float, optional) – Duration (seconds) to plot for
is_persistent (bool, optional) – If set to True, the desired object will be plotted for infinite time.
-
simPlotLineList
(self, points, color_rgba=[1.0, 0.0, 0.0, 1.0], thickness=5.0, duration=- 1.0, is_persistent=False)¶ Plots a line strip in World NED frame, defined from points[0] to points[1], points[2] to points[3], … , points[n-2] to points[n-1]
- Parameters
points (list[Vector3r]) – List of 3D locations of line start and end points, specified as Vector3r objects. Must be even
color_rgba (list, optional) – desired RGBA values from 0.0 to 1.0
thickness (float, optional) – Thickness of line
duration (float, optional) – Duration (seconds) to plot for
is_persistent (bool, optional) – If set to True, the desired object will be plotted for infinite time.
-
simPlotArrows
(self, points_start, points_end, color_rgba=[1.0, 0.0, 0.0, 1.0], thickness=5.0, arrow_size=2.0, duration=- 1.0, is_persistent=False)¶ Plots a list of arrows in World NED frame, defined from points_start[0] to points_end[0], points_start[1] to points_end[1], … , points_start[n-1] to points_end[n-1]
- Parameters
points_start (list[Vector3r]) – List of 3D start positions of arrow start positions, specified as Vector3r objects
points_end (list[Vector3r]) – List of 3D end positions of arrow start positions, specified as Vector3r objects
color_rgba (list, optional) – desired RGBA values from 0.0 to 1.0
thickness (float, optional) – Thickness of line
arrow_size (float, optional) – Size of arrow head
duration (float, optional) – Duration (seconds) to plot for
is_persistent (bool, optional) – If set to True, the desired object will be plotted for infinite time.
-
simPlotStrings
(self, strings, positions, scale=5, color_rgba=[1.0, 0.0, 0.0, 1.0], duration=- 1.0)¶ Plots a list of strings at desired positions in World NED frame.
- Parameters
strings (list[String], optional) – List of strings to plot
positions (list[Vector3r]) – List of positions where the strings should be plotted. Should be in one-to-one correspondence with the strings’ list
scale (float, optional) – Font scale of transform name
color_rgba (list, optional) – desired RGBA values from 0.0 to 1.0
duration (float, optional) – Duration (seconds) to plot for
-
simPlotTransforms
(self, poses, scale=5.0, thickness=5.0, duration=- 1.0, is_persistent=False)¶ Plots a list of transforms in World NED frame.
- Parameters
poses (list[Pose]) – List of Pose objects representing the transforms to plot
scale (float, optional) – Length of transforms’ axes
thickness (float, optional) – Thickness of transforms’ axes
duration (float, optional) – Duration (seconds) to plot for
is_persistent (bool, optional) – If set to True, the desired object will be plotted for infinite time.
-
simPlotTransformsWithNames
(self, poses, names, tf_scale=5.0, tf_thickness=5.0, text_scale=10.0, text_color_rgba=[1.0, 0.0, 0.0, 1.0], duration=- 1.0)¶ Plots a list of transforms with their names in World NED frame.
- Parameters
poses (list[Pose]) – List of Pose objects representing the transforms to plot
names (list[string]) – List of strings with one-to-one correspondence to list of poses
tf_scale (float, optional) – Length of transforms’ axes
tf_thickness (float, optional) – Thickness of transforms’ axes
text_scale (float, optional) – Font scale of transform name
text_color_rgba (list, optional) – desired RGBA values from 0.0 to 1.0 for the transform name
duration (float, optional) – Duration (seconds) to plot for
-
-
class
airsimdroneracinglab.
MultirotorClient
(ip='', port=41451, timeout_value=3600)¶ Bases:
airsimdroneracinglab.client.VehicleClient
,object
-
__annotations__
¶
-
takeoffAsync
(self, timeout_sec=20, vehicle_name='')¶ Takeoff vehicle to 3m above ground. Vehicle should not be moving when this API is used
-
landAsync
(self, timeout_sec=60, vehicle_name='')¶ Land the vehicle
-
goHomeAsync
(self, timeout_sec=3e+38, vehicle_name='')¶ Return vehicle to Home i.e. Launch location
-
moveByAngleZAsync
(self, pitch, roll, z, yaw, duration, vehicle_name='')¶
-
moveByAngleThrottleAsync
(self, pitch, roll, throttle, yaw_rate, duration, vehicle_name='')¶
-
moveByVelocityAsync
(self, vx, vy, vz, duration, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), vehicle_name='')¶ - Parameters
vx (float) – desired velocity in world (NED) X axis
vy (float) – desired velocity in world (NED) Y axis
vz (float) – desired velocity in world (NED) Z axis
duration (float) – Desired amount of time (seconds), to send this command for
drivetrain (DrivetrainType, optional) –
yaw_mode (YawMode, optional) –
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
future. call .join() to wait for method to finish. Example: client.METHOD().join()
- Return type
msgpackrpc.future.Future
-
moveByVelocityZAsync
(self, vx, vy, z, duration, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), vehicle_name='')¶ - Parameters
vx (float) – desired velocity in world (NED) X axis
vy (float) – desired velocity in world (NED) Y axis
z (float) – desired altitude in world (NED) Z axis
duration (float) – Desired amount of time (seconds), to send this command for
drivetrain (DrivetrainType, optional) – Description
yaw_mode (YawMode, optional) – Description
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
future. call .join() to wait for method to finish. Example: client.METHOD().join()
- Return type
msgpackrpc.future.Future
-
moveOnPathAsync
(self, path, velocity, timeout_sec=3e+38, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), lookahead=- 1, adaptive_lookahead=1, vehicle_name='')¶ - Parameters
path (TYPE) – Description
velocity (TYPE) – Description
timeout_sec (float, optional) – Description
drivetrain (TYPE, optional) – Description
yaw_mode (TYPE, optional) – Description
lookahead (TYPE, optional) – Description
adaptive_lookahead (int, optional) – Description
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
Description
- Return type
TYPE
-
moveToPositionAsync
(self, x, y, z, velocity, timeout_sec=3e+38, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), lookahead=- 1, adaptive_lookahead=1, vehicle_name='')¶ - Parameters
x (float) – Description
y (float) – Description
z (float) – Description
velocity (float) – Description
timeout_sec (float, optional) – Description
drivetrain (DrivetrainType, optional) – Description
yaw_mode (YawMode, optional) – Description
lookahead (float, optional) – Description
adaptive_lookahead (int, optional) – Description
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
Success
- Return type
-
moveToZAsync
(self, z, velocity, timeout_sec=3e+38, yaw_mode=YawMode(), lookahead=- 1, adaptive_lookahead=1, vehicle_name='')¶ - Parameters
z (float) – Description
velocity (float) – Description
timeout_sec (float, optional) – Description
yaw_mode (YawMode, optional) – Description
lookahead (float, optional) – Description
adaptive_lookahead (int, optional) – Description
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
Success
- Return type
-
moveToYawAsync
(self, yaw, timeout_sec=3e+38, margin=5, vehicle_name='')¶
-
moveByYawRateAsync
(self, yaw_rate, duration, vehicle_name='')¶
-
moveOnSplineAsync
(self, waypoints, vel_max=15.0, acc_max=7.5, add_position_constraint=True, add_velocity_constraint=True, add_acceleration_constraint=False, viz_traj=True, viz_traj_color_rgba=[1.0, 0.0, 0.0, 1.0], replan_from_lookahead=True, replan_lookahead_sec=1.0, vehicle_name='')¶ Fits a minimum jerk trajectory to the list of given 3D waypoints (specified by the waypoints parameter).
Uses ETHZ-ASL’s mav_trajectory_generation as the trajectory planning backend.
Tracks the references positions and velocities using a pure pursuit tracking controller.
The gains of the pure pursuit tracking controller are set by setTrajectoryTrackerGains.
Reference yaws are allocated along the tangent of the trajectory. Hence the drone will always look at the direction along which it is flying, behaving like a 3D car.
Note: setTrajectoryTrackerGains() must be called once before calling moveOnSpline()
- Parameters
List of 3D waypoints, defined in local NED frame of the vehicle to track.
vel_max (float, optional) –
Maximum magnitude of velocity along trajectory
acc_max (float, optional) –
Maximum magnitude of acceleration along trajectory
add_position_constraint (bool, optional) –
Add a start constraint at current position, so that the planned trajectory is smooth if the drone is already moving.
If replan_from_lookahead is False, and add_position_constraint is False, trajectory starts from the first element of the “waypoints” list param.
If replan_from_lookahead is False, and add_position_constraint is True, a position constraint is added at current odometry, and so the trajectory starts from current position.
If replan_from_lookahead is True, a position constraint trajectory is always added at look-ahead point regardless of the value of “add_position_constraint”, and so the trajectory starts from the lookahead point.
See below for the definition of “look-ahead point”.
add_velocity_constraint (bool, optional) –
Should only be set to True if add_position_constraint is True.
If replan_from_lookahead is True, a velocity constraint is added at current odometry.
If replan_from_lookahead is True, a velocity constraint is added at lookahead point.
add_acceleration_constraint (bool, optional) –
Should only be set to True if add_velocity_constraint (and therefore, add_position_constraint) is True.
If replan_from_lookahead is True, an acceleration constraint is added at current odometry.
If replan_from_lookahead is True, an acceleration constraint is added at lookahead point.
viz_traj (bool, optional) –
set this to True to visualize trajectory in unreal window.
Note that visualization would appear in the FPV image, so this should only be used for debugging.
viz_traj_color_rgba (list, optional) –
list of 4 floats from 0.0 to 1.0 that determines RGBA value of trajectory visualization.
Example: viz_traj_color_rgba=[1.0, 0.0, 0.0, 1.0] corresponds to Red
replan_from_lookahead (bool, optional) –
If this is set to true, the trajectory will start from the “look-ahead point” associated with the trajectory the drone is currently following.
The lookahead point is defined by the value of the replan_lookahead_sec paramater sent in the previous call to moveOnSpline.
replan_lookahead_sec (float, optional) –
Defines the lookahead point by sampling the current trajectory replan_lookahead_sec number of seconds ahead.
If replan_from_lookahead is passed as True in the next call to moveOnSpline, the next call’s trajectory will start from the lookahead point defined by the current call’s replan_lookahead_sec
vehicle_name (str, optional) –
Name of the multirotor to send this command to
- Returns
Success
- Return type
-
moveOnSplineVelConstraintsAsync
(self, waypoints, velocity_constraints, vel_max=15.0, acc_max=7.5, add_position_constraint=True, add_velocity_constraint=True, add_acceleration_constraint=False, viz_traj=True, viz_traj_color_rgba=[1.0, 0.0, 0.0, 0.4], replan_from_lookahead=True, replan_lookahead_sec=1.0, vehicle_name='')¶ Fits a minimum jerk trajectory to the list of given 3D waypoints (specified by the waypoints parameter).
Also adds corresponding 3D velocity vector constraints (specified by the velocity_constraints parameter).
Uses ETHZ-ASL’s mav_trajectory_generation as the trajectory planning backend.
Tracks the references positions and velocities using a pure pursuit tracking controller.
The gains of the pure pursuit tracking controller are set by setTrajectoryTrackerGains.
Reference yaws are allocated along the tangent of the trajectory. Hence the drone will always look at the direction along which it is flying, behaving like a 3D car.
Reference yaws are allocated along the tangent of the trajectory.
Note: setTrajectoryTrackerGains() must be called once before calling moveOnSpline()
- Parameters
List of 3D waypoints, defined in local NED frame of the vehicle to track.
velocity_constraints (list[Vector3r]) –
List of 3D velocity vector constraints, defined in local NED frame of the vehicle to track.
vel_max (float, optional) –
Maximum magnitude of velocity along trajectory
acc_max (float, optional) –
Maximum magnitude of acceleration along trajectory (-) –
add_position_constraint (bool, optional) –
Add a start constraint at current position, so that the planned trajectory is smooth if the drone is already moving.
If replan_from_lookahead is False, and add_position_constraint is False, trajectory starts from the first element of the “waypoints” list param.
If replan_from_lookahead is False, and add_position_constraint is True, a position constraint is added at current odometry, and so the trajectory starts from current position.
If replan_from_lookahead is True, a position constraint trajectory is always added at look-ahead point regardless of the value of “add_position_constraint”, and so the trajectory starts from the lookahead point.
See below for the definition of “look-ahead point”.
add_velocity_constraint (bool, optional) –
Should only be set to True if add_position_constraint is True.
If replan_from_lookahead is True, a velocity constraint is added at current odometry.
If replan_from_lookahead is True, a velocity constraint is added at lookahead point.
add_acceleration_constraint (bool, optional) –
Should only be set to True if add_velocity_constraint (and therefore, add_position_constraint) is True.
If replan_from_lookahead is True, an acceleration constraint is added at current odometry.
If replan_from_lookahead is True, an acceleration constraint is added at lookahead point.
viz_traj (bool, optional) –
set this to True to visualize trajectory in unreal window.
Note that visualization would appear in the FPV image, so this should only be used for debugging.
viz_traj_color_rgba (list, optional) –
list of 4 floats from 0.0 to 1.0 that determines RGBA value of trajectory visualization.
Example: viz_traj_color_rgba=[1.0, 0.0, 0.0, 1.0] corresponds to Red
replan_from_lookahead (bool, optional) –
If this is set to true, the trajectory will start from the “look-ahead point” associated with the trajectory the drone is currently following.
The lookahead point is defined by the value of the replan_lookahead_sec paramater sent in the previous call to moveOnSpline.
replan_lookahead_sec (float, optional) –
Defines the lookahead point by sampling the current trajectory replan_lookahead_sec number of seconds ahead.
If replan_from_lookahead is passed as True in the next call to moveOnSpline, the next call’s trajectory will start from the lookahead point defined by the current call’s replan_lookahead_sec
vehicle_name (str, optional) –
Name of the multirotor to send this command to
- Returns
Success
- Return type
-
clearTrajectory
(self, vehicle_name='')¶ Clears, and stops following the current trajectory (see moveOnSpline() or moveOnSplineVelConstraintsAsyn,c if any.
- Parameters
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
Description
- Return type
TYPE
-
setTrajectoryTrackerGains
(self, gains=TrajectoryTrackerGains(), vehicle_name='')¶ Sets trajectory tracker gains for moveOnSplineAsync, moveOnSplineVelConstraintsAsync.
Must be called once before either of the moveOnSpline*() APIs is called
- Parameters
gains (TrajectoryTrackerGains) – Pass TrajectoryTrackerGains() to set default values. Look at TrajectoryTrackerGains to set custom gains
vehicle_name (str, optional) – Name of the multirotor to send this command to
-
moveByManualAsync
(self, vx_max, vy_max, z_min, duration, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), vehicle_name='')¶ Read current RC state and use it to control the vehicles.
Parameters sets up the constraints on velocity and minimum altitude while flying. If RC state is detected to violate these constraints then that RC state would be ignored.
- Parameters
vx_max (float) – max velocity allowed in x direction
vy_max (float) – max velocity allowed in y direction
vz_max (float) – max velocity allowed in z direction
z_min (float) – min z allowed for vehicle position
duration (float) – after this duration vehicle would switch back to non-manual mode
drivetrain (DrivetrainType) – when ForwardOnly, vehicle rotates itself so that its front is always facing the direction of travel. If MaxDegreeOfFreedom then it doesn’t do that (crab-like movement)
yaw_mode (YawMode) – Specifies if vehicle should face at given angle (is_rate=False) or should be rotating around its axis at given rate (is_rate=True)
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
future. call .join() to wait for method to finish. Example: client.METHOD().join()
- Return type
msgpackrpc.future.Future
-
hoverAsync
(self, vehicle_name='')¶
-
moveByRC
(self, rcdata=RCData(), vehicle_name='')¶
-
moveByMotorPWMsAsync
(self, front_right_pwm, rear_left_pwm, front_left_pwm, rear_right_pwm, duration, vehicle_name='')¶ Directly control the motors using PWM values
- Parameters
front_right_pwm (float) – PWM value for the front right motor (between 0.0 to 1.0)
rear_left_pwm (float) – PWM value for the rear left motor (between 0.0 to 1.0)
front_left_pwm (float) – PWM value for the front left motor (between 0.0 to 1.0)
rear_right_pwm (float) – PWM value for the rear right motor (between 0.0 to 1.0)
duration (float) – Desired amount of time (seconds), to send this command for
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
future. call .join() to wait for method to finish. Example: client.METHOD().join()
- Return type
msgpackrpc.future.Future
-
moveByRollPitchYawZAsync
(self, roll, pitch, yaw, z, duration, vehicle_name='')¶ z is given in local NED frame of the vehicle.
Roll angle, pitch angle, and yaw angle set points are given in radians, in the body frame.
The body frame follows the Front Left Up (FLU) convention, and right-handedness.
- Frame Convention:
X axis is along the Front direction of the quadrotor.
Clockwise rotation about this axis defines a positive roll angle.Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.Y axis is along the Left direction of the quadrotor.
Clockwise rotation about this axis defines a positive pitch angle.Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.Z axis is along the Up direction.
Clockwise rotation about this axis defines a positive yaw angle.Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
- Parameters
roll (float) – Desired roll angle, in radians.
pitch (float) – Desired pitch angle, in radians.
yaw (float) – Desired yaw angle, in radians.
z (float) – Desired Z value (in local NED frame of the vehicle)
duration (float) – Desired amount of time (seconds), to send this command for
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
future. call .join() to wait for method to finish. Example: client.METHOD().join()
- Return type
msgpackrpc.future.Future
-
moveByRollPitchYawThrottleAsync
(self, roll, pitch, yaw, throttle, duration, vehicle_name='')¶ Desired throttle is between 0.0 to 1.0
Roll angle, pitch angle, and yaw angle are given in radians, in the body frame.
The body frame follows the Front Left Up (FLU) convention, and right-handedness.
- Frame Convention:
X axis is along the Front direction of the quadrotor.
Clockwise rotation about this axis defines a positive roll angle.Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.Y axis is along the Left direction of the quadrotor.
Clockwise rotation about this axis defines a positive pitch angle.Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.Z axis is along the Up direction.
Clockwise rotation about this axis defines a positive yaw angle.Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
- Parameters
roll (float) – Desired roll angle, in radians.
pitch (float) – Desired pitch angle, in radians.
yaw (float) – Desired yaw angle, in radians.
throttle (float) – Desired throttle (between 0.0 to 1.0)
duration (float) – Desired amount of time (seconds), to send this command for
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
future. call .join() to wait for method to finish. Example: client.METHOD().join()
- Return type
msgpackrpc.future.Future
-
moveByRollPitchYawrateThrottleAsync
(self, roll, pitch, yaw_rate, throttle, duration, vehicle_name='')¶ Desired throttle is between 0.0 to 1.0
Roll angle, pitch angle, and yaw rate set points are given in radians, in the body frame.
The body frame follows the Front Left Up (FLU) convention, and right-handedness.
- Frame Convention:
X axis is along the Front direction of the quadrotor.
Clockwise rotation about this axis defines a positive roll angle.Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.Y axis is along the Left direction of the quadrotor.
Clockwise rotation about this axis defines a positive pitch angle.Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.Z axis is along the Up direction.
Clockwise rotation about this axis defines a positive yaw angle.Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
- Parameters
roll (float) – Desired roll angle, in radians.
pitch (float) – Desired pitch angle, in radians.
yaw_rate (float) – Desired yaw rate, in radian per second.
throttle (float) – Desired throttle (between 0.0 to 1.0)
duration (float) – Desired amount of time (seconds), to send this command for
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
future. call .join() to wait for method to finish. Example: client.METHOD().join()
- Return type
msgpackrpc.future.Future
-
moveByRollPitchYawrateZAsync
(self, roll, pitch, yaw_rate, z, duration, vehicle_name='')¶ z is given in local NED frame of the vehicle.
Roll angle, pitch angle, and yaw rate set points are given in radians, in the body frame.
The body frame follows the Front Left Up (FLU) convention, and right-handedness.
- Frame Convention:
X axis is along the Front direction of the quadrotor.
Clockwise rotation about this axis defines a positive roll angle.Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.Y axis is along the Left direction of the quadrotor.
Clockwise rotation about this axis defines a positive pitch angle.Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.Z axis is along the Up direction.
Clockwise rotation about this axis defines a positive yaw angle.Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
- Parameters
roll (float) – Desired roll angle, in radians.
pitch (float) – Desired pitch angle, in radians.
yaw_rate (float) – Desired yaw rate, in radian per second.
z (float) – Desired Z value (in local NED frame of the vehicle)
duration (float) – Desired amount of time (seconds), to send this command for
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
future. call .join() to wait for method to finish. Example: client.METHOD().join()
- Return type
msgpackrpc.future.Future
-
moveByAngleRatesZAsync
(self, roll_rate, pitch_rate, yaw_rate, z, duration, vehicle_name='')¶ z is given in local NED frame of the vehicle.
Roll rate, pitch rate, and yaw rate set points are given in radians, in the body frame.
The body frame follows the Front Left Up (FLU) convention, and right-handedness.
- Frame Convention:
X axis is along the Front direction of the quadrotor.
Clockwise rotation about this axis defines a positive roll angle.Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.Y axis is along the Left direction of the quadrotor.
Clockwise rotation about this axis defines a positive pitch angle.Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.Z axis is along the Up direction.
Clockwise rotation about this axis defines a positive yaw angle.Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
- Parameters
roll_rate (float) – Desired roll rate, in radians / second
pitch_rate (float) – Desired pitch rate, in radians / second
yaw_rate (float) – Desired yaw rate, in radians / second
z (float) – Desired Z value (in local NED frame of the vehicle)
duration (float) – Desired amount of time (seconds), to send this command for
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
future. call .join() to wait for method to finish. Example: client.METHOD().join()
- Return type
msgpackrpc.future.Future
-
moveByAngleRatesThrottleAsync
(self, roll_rate, pitch_rate, yaw_rate, throttle, duration, vehicle_name='')¶ Desired throttle is between 0.0 to 1.0
Roll rate, pitch rate, and yaw rate set points are given in radians, in the body frame.
The body frame follows the Front Left Up (FLU) convention, and right-handedness.
- Frame Convention:
X axis is along the Front direction of the quadrotor.
Clockwise rotation about this axis defines a positive roll angle.Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.Y axis is along the Left direction of the quadrotor.
Clockwise rotation about this axis defines a positive pitch angle.Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.Z axis is along the Up direction.
Clockwise rotation about this axis defines a positive yaw angle.Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
- Parameters
roll_rate (float) – Desired roll rate, in radians / second
pitch_rate (float) – Desired pitch rate, in radians / second
yaw_rate (float) – Desired yaw rate, in radians / second
throttle (float) – Desired throttle (between 0.0 to 1.0)
duration (float) – Desired amount of time (seconds), to send this command for
vehicle_name (str, optional) – Name of the multirotor to send this command to
- Returns
future. call .join() to wait for method to finish. Example: client.METHOD().join()
- Return type
msgpackrpc.future.Future
-
setAngleRateControllerGains
(self, angle_rate_gains=AngleRateControllerGains(), vehicle_name='')¶ - Modifying these gains will have an affect on ALL move*() APIs.
This is because any velocity setpoint is converted to an angle level setpoint which is tracked with an angle level controllers. That angle level setpoint is itself tracked with and angle rate controller.
This function should only be called if the default angle rate control PID gains need to be modified.
- Parameters
angle_rate_gains (AngleRateControllerGains) –
Correspond to the roll, pitch, yaw axes, defined in the body frame.
Pass AngleRateControllerGains() to reset gains to default recommended values.
vehicle_name (str, optional) – Name of the multirotor to send this command to
-
setAngleLevelControllerGains
(self, angle_level_gains=AngleLevelControllerGains(), vehicle_name='')¶ Sets angle level controller gains (used by any API setting angle references - for ex: moveByRollPitchYawZAsync(), moveByRollPitchYawThrottleAsync(), etc)
- Modifying these gains will also affect the behaviour of moveByVelocityAsync() API.
This is because the AirSim flight controller will track velocity setpoints by converting them to angle set points.
This function should only be called if the default angle level control PID gains need to be modified.
Passing AngleLevelControllerGains() sets gains to default airsim values.
- Parameters
angle_level_gains (AngleLevelControllerGains) –
Correspond to the roll, pitch, yaw axes, defined in the body frame.
Pass AngleLevelControllerGains() to reset gains to default recommended values.
vehicle_name (str, optional) – Name of the multirotor to send this command to
-
setVelocityControllerGains
(self, velocity_gains=VelocityControllerGains(), vehicle_name='')¶ Sets velocity controller gains for moveByVelocityAsync().
This function should only be called if the default velocity control PID gains need to be modified.
Passing VelocityControllerGains() sets gains to default airsim values.
- Modifying the velocity controller gains will have an effect on the trajectory tracking behavior of moveOnSpline*() APIs,
as moveOnSpline*() APIs use a controller on the lines of the pure-pursuit approach, which is tracking the reference position and velocities of the reference trajectories, while minimizing cross-track errors in both position and velocity state, by sending velocity commands (via moveByVelocityAsync()) in the backend. If you change this, it might be worth playing with the gains of moveOnSpline() by using setTrajectoryTrackerGains()
- Parameters
velocity_gains (VelocityControllerGains) –
Correspond to the world X, Y, Z axes.
Pass VelocityControllerGains() to reset gains to default recommended values.
Modifying velocity controller gains will have an affect on the behaviour of moveOnSplineAsync() and moveOnSplineVelConstraintsAsync(), as they both use velocity control to track the trajectory.
vehicle_name (str, optional) – Name of the multirotor to send this command to
-
setPositionControllerGains
(self, position_gains=PositionControllerGains(), vehicle_name='')¶ Sets position controller gains for moveByPositionAsync. This function should only be called if the default position control PID gains need to be modified.
- Parameters
position_gains (PositionControllerGains) –
Correspond to the X, Y, Z axes.
Pass PositionControllerGains() to reset gains to default recommended values.
vehicle_name (str, optional) – Name of the multirotor to send this command to
-
getMultirotorState
(self, vehicle_name='')¶ - Parameters
vehicle_name (str, optional) – Vehicle to get the state of
- Returns
- Return type
-
simLogMultirotorState
(self, is_enabled, vehicle_name='')¶ Starts or stops high frequency logging of full multirotor state to a text file in Documents/AirSim. Values logged: Position, orientation, linear/angular velocity, linear/angular acceleration, body forces and torques, rotor speeds and rotor torques.
-
simStartRace
(self, tier=1)¶ Starts an instance of a race in your given level, if valid.
-
__internalRandomGoalZone
(self, gate_name)¶
-
simResetRace
(self)¶ Resets a current race: moves players to start positions, timer and penalties reset.
-
simDisableRaceLog
(self)¶ Disables race log
-
simIsRacerDisqualified
(self, vehicle_name)¶
-
-
airsimdroneracinglab.
string_to_uint8_array
(bstr)¶ - Parameters
bstr (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
string_to_float_array
(bstr)¶ - Parameters
bstr (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
list_to_2d_float_array
(flst, width, height)¶ - Parameters
flst (TYPE) – Description
width (TYPE) – Description
height (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
get_pfm_array
(response)¶ - Parameters
response (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
get_public_fields
(obj)¶ - Parameters
obj (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
to_dict
(obj)¶ - Parameters
obj (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
to_str
(obj)¶ - Parameters
obj (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
write_file
(filename, bstr)¶ - Parameters
filename (TYPE) – Description
bstr (TYPE) – Description
-
airsimdroneracinglab.
to_eularian_angles
(q)¶ - Parameters
q (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
to_quaternion
(pitch, roll, yaw)¶ - Parameters
pitch (TYPE) – Description
roll (TYPE) – Description
yaw (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
wait_key
(message='')¶ Wait for a key press on the console and return it.
- Parameters
message (str, optional) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
read_pfm
(file)¶ Read a pfm file
- Parameters
file (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
Exception – Description
-
airsimdroneracinglab.
write_pfm
(file, image, scale=1)¶ Write a pfm file
-
airsimdroneracinglab.
write_png
(filename, image)¶ image must be numpy array H X W X channels
- Parameters
filename (TYPE) – Description
image (TYPE) – Description
-
class
airsimdroneracinglab.
MsgpackMixin
¶ -
__repr__
(self)¶ - Returns
Description
- Return type
TYPE
-
to_msgpack
(self, *args, **kwargs)¶ - Parameters
*args – Description
**kwargs – Description
- Returns
Description
- Return type
TYPE
-
classmethod
from_msgpack
(cls, encoded)¶ - Parameters
encoded (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
ImageType
¶ -
-
Scene
= 0¶
-
DepthPlanner
= 1¶
-
DepthPerspective
= 2¶
-
DepthVis
= 3¶
-
DisparityNormalized
= 4¶
-
Segmentation
= 5¶
-
SurfaceNormals
= 6¶
-
Infrared
= 7¶
-
-
class
airsimdroneracinglab.
DrivetrainType
¶ Type of DrivetrainType
-
MaxDegreeOfFreedom
= 0¶
-
ForwardOnly
= 1¶
-
-
class
airsimdroneracinglab.
WeatherParameter
¶ -
Rain
= 0¶
-
Roadwetness
= 1¶
-
Snow
= 2¶
-
RoadSnow
= 3¶
-
MapleLeaf
= 4¶
-
RoadLeaf
= 5¶
-
Dust
= 6¶
-
Fog
= 7¶
-
Enabled
= 8¶
-
-
class
airsimdroneracinglab.
Vector3r
(x_val=0.0, y_val=0.0, z_val=0.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
x_val
= 0.0¶
-
y_val
= 0.0¶
-
z_val
= 0.0¶
-
static
nanVector3r
()¶ - Returns
Description
- Return type
TYPE
-
__add__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
__sub__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
__truediv__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__mul__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
dot
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
cross
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
get_length
(self)¶ - Returns
Description
- Return type
TYPE
-
distance_to
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
to_Quaternionr
(self)¶ - Returns
Description
- Return type
TYPE
-
to_numpy_array
(self)¶ - Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
Quaternionr
(x_val=0.0, y_val=0.0, z_val=0.0, w_val=1.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
w_val
= 0.0¶
-
x_val
= 0.0¶
-
y_val
= 0.0¶
-
z_val
= 0.0¶
-
static
nanQuaternionr
()¶ - Returns
Description
- Return type
TYPE
-
__add__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__mul__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__truediv__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
dot
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
cross
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
outer_product
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
rotate
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
ValueError – Description
-
conjugate
(self)¶ - Returns
Description
- Return type
TYPE
-
star
(self)¶ - Returns
Description
- Return type
TYPE
-
inverse
(self)¶ - Returns
Description
- Return type
TYPE
-
sgn
(self)¶ - Returns
Description
- Return type
TYPE
-
to_numpy_array
(self)¶ - Returns
Description
- Return type
np.array
-
-
class
airsimdroneracinglab.
Pose
(position_val=Vector3r(), orientation_val=Quaternionr())¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
orientation
¶ Description
- Type
-
position
¶
-
orientation
¶
-
static
nanPose
()¶ - Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
CollisionInfo
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
impact_point
¶ Description
- Type
TYPE
-
normal
¶ Description
- Type
TYPE
-
position
¶ Description
- Type
TYPE
-
has_collided
= False¶
-
normal
¶
-
impact_point
¶
-
position
¶
-
penetration_depth
= 0.0¶
-
time_stamp
= 0.0¶
-
object_name
=¶
-
object_id
¶
-
-
class
airsimdroneracinglab.
GeoPoint
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
latitude
= 0.0¶
-
longitude
= 0.0¶
-
altitude
= 0.0¶
-
-
class
airsimdroneracinglab.
YawMode
(is_rate=True, yaw_or_rate=0.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
Struct YawMode with two fields, yaw_or_rate and is_rate. If is_rate field is True then yaw_or_rate field is interpreted as angular velocity in degrees/sec, which means you want vehicle to rotate continuously around its axis at that angular velocity while moving.
If is_rate is False then yaw_or_rate is interpreted as angle in degrees, which means you want vehicle to rotate to specific angle (i.e. yaw) and keep that angle while moving.
When yaw_mode.is_rate == true, the drivetrain parameter shouldn’t be set to ForwardOnly because there’s a contradiction as we’re asking for the drone to keep front pointing ahead, but also rotate continuously. However if you have yaw_mode.is_rate = false in ForwardOnly mode then you can do some funky stuff. For example, you can have drone do circles and have yaw_or_rate set to 90 so camera is always pointed to center. In MaxDegreeofFreedom also you can get some funky stuff by setting yaw_mode.is_rate = true and say yaw_mode.yaw_or_rate = 20. This will cause drone to go in its path while rotating which may allow to do 360 scanning.
In most cases, you just don’t want yaw to change which you can do by setting yaw rate of 0. The shorthand for this is airsim.YawMode()
-
is_rate
¶ if True, yaw_or_rate is interpreted as angular velocity in degrees/sec, if False, yaw_or_rate is interpreted as angles in degrees,
- Type
-
yaw_or_rate
¶ value of desired yaw rate, or desired yaw angle. Interpretation depends upon is_rate
- Type
-
is_rate
= True¶
-
yaw_or_rate
= 0.0¶
-
-
class
airsimdroneracinglab.
RCData
(timestamp=0, pitch=0.0, roll=0.0, throttle=0.0, yaw=0.0, switch1=0, switch2=0, switch3=0, switch4=0, switch5=0, switch6=0, switch7=0, switch8=0, is_initialized=False, is_valid=False)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
pitch
¶ Description
- Type
TYPE
-
roll
¶ Description
- Type
TYPE
-
switch1
¶ Description
- Type
TYPE
-
switch2
¶ Description
- Type
TYPE
-
switch3
¶ Description
- Type
TYPE
-
switch4
¶ Description
- Type
TYPE
-
switch5
¶ Description
- Type
TYPE
-
switch6
¶ Description
- Type
TYPE
-
switch7
¶ Description
- Type
TYPE
-
switch8
¶ Description
- Type
TYPE
-
throttle
¶ Description
- Type
TYPE
-
yaw
¶ Description
- Type
TYPE
-
timestamp
= 0¶
-
is_initialized
= False¶
-
is_valid
= False¶
-
-
class
airsimdroneracinglab.
ImageRequest
(camera_name, image_type, pixels_as_float=False, compress=True)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
image_type
¶ Description
- Type
TYPE
-
camera_name
= 0¶
-
image_type
¶
-
pixels_as_float
= False¶
-
compress
= False¶
-
-
class
airsimdroneracinglab.
ImageResponse
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
camera_orientation
¶ Description
- Type
TYPE
-
camera_position
¶ Description
- Type
TYPE
-
image_data_uint8
¶ Description
- Type
TYPE
-
image_type
¶ Description
- Type
TYPE
-
time_stamp
¶ Description
- Type
TYPE
-
image_data_uint8
¶
-
image_data_float
= 0.0¶
-
camera_position
¶
-
camera_orientation
¶
-
time_stamp
¶
-
message
=¶
-
pixels_as_float
= 0.0¶
-
compress
= True¶
-
width
= 0¶
-
height
= 0¶
-
image_type
¶
-
-
class
airsimdroneracinglab.
CarControls
(throttle=0, steering=0, brake=0, handbrake=False, is_manual_gear=False, manual_gear=0, gear_immediate=True)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
throttle
= 0.0¶
-
steering
= 0.0¶
-
brake
= 0.0¶
-
handbrake
= False¶
-
is_manual_gear
= False¶
-
manual_gear
= 0¶
-
gear_immediate
= True¶
-
set_throttle
(self, throttle_val, forward)¶
-
-
class
airsimdroneracinglab.
KinematicsState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
orientation
¶ Description
- Type
-
position
¶
-
orientation
¶
-
linear_velocity
¶
-
angular_velocity
¶
-
linear_acceleration
¶
-
angular_acceleration
¶
-
-
class
airsimdroneracinglab.
EnvironmentState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
position
¶
-
geo_point
¶
-
gravity
¶
-
air_pressure
= 0.0¶
-
temperature
= 0.0¶
-
air_density
= 0.0¶
-
-
class
airsimdroneracinglab.
CarState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
speed
= 0.0¶
-
gear
= 0¶
-
rpm
= 0.0¶
-
maxrpm
= 0.0¶
-
handbrake
= False¶
-
collision
¶
-
kinematics_estimated
¶
-
timestamp
¶
-
-
class
airsimdroneracinglab.
MultirotorState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
collision
¶ Description
- Type
-
kinematics_estimated
¶ Description
- Type
-
landed_state
¶ Description
- Type
LandedState.Landed
-
timestamp
¶ Description
- Type
np.uint64
-
collision
¶
-
kinematics_estimated
¶
-
gps_location
¶
-
timestamp
¶
-
landed_state
¶
-
rc_data
¶
-
-
class
airsimdroneracinglab.
ProjectionMatrix
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
matrix
¶
Description
- Type
-
matrix
= []¶
-
-
class
airsimdroneracinglab.
CameraInfo
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
pose
¶ Description
- Type
TYPE
-
proj_mat
¶ Description
- Type
TYPE
-
pose
¶
-
fov
¶
-
proj_mat
¶
-
-
class
airsimdroneracinglab.
LidarData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
point_cloud
= 0.0¶
-
time_stamp
¶
-
pose
¶
-
-
class
airsimdroneracinglab.
ImuData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
orientation
¶
-
angular_velocity
¶
-
linear_acceleration
¶
-
-
class
airsimdroneracinglab.
BarometerData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
altitude
¶
-
pressure
¶
-
qnh
¶
-
-
class
airsimdroneracinglab.
MagnetometerData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
magnetic_field_body
¶
-
magnetic_field_covariance
= 0.0¶
-
-
class
airsimdroneracinglab.
GnssFixType
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
GNSS_FIX_NO_FIX
= 0¶
-
GNSS_FIX_TIME_ONLY
= 1¶
-
GNSS_FIX_2D_FIX
= 2¶
-
GNSS_FIX_3D_FIX
= 3¶
-
-
class
airsimdroneracinglab.
GnssReport
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
geo_point
¶
-
eph
= 0.0¶
-
epv
= 0.0¶
-
velocity
¶
-
fix_type
¶
-
time_utc
¶
-
-
class
airsimdroneracinglab.
GpsData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
gnss
¶
-
is_valid
= False¶
-
-
class
airsimdroneracinglab.
DistanceSensorData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
distance
¶
-
min_distance
¶
-
max_distance
¶
-
relative_pose
¶
-
-
class
airsimdroneracinglab.
PIDGains
(kp, ki, kd)¶ Struct to store values of PID gains. Used to transmit controller gain values while instantiating AngleLevel/AngleRate/Velocity/PositionControllerGains objects.
-
to_list
(self)¶
-
-
class
airsimdroneracinglab.
AngleRateControllerGains
(roll_gains=PIDGains(0.25, 0, 0), pitch_gains=PIDGains(0.25, 0, 0), yaw_gains=PIDGains(0.25, 0, 0))¶ Struct to contain controller gains used by angle level PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
AngleLevelControllerGains
(roll_gains=PIDGains(2.5, 0, 0), pitch_gains=PIDGains(2.5, 0, 0), yaw_gains=PIDGains(2.5, 0, 0))¶ Struct to contain controller gains used by angle rate PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
VelocityControllerGains
(x_gains=PIDGains(0.2, 0, 0), y_gains=PIDGains(0.2, 0, 0), z_gains=PIDGains(2.0, 2.0, 0))¶ Struct to contain controller gains used by velocity PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
PositionControllerGains
(x_gains=PIDGains(0.25, 0, 0), y_gains=PIDGains(0.25, 0, 0), z_gains=PIDGains(0.25, 0, 0))¶ Struct to contain controller gains used by position PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
TrajectoryTrackerGains
(kp_cross_track=7.5, kd_cross_track=0.0, kp_vel_cross_track=5.0, kd_vel_cross_track=0.0, kp_along_track=0.4, kd_along_track=0.0, kp_vel_along_track=0.04, kd_vel_along_track=0.0, kp_z_track=2.0, kd_z_track=0.0, kp_vel_z=0.4, kd_vel_z=0.0, kp_yaw=3.0, kd_yaw=0.1)¶ Struct to contain trajectory tracker gains used by the pure pursuit controller for moveBySpline and moveBySplineVelConstraints
-
kp_cross_track
¶ P gain for position error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kd_cross_track
¶ D gain for position error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kp_vel_cross_track
¶ P gain for velocity error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kd_vel_cross_track
¶ D gain for velocity error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
-
class
airsimdroneracinglab.
MeshPositionVertexBuffersResponse
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
position
¶
-
orientation
¶
-
vertices
= 0.0¶
-
indices
= 0.0¶
-
name
=¶
-
-
airsimdroneracinglab.
string_to_uint8_array
(bstr)¶ - Parameters
bstr (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
string_to_float_array
(bstr)¶ - Parameters
bstr (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
list_to_2d_float_array
(flst, width, height)¶ - Parameters
flst (TYPE) – Description
width (TYPE) – Description
height (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
get_pfm_array
(response)¶ - Parameters
response (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
get_public_fields
(obj)¶ - Parameters
obj (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
to_dict
(obj)¶ - Parameters
obj (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
to_str
(obj)¶ - Parameters
obj (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
write_file
(filename, bstr)¶ - Parameters
filename (TYPE) – Description
bstr (TYPE) – Description
-
airsimdroneracinglab.
to_eularian_angles
(q)¶ - Parameters
q (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
to_quaternion
(pitch, roll, yaw)¶ - Parameters
pitch (TYPE) – Description
roll (TYPE) – Description
yaw (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
wait_key
(message='')¶ Wait for a key press on the console and return it.
- Parameters
message (str, optional) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
read_pfm
(file)¶ Read a pfm file
- Parameters
file (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
Exception – Description
-
airsimdroneracinglab.
write_pfm
(file, image, scale=1)¶ Write a pfm file
-
airsimdroneracinglab.
write_png
(filename, image)¶ image must be numpy array H X W X channels
- Parameters
filename (TYPE) – Description
image (TYPE) – Description
-
class
airsimdroneracinglab.
MsgpackMixin
¶ -
__repr__
(self)¶ - Returns
Description
- Return type
TYPE
-
to_msgpack
(self, *args, **kwargs)¶ - Parameters
*args – Description
**kwargs – Description
- Returns
Description
- Return type
TYPE
-
classmethod
from_msgpack
(cls, encoded)¶ - Parameters
encoded (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
ImageType
¶ -
-
Scene
= 0¶
-
DepthPlanner
= 1¶
-
DepthPerspective
= 2¶
-
DepthVis
= 3¶
-
DisparityNormalized
= 4¶
-
Segmentation
= 5¶
-
SurfaceNormals
= 6¶
-
Infrared
= 7¶
-
-
class
airsimdroneracinglab.
DrivetrainType
¶ Type of DrivetrainType
-
MaxDegreeOfFreedom
= 0¶
-
ForwardOnly
= 1¶
-
-
class
airsimdroneracinglab.
WeatherParameter
¶ -
Rain
= 0¶
-
Roadwetness
= 1¶
-
Snow
= 2¶
-
RoadSnow
= 3¶
-
MapleLeaf
= 4¶
-
RoadLeaf
= 5¶
-
Dust
= 6¶
-
Fog
= 7¶
-
Enabled
= 8¶
-
-
class
airsimdroneracinglab.
Vector3r
(x_val=0.0, y_val=0.0, z_val=0.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
x_val
= 0.0¶
-
y_val
= 0.0¶
-
z_val
= 0.0¶
-
static
nanVector3r
()¶ - Returns
Description
- Return type
TYPE
-
__add__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
__sub__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
__truediv__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__mul__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
dot
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
cross
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
get_length
(self)¶ - Returns
Description
- Return type
TYPE
-
distance_to
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
to_Quaternionr
(self)¶ - Returns
Description
- Return type
TYPE
-
to_numpy_array
(self)¶ - Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
Quaternionr
(x_val=0.0, y_val=0.0, z_val=0.0, w_val=1.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
w_val
= 0.0¶
-
x_val
= 0.0¶
-
y_val
= 0.0¶
-
z_val
= 0.0¶
-
static
nanQuaternionr
()¶ - Returns
Description
- Return type
TYPE
-
__add__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__mul__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__truediv__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
dot
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
cross
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
outer_product
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
rotate
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
ValueError – Description
-
conjugate
(self)¶ - Returns
Description
- Return type
TYPE
-
star
(self)¶ - Returns
Description
- Return type
TYPE
-
inverse
(self)¶ - Returns
Description
- Return type
TYPE
-
sgn
(self)¶ - Returns
Description
- Return type
TYPE
-
to_numpy_array
(self)¶ - Returns
Description
- Return type
np.array
-
-
class
airsimdroneracinglab.
Pose
(position_val=Vector3r(), orientation_val=Quaternionr())¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
orientation
¶ Description
- Type
-
position
¶
-
orientation
¶
-
static
nanPose
()¶ - Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
CollisionInfo
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
impact_point
¶ Description
- Type
TYPE
-
normal
¶ Description
- Type
TYPE
-
position
¶ Description
- Type
TYPE
-
has_collided
= False¶
-
normal
¶
-
impact_point
¶
-
position
¶
-
penetration_depth
= 0.0¶
-
time_stamp
= 0.0¶
-
object_name
=¶
-
object_id
¶
-
-
class
airsimdroneracinglab.
GeoPoint
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
latitude
= 0.0¶
-
longitude
= 0.0¶
-
altitude
= 0.0¶
-
-
class
airsimdroneracinglab.
YawMode
(is_rate=True, yaw_or_rate=0.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
Struct YawMode with two fields, yaw_or_rate and is_rate. If is_rate field is True then yaw_or_rate field is interpreted as angular velocity in degrees/sec, which means you want vehicle to rotate continuously around its axis at that angular velocity while moving.
If is_rate is False then yaw_or_rate is interpreted as angle in degrees, which means you want vehicle to rotate to specific angle (i.e. yaw) and keep that angle while moving.
When yaw_mode.is_rate == true, the drivetrain parameter shouldn’t be set to ForwardOnly because there’s a contradiction as we’re asking for the drone to keep front pointing ahead, but also rotate continuously. However if you have yaw_mode.is_rate = false in ForwardOnly mode then you can do some funky stuff. For example, you can have drone do circles and have yaw_or_rate set to 90 so camera is always pointed to center. In MaxDegreeofFreedom also you can get some funky stuff by setting yaw_mode.is_rate = true and say yaw_mode.yaw_or_rate = 20. This will cause drone to go in its path while rotating which may allow to do 360 scanning.
In most cases, you just don’t want yaw to change which you can do by setting yaw rate of 0. The shorthand for this is airsim.YawMode()
-
is_rate
¶ if True, yaw_or_rate is interpreted as angular velocity in degrees/sec, if False, yaw_or_rate is interpreted as angles in degrees,
- Type
-
yaw_or_rate
¶ value of desired yaw rate, or desired yaw angle. Interpretation depends upon is_rate
- Type
-
is_rate
= True¶
-
yaw_or_rate
= 0.0¶
-
-
class
airsimdroneracinglab.
RCData
(timestamp=0, pitch=0.0, roll=0.0, throttle=0.0, yaw=0.0, switch1=0, switch2=0, switch3=0, switch4=0, switch5=0, switch6=0, switch7=0, switch8=0, is_initialized=False, is_valid=False)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
pitch
¶ Description
- Type
TYPE
-
roll
¶ Description
- Type
TYPE
-
switch1
¶ Description
- Type
TYPE
-
switch2
¶ Description
- Type
TYPE
-
switch3
¶ Description
- Type
TYPE
-
switch4
¶ Description
- Type
TYPE
-
switch5
¶ Description
- Type
TYPE
-
switch6
¶ Description
- Type
TYPE
-
switch7
¶ Description
- Type
TYPE
-
switch8
¶ Description
- Type
TYPE
-
throttle
¶ Description
- Type
TYPE
-
yaw
¶ Description
- Type
TYPE
-
timestamp
= 0¶
-
is_initialized
= False¶
-
is_valid
= False¶
-
-
class
airsimdroneracinglab.
ImageRequest
(camera_name, image_type, pixels_as_float=False, compress=True)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
image_type
¶ Description
- Type
TYPE
-
camera_name
= 0¶
-
image_type
¶
-
pixels_as_float
= False¶
-
compress
= False¶
-
-
class
airsimdroneracinglab.
ImageResponse
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
camera_orientation
¶ Description
- Type
TYPE
-
camera_position
¶ Description
- Type
TYPE
-
image_data_uint8
¶ Description
- Type
TYPE
-
image_type
¶ Description
- Type
TYPE
-
time_stamp
¶ Description
- Type
TYPE
-
image_data_uint8
¶
-
image_data_float
= 0.0¶
-
camera_position
¶
-
camera_orientation
¶
-
time_stamp
¶
-
message
=¶
-
pixels_as_float
= 0.0¶
-
compress
= True¶
-
width
= 0¶
-
height
= 0¶
-
image_type
¶
-
-
class
airsimdroneracinglab.
CarControls
(throttle=0, steering=0, brake=0, handbrake=False, is_manual_gear=False, manual_gear=0, gear_immediate=True)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
throttle
= 0.0¶
-
steering
= 0.0¶
-
brake
= 0.0¶
-
handbrake
= False¶
-
is_manual_gear
= False¶
-
manual_gear
= 0¶
-
gear_immediate
= True¶
-
set_throttle
(self, throttle_val, forward)¶
-
-
class
airsimdroneracinglab.
KinematicsState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
orientation
¶ Description
- Type
-
position
¶
-
orientation
¶
-
linear_velocity
¶
-
angular_velocity
¶
-
linear_acceleration
¶
-
angular_acceleration
¶
-
-
class
airsimdroneracinglab.
EnvironmentState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
position
¶
-
geo_point
¶
-
gravity
¶
-
air_pressure
= 0.0¶
-
temperature
= 0.0¶
-
air_density
= 0.0¶
-
-
class
airsimdroneracinglab.
CarState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
speed
= 0.0¶
-
gear
= 0¶
-
rpm
= 0.0¶
-
maxrpm
= 0.0¶
-
handbrake
= False¶
-
collision
¶
-
kinematics_estimated
¶
-
timestamp
¶
-
-
class
airsimdroneracinglab.
MultirotorState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
collision
¶ Description
- Type
-
kinematics_estimated
¶ Description
- Type
-
landed_state
¶ Description
- Type
LandedState.Landed
-
timestamp
¶ Description
- Type
np.uint64
-
collision
¶
-
kinematics_estimated
¶
-
gps_location
¶
-
timestamp
¶
-
landed_state
¶
-
rc_data
¶
-
-
class
airsimdroneracinglab.
ProjectionMatrix
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
matrix
¶
Description
- Type
-
matrix
= []¶
-
-
class
airsimdroneracinglab.
CameraInfo
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
pose
¶ Description
- Type
TYPE
-
proj_mat
¶ Description
- Type
TYPE
-
pose
¶
-
fov
¶
-
proj_mat
¶
-
-
class
airsimdroneracinglab.
LidarData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
point_cloud
= 0.0¶
-
time_stamp
¶
-
pose
¶
-
-
class
airsimdroneracinglab.
ImuData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
orientation
¶
-
angular_velocity
¶
-
linear_acceleration
¶
-
-
class
airsimdroneracinglab.
BarometerData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
altitude
¶
-
pressure
¶
-
qnh
¶
-
-
class
airsimdroneracinglab.
MagnetometerData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
magnetic_field_body
¶
-
magnetic_field_covariance
= 0.0¶
-
-
class
airsimdroneracinglab.
GnssFixType
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
GNSS_FIX_NO_FIX
= 0¶
-
GNSS_FIX_TIME_ONLY
= 1¶
-
GNSS_FIX_2D_FIX
= 2¶
-
GNSS_FIX_3D_FIX
= 3¶
-
-
class
airsimdroneracinglab.
GnssReport
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
geo_point
¶
-
eph
= 0.0¶
-
epv
= 0.0¶
-
velocity
¶
-
fix_type
¶
-
time_utc
¶
-
-
class
airsimdroneracinglab.
GpsData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
gnss
¶
-
is_valid
= False¶
-
-
class
airsimdroneracinglab.
DistanceSensorData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
distance
¶
-
min_distance
¶
-
max_distance
¶
-
relative_pose
¶
-
-
class
airsimdroneracinglab.
PIDGains
(kp, ki, kd)¶ Struct to store values of PID gains. Used to transmit controller gain values while instantiating AngleLevel/AngleRate/Velocity/PositionControllerGains objects.
-
to_list
(self)¶
-
-
class
airsimdroneracinglab.
AngleRateControllerGains
(roll_gains=PIDGains(0.25, 0, 0), pitch_gains=PIDGains(0.25, 0, 0), yaw_gains=PIDGains(0.25, 0, 0))¶ Struct to contain controller gains used by angle level PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
AngleLevelControllerGains
(roll_gains=PIDGains(2.5, 0, 0), pitch_gains=PIDGains(2.5, 0, 0), yaw_gains=PIDGains(2.5, 0, 0))¶ Struct to contain controller gains used by angle rate PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
VelocityControllerGains
(x_gains=PIDGains(0.2, 0, 0), y_gains=PIDGains(0.2, 0, 0), z_gains=PIDGains(2.0, 2.0, 0))¶ Struct to contain controller gains used by velocity PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
PositionControllerGains
(x_gains=PIDGains(0.25, 0, 0), y_gains=PIDGains(0.25, 0, 0), z_gains=PIDGains(0.25, 0, 0))¶ Struct to contain controller gains used by position PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
TrajectoryTrackerGains
(kp_cross_track=7.5, kd_cross_track=0.0, kp_vel_cross_track=5.0, kd_vel_cross_track=0.0, kp_along_track=0.4, kd_along_track=0.0, kp_vel_along_track=0.04, kd_vel_along_track=0.0, kp_z_track=2.0, kd_z_track=0.0, kp_vel_z=0.4, kd_vel_z=0.0, kp_yaw=3.0, kd_yaw=0.1)¶ Struct to contain trajectory tracker gains used by the pure pursuit controller for moveBySpline and moveBySplineVelConstraints
-
kp_cross_track
¶ P gain for position error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kd_cross_track
¶ D gain for position error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kp_vel_cross_track
¶ P gain for velocity error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kd_vel_cross_track
¶ D gain for velocity error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
-
class
airsimdroneracinglab.
MeshPositionVertexBuffersResponse
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
position
¶
-
orientation
¶
-
vertices
= 0.0¶
-
indices
= 0.0¶
-
name
=¶
-
-
class
airsimdroneracinglab.
MsgpackMixin
¶ -
__repr__
(self)¶ - Returns
Description
- Return type
TYPE
-
to_msgpack
(self, *args, **kwargs)¶ - Parameters
*args – Description
**kwargs – Description
- Returns
Description
- Return type
TYPE
-
classmethod
from_msgpack
(cls, encoded)¶ - Parameters
encoded (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
ImageType
¶ -
-
Scene
= 0¶
-
DepthPlanner
= 1¶
-
DepthPerspective
= 2¶
-
DepthVis
= 3¶
-
DisparityNormalized
= 4¶
-
Segmentation
= 5¶
-
SurfaceNormals
= 6¶
-
Infrared
= 7¶
-
-
class
airsimdroneracinglab.
DrivetrainType
¶ Type of DrivetrainType
-
MaxDegreeOfFreedom
= 0¶
-
ForwardOnly
= 1¶
-
-
class
airsimdroneracinglab.
WeatherParameter
¶ -
Rain
= 0¶
-
Roadwetness
= 1¶
-
Snow
= 2¶
-
RoadSnow
= 3¶
-
MapleLeaf
= 4¶
-
RoadLeaf
= 5¶
-
Dust
= 6¶
-
Fog
= 7¶
-
Enabled
= 8¶
-
-
class
airsimdroneracinglab.
Vector3r
(x_val=0.0, y_val=0.0, z_val=0.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
x_val
= 0.0¶
-
y_val
= 0.0¶
-
z_val
= 0.0¶
-
static
nanVector3r
()¶ - Returns
Description
- Return type
TYPE
-
__add__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
__sub__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
__truediv__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__mul__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
dot
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
cross
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
get_length
(self)¶ - Returns
Description
- Return type
TYPE
-
distance_to
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
to_Quaternionr
(self)¶ - Returns
Description
- Return type
TYPE
-
to_numpy_array
(self)¶ - Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
Quaternionr
(x_val=0.0, y_val=0.0, z_val=0.0, w_val=1.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
w_val
= 0.0¶
-
x_val
= 0.0¶
-
y_val
= 0.0¶
-
z_val
= 0.0¶
-
static
nanQuaternionr
()¶ - Returns
Description
- Return type
TYPE
-
__add__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__mul__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__truediv__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
dot
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
cross
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
outer_product
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
rotate
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
ValueError – Description
-
conjugate
(self)¶ - Returns
Description
- Return type
TYPE
-
star
(self)¶ - Returns
Description
- Return type
TYPE
-
inverse
(self)¶ - Returns
Description
- Return type
TYPE
-
sgn
(self)¶ - Returns
Description
- Return type
TYPE
-
to_numpy_array
(self)¶ - Returns
Description
- Return type
np.array
-
-
class
airsimdroneracinglab.
Pose
(position_val=Vector3r(), orientation_val=Quaternionr())¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
orientation
¶ Description
- Type
-
position
¶
-
orientation
¶
-
static
nanPose
()¶ - Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
CollisionInfo
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
impact_point
¶ Description
- Type
TYPE
-
normal
¶ Description
- Type
TYPE
-
position
¶ Description
- Type
TYPE
-
has_collided
= False¶
-
normal
¶
-
impact_point
¶
-
position
¶
-
penetration_depth
= 0.0¶
-
time_stamp
= 0.0¶
-
object_name
=¶
-
object_id
¶
-
-
class
airsimdroneracinglab.
GeoPoint
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
latitude
= 0.0¶
-
longitude
= 0.0¶
-
altitude
= 0.0¶
-
-
class
airsimdroneracinglab.
YawMode
(is_rate=True, yaw_or_rate=0.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
Struct YawMode with two fields, yaw_or_rate and is_rate. If is_rate field is True then yaw_or_rate field is interpreted as angular velocity in degrees/sec, which means you want vehicle to rotate continuously around its axis at that angular velocity while moving.
If is_rate is False then yaw_or_rate is interpreted as angle in degrees, which means you want vehicle to rotate to specific angle (i.e. yaw) and keep that angle while moving.
When yaw_mode.is_rate == true, the drivetrain parameter shouldn’t be set to ForwardOnly because there’s a contradiction as we’re asking for the drone to keep front pointing ahead, but also rotate continuously. However if you have yaw_mode.is_rate = false in ForwardOnly mode then you can do some funky stuff. For example, you can have drone do circles and have yaw_or_rate set to 90 so camera is always pointed to center. In MaxDegreeofFreedom also you can get some funky stuff by setting yaw_mode.is_rate = true and say yaw_mode.yaw_or_rate = 20. This will cause drone to go in its path while rotating which may allow to do 360 scanning.
In most cases, you just don’t want yaw to change which you can do by setting yaw rate of 0. The shorthand for this is airsim.YawMode()
-
is_rate
¶ if True, yaw_or_rate is interpreted as angular velocity in degrees/sec, if False, yaw_or_rate is interpreted as angles in degrees,
- Type
-
yaw_or_rate
¶ value of desired yaw rate, or desired yaw angle. Interpretation depends upon is_rate
- Type
-
is_rate
= True¶
-
yaw_or_rate
= 0.0¶
-
-
class
airsimdroneracinglab.
RCData
(timestamp=0, pitch=0.0, roll=0.0, throttle=0.0, yaw=0.0, switch1=0, switch2=0, switch3=0, switch4=0, switch5=0, switch6=0, switch7=0, switch8=0, is_initialized=False, is_valid=False)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
pitch
¶ Description
- Type
TYPE
-
roll
¶ Description
- Type
TYPE
-
switch1
¶ Description
- Type
TYPE
-
switch2
¶ Description
- Type
TYPE
-
switch3
¶ Description
- Type
TYPE
-
switch4
¶ Description
- Type
TYPE
-
switch5
¶ Description
- Type
TYPE
-
switch6
¶ Description
- Type
TYPE
-
switch7
¶ Description
- Type
TYPE
-
switch8
¶ Description
- Type
TYPE
-
throttle
¶ Description
- Type
TYPE
-
yaw
¶ Description
- Type
TYPE
-
timestamp
= 0¶
-
is_initialized
= False¶
-
is_valid
= False¶
-
-
class
airsimdroneracinglab.
ImageRequest
(camera_name, image_type, pixels_as_float=False, compress=True)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
image_type
¶ Description
- Type
TYPE
-
camera_name
= 0¶
-
image_type
¶
-
pixels_as_float
= False¶
-
compress
= False¶
-
-
class
airsimdroneracinglab.
ImageResponse
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
camera_orientation
¶ Description
- Type
TYPE
-
camera_position
¶ Description
- Type
TYPE
-
image_data_uint8
¶ Description
- Type
TYPE
-
image_type
¶ Description
- Type
TYPE
-
time_stamp
¶ Description
- Type
TYPE
-
image_data_uint8
¶
-
image_data_float
= 0.0¶
-
camera_position
¶
-
camera_orientation
¶
-
time_stamp
¶
-
message
=¶
-
pixels_as_float
= 0.0¶
-
compress
= True¶
-
width
= 0¶
-
height
= 0¶
-
image_type
¶
-
-
class
airsimdroneracinglab.
CarControls
(throttle=0, steering=0, brake=0, handbrake=False, is_manual_gear=False, manual_gear=0, gear_immediate=True)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
throttle
= 0.0¶
-
steering
= 0.0¶
-
brake
= 0.0¶
-
handbrake
= False¶
-
is_manual_gear
= False¶
-
manual_gear
= 0¶
-
gear_immediate
= True¶
-
set_throttle
(self, throttle_val, forward)¶
-
-
class
airsimdroneracinglab.
KinematicsState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
orientation
¶ Description
- Type
-
position
¶
-
orientation
¶
-
linear_velocity
¶
-
angular_velocity
¶
-
linear_acceleration
¶
-
angular_acceleration
¶
-
-
class
airsimdroneracinglab.
EnvironmentState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
position
¶
-
geo_point
¶
-
gravity
¶
-
air_pressure
= 0.0¶
-
temperature
= 0.0¶
-
air_density
= 0.0¶
-
-
class
airsimdroneracinglab.
CarState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
speed
= 0.0¶
-
gear
= 0¶
-
rpm
= 0.0¶
-
maxrpm
= 0.0¶
-
handbrake
= False¶
-
collision
¶
-
kinematics_estimated
¶
-
timestamp
¶
-
-
class
airsimdroneracinglab.
MultirotorState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
collision
¶ Description
- Type
-
kinematics_estimated
¶ Description
- Type
-
landed_state
¶ Description
- Type
LandedState.Landed
-
timestamp
¶ Description
- Type
np.uint64
-
collision
¶
-
kinematics_estimated
¶
-
gps_location
¶
-
timestamp
¶
-
landed_state
¶
-
rc_data
¶
-
-
class
airsimdroneracinglab.
ProjectionMatrix
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
matrix
¶
Description
- Type
-
matrix
= []¶
-
-
class
airsimdroneracinglab.
CameraInfo
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
pose
¶ Description
- Type
TYPE
-
proj_mat
¶ Description
- Type
TYPE
-
pose
¶
-
fov
¶
-
proj_mat
¶
-
-
class
airsimdroneracinglab.
LidarData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
point_cloud
= 0.0¶
-
time_stamp
¶
-
pose
¶
-
-
class
airsimdroneracinglab.
ImuData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
orientation
¶
-
angular_velocity
¶
-
linear_acceleration
¶
-
-
class
airsimdroneracinglab.
BarometerData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
altitude
¶
-
pressure
¶
-
qnh
¶
-
-
class
airsimdroneracinglab.
MagnetometerData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
magnetic_field_body
¶
-
magnetic_field_covariance
= 0.0¶
-
-
class
airsimdroneracinglab.
GnssFixType
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
GNSS_FIX_NO_FIX
= 0¶
-
GNSS_FIX_TIME_ONLY
= 1¶
-
GNSS_FIX_2D_FIX
= 2¶
-
GNSS_FIX_3D_FIX
= 3¶
-
-
class
airsimdroneracinglab.
GnssReport
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
geo_point
¶
-
eph
= 0.0¶
-
epv
= 0.0¶
-
velocity
¶
-
fix_type
¶
-
time_utc
¶
-
-
class
airsimdroneracinglab.
GpsData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
gnss
¶
-
is_valid
= False¶
-
-
class
airsimdroneracinglab.
DistanceSensorData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
distance
¶
-
min_distance
¶
-
max_distance
¶
-
relative_pose
¶
-
-
class
airsimdroneracinglab.
PIDGains
(kp, ki, kd)¶ Struct to store values of PID gains. Used to transmit controller gain values while instantiating AngleLevel/AngleRate/Velocity/PositionControllerGains objects.
-
to_list
(self)¶
-
-
class
airsimdroneracinglab.
AngleRateControllerGains
(roll_gains=PIDGains(0.25, 0, 0), pitch_gains=PIDGains(0.25, 0, 0), yaw_gains=PIDGains(0.25, 0, 0))¶ Struct to contain controller gains used by angle level PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
AngleLevelControllerGains
(roll_gains=PIDGains(2.5, 0, 0), pitch_gains=PIDGains(2.5, 0, 0), yaw_gains=PIDGains(2.5, 0, 0))¶ Struct to contain controller gains used by angle rate PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
VelocityControllerGains
(x_gains=PIDGains(0.2, 0, 0), y_gains=PIDGains(0.2, 0, 0), z_gains=PIDGains(2.0, 2.0, 0))¶ Struct to contain controller gains used by velocity PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
PositionControllerGains
(x_gains=PIDGains(0.25, 0, 0), y_gains=PIDGains(0.25, 0, 0), z_gains=PIDGains(0.25, 0, 0))¶ Struct to contain controller gains used by position PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
TrajectoryTrackerGains
(kp_cross_track=7.5, kd_cross_track=0.0, kp_vel_cross_track=5.0, kd_vel_cross_track=0.0, kp_along_track=0.4, kd_along_track=0.0, kp_vel_along_track=0.04, kd_vel_along_track=0.0, kp_z_track=2.0, kd_z_track=0.0, kp_vel_z=0.4, kd_vel_z=0.0, kp_yaw=3.0, kd_yaw=0.1)¶ Struct to contain trajectory tracker gains used by the pure pursuit controller for moveBySpline and moveBySplineVelConstraints
-
kp_cross_track
¶ P gain for position error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kd_cross_track
¶ D gain for position error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kp_vel_cross_track
¶ P gain for velocity error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kd_vel_cross_track
¶ D gain for velocity error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
-
class
airsimdroneracinglab.
MeshPositionVertexBuffersResponse
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
position
¶
-
orientation
¶
-
vertices
= 0.0¶
-
indices
= 0.0¶
-
name
=¶
-
-
class
airsimdroneracinglab.
BaselineRacer
(client, viz_traj=True, viz_traj_color_rgba=[1.0, 0.0, 0.0, 1.0])¶ Bases:
object
Class for drone_2, which flies through gates using moveOnSpline when simStartRace is called.
-
initialize_drone
(self)¶
-
takeoffAsync
(self)¶
-
takeoff_with_moveOnSpline
(self, takeoff_height=0.1)¶
-
get_ground_truth_gate_poses
(self)¶
-
fly_through_all_gates_at_once_with_moveOnSpline
(self)¶
-
takeoff_and_fly_through_all_gates_at_once_with_moveOnSpline
(self)¶
-
run_in_thread
(self)¶
-
-
airsimdroneracinglab.
string_to_uint8_array
(bstr)¶ - Parameters
bstr (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
string_to_float_array
(bstr)¶ - Parameters
bstr (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
list_to_2d_float_array
(flst, width, height)¶ - Parameters
flst (TYPE) – Description
width (TYPE) – Description
height (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
get_pfm_array
(response)¶ - Parameters
response (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
get_public_fields
(obj)¶ - Parameters
obj (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
to_dict
(obj)¶ - Parameters
obj (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
to_str
(obj)¶ - Parameters
obj (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
write_file
(filename, bstr)¶ - Parameters
filename (TYPE) – Description
bstr (TYPE) – Description
-
airsimdroneracinglab.
to_eularian_angles
(q)¶ - Parameters
q (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
to_quaternion
(pitch, roll, yaw)¶ - Parameters
pitch (TYPE) – Description
roll (TYPE) – Description
yaw (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
wait_key
(message='')¶ Wait for a key press on the console and return it.
- Parameters
message (str, optional) – Description
- Returns
Description
- Return type
TYPE
-
airsimdroneracinglab.
read_pfm
(file)¶ Read a pfm file
- Parameters
file (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
Exception – Description
-
airsimdroneracinglab.
write_pfm
(file, image, scale=1)¶ Write a pfm file
-
airsimdroneracinglab.
write_png
(filename, image)¶ image must be numpy array H X W X channels
- Parameters
filename (TYPE) – Description
image (TYPE) – Description
-
class
airsimdroneracinglab.
MsgpackMixin
¶ -
__repr__
(self)¶ - Returns
Description
- Return type
TYPE
-
to_msgpack
(self, *args, **kwargs)¶ - Parameters
*args – Description
**kwargs – Description
- Returns
Description
- Return type
TYPE
-
classmethod
from_msgpack
(cls, encoded)¶ - Parameters
encoded (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
ImageType
¶ -
-
Scene
= 0¶
-
DepthPlanner
= 1¶
-
DepthPerspective
= 2¶
-
DepthVis
= 3¶
-
DisparityNormalized
= 4¶
-
Segmentation
= 5¶
-
SurfaceNormals
= 6¶
-
Infrared
= 7¶
-
-
class
airsimdroneracinglab.
DrivetrainType
¶ Type of DrivetrainType
-
MaxDegreeOfFreedom
= 0¶
-
ForwardOnly
= 1¶
-
-
class
airsimdroneracinglab.
WeatherParameter
¶ -
Rain
= 0¶
-
Roadwetness
= 1¶
-
Snow
= 2¶
-
RoadSnow
= 3¶
-
MapleLeaf
= 4¶
-
RoadLeaf
= 5¶
-
Dust
= 6¶
-
Fog
= 7¶
-
Enabled
= 8¶
-
-
class
airsimdroneracinglab.
Vector3r
(x_val=0.0, y_val=0.0, z_val=0.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
x_val
= 0.0¶
-
y_val
= 0.0¶
-
z_val
= 0.0¶
-
static
nanVector3r
()¶ - Returns
Description
- Return type
TYPE
-
__add__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
__sub__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
__truediv__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__mul__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
dot
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
cross
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
get_length
(self)¶ - Returns
Description
- Return type
TYPE
-
distance_to
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
-
to_Quaternionr
(self)¶ - Returns
Description
- Return type
TYPE
-
to_numpy_array
(self)¶ - Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
Quaternionr
(x_val=0.0, y_val=0.0, z_val=0.0, w_val=1.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
w_val
= 0.0¶
-
x_val
= 0.0¶
-
y_val
= 0.0¶
-
z_val
= 0.0¶
-
static
nanQuaternionr
()¶ - Returns
Description
- Return type
TYPE
-
__add__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__mul__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
__truediv__
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
dot
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
cross
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
outer_product
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
-
rotate
(self, other)¶ - Parameters
other (TYPE) – Description
- Returns
Description
- Return type
TYPE
- Raises
TypeError – Description
ValueError – Description
-
conjugate
(self)¶ - Returns
Description
- Return type
TYPE
-
star
(self)¶ - Returns
Description
- Return type
TYPE
-
inverse
(self)¶ - Returns
Description
- Return type
TYPE
-
sgn
(self)¶ - Returns
Description
- Return type
TYPE
-
to_numpy_array
(self)¶ - Returns
Description
- Return type
np.array
-
-
class
airsimdroneracinglab.
Pose
(position_val=Vector3r(), orientation_val=Quaternionr())¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
orientation
¶ Description
- Type
-
position
¶
-
orientation
¶
-
static
nanPose
()¶ - Returns
Description
- Return type
TYPE
-
-
class
airsimdroneracinglab.
CollisionInfo
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
impact_point
¶ Description
- Type
TYPE
-
normal
¶ Description
- Type
TYPE
-
position
¶ Description
- Type
TYPE
-
has_collided
= False¶
-
normal
¶
-
impact_point
¶
-
position
¶
-
penetration_depth
= 0.0¶
-
time_stamp
= 0.0¶
-
object_name
=¶
-
object_id
¶
-
-
class
airsimdroneracinglab.
GeoPoint
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
latitude
= 0.0¶
-
longitude
= 0.0¶
-
altitude
= 0.0¶
-
-
class
airsimdroneracinglab.
YawMode
(is_rate=True, yaw_or_rate=0.0)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
Struct YawMode with two fields, yaw_or_rate and is_rate. If is_rate field is True then yaw_or_rate field is interpreted as angular velocity in degrees/sec, which means you want vehicle to rotate continuously around its axis at that angular velocity while moving.
If is_rate is False then yaw_or_rate is interpreted as angle in degrees, which means you want vehicle to rotate to specific angle (i.e. yaw) and keep that angle while moving.
When yaw_mode.is_rate == true, the drivetrain parameter shouldn’t be set to ForwardOnly because there’s a contradiction as we’re asking for the drone to keep front pointing ahead, but also rotate continuously. However if you have yaw_mode.is_rate = false in ForwardOnly mode then you can do some funky stuff. For example, you can have drone do circles and have yaw_or_rate set to 90 so camera is always pointed to center. In MaxDegreeofFreedom also you can get some funky stuff by setting yaw_mode.is_rate = true and say yaw_mode.yaw_or_rate = 20. This will cause drone to go in its path while rotating which may allow to do 360 scanning.
In most cases, you just don’t want yaw to change which you can do by setting yaw rate of 0. The shorthand for this is airsim.YawMode()
-
is_rate
¶ if True, yaw_or_rate is interpreted as angular velocity in degrees/sec, if False, yaw_or_rate is interpreted as angles in degrees,
- Type
-
yaw_or_rate
¶ value of desired yaw rate, or desired yaw angle. Interpretation depends upon is_rate
- Type
-
is_rate
= True¶
-
yaw_or_rate
= 0.0¶
-
-
class
airsimdroneracinglab.
RCData
(timestamp=0, pitch=0.0, roll=0.0, throttle=0.0, yaw=0.0, switch1=0, switch2=0, switch3=0, switch4=0, switch5=0, switch6=0, switch7=0, switch8=0, is_initialized=False, is_valid=False)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
pitch
¶ Description
- Type
TYPE
-
roll
¶ Description
- Type
TYPE
-
switch1
¶ Description
- Type
TYPE
-
switch2
¶ Description
- Type
TYPE
-
switch3
¶ Description
- Type
TYPE
-
switch4
¶ Description
- Type
TYPE
-
switch5
¶ Description
- Type
TYPE
-
switch6
¶ Description
- Type
TYPE
-
switch7
¶ Description
- Type
TYPE
-
switch8
¶ Description
- Type
TYPE
-
throttle
¶ Description
- Type
TYPE
-
yaw
¶ Description
- Type
TYPE
-
timestamp
= 0¶
-
is_initialized
= False¶
-
is_valid
= False¶
-
-
class
airsimdroneracinglab.
ImageRequest
(camera_name, image_type, pixels_as_float=False, compress=True)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
image_type
¶ Description
- Type
TYPE
-
camera_name
= 0¶
-
image_type
¶
-
pixels_as_float
= False¶
-
compress
= False¶
-
-
class
airsimdroneracinglab.
ImageResponse
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
camera_orientation
¶ Description
- Type
TYPE
-
camera_position
¶ Description
- Type
TYPE
-
image_data_uint8
¶ Description
- Type
TYPE
-
image_type
¶ Description
- Type
TYPE
-
time_stamp
¶ Description
- Type
TYPE
-
image_data_uint8
¶
-
image_data_float
= 0.0¶
-
camera_position
¶
-
camera_orientation
¶
-
time_stamp
¶
-
message
=¶
-
pixels_as_float
= 0.0¶
-
compress
= True¶
-
width
= 0¶
-
height
= 0¶
-
image_type
¶
-
-
class
airsimdroneracinglab.
CarControls
(throttle=0, steering=0, brake=0, handbrake=False, is_manual_gear=False, manual_gear=0, gear_immediate=True)¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
throttle
= 0.0¶
-
steering
= 0.0¶
-
brake
= 0.0¶
-
handbrake
= False¶
-
is_manual_gear
= False¶
-
manual_gear
= 0¶
-
gear_immediate
= True¶
-
set_throttle
(self, throttle_val, forward)¶
-
-
class
airsimdroneracinglab.
KinematicsState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
orientation
¶ Description
- Type
-
position
¶
-
orientation
¶
-
linear_velocity
¶
-
angular_velocity
¶
-
linear_acceleration
¶
-
angular_acceleration
¶
-
-
class
airsimdroneracinglab.
EnvironmentState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
position
¶
-
geo_point
¶
-
gravity
¶
-
air_pressure
= 0.0¶
-
temperature
= 0.0¶
-
air_density
= 0.0¶
-
-
class
airsimdroneracinglab.
CarState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
speed
= 0.0¶
-
gear
= 0¶
-
rpm
= 0.0¶
-
maxrpm
= 0.0¶
-
handbrake
= False¶
-
collision
¶
-
kinematics_estimated
¶
-
timestamp
¶
-
-
class
airsimdroneracinglab.
MultirotorState
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
collision
¶ Description
- Type
-
kinematics_estimated
¶ Description
- Type
-
landed_state
¶ Description
- Type
LandedState.Landed
-
timestamp
¶ Description
- Type
np.uint64
-
collision
¶
-
kinematics_estimated
¶
-
gps_location
¶
-
timestamp
¶
-
landed_state
¶
-
rc_data
¶
-
-
class
airsimdroneracinglab.
ProjectionMatrix
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
matrix
¶
Description
- Type
-
matrix
= []¶
-
-
class
airsimdroneracinglab.
CameraInfo
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
pose
¶ Description
- Type
TYPE
-
proj_mat
¶ Description
- Type
TYPE
-
pose
¶
-
fov
¶
-
proj_mat
¶
-
-
class
airsimdroneracinglab.
LidarData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
point_cloud
= 0.0¶
-
time_stamp
¶
-
pose
¶
-
-
class
airsimdroneracinglab.
ImuData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
orientation
¶
-
angular_velocity
¶
-
linear_acceleration
¶
-
-
class
airsimdroneracinglab.
BarometerData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
altitude
¶
-
pressure
¶
-
qnh
¶
-
-
class
airsimdroneracinglab.
MagnetometerData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
magnetic_field_body
¶
-
magnetic_field_covariance
= 0.0¶
-
-
class
airsimdroneracinglab.
GnssFixType
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
GNSS_FIX_NO_FIX
= 0¶
-
GNSS_FIX_TIME_ONLY
= 1¶
-
GNSS_FIX_2D_FIX
= 2¶
-
GNSS_FIX_3D_FIX
= 3¶
-
-
class
airsimdroneracinglab.
GnssReport
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
geo_point
¶
-
eph
= 0.0¶
-
epv
= 0.0¶
-
velocity
¶
-
fix_type
¶
-
time_utc
¶
-
-
class
airsimdroneracinglab.
GpsData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
gnss
¶
-
is_valid
= False¶
-
-
class
airsimdroneracinglab.
DistanceSensorData
¶ Bases:
airsimdroneracinglab.types.MsgpackMixin
-
time_stamp
¶
-
distance
¶
-
min_distance
¶
-
max_distance
¶
-
relative_pose
¶
-
-
class
airsimdroneracinglab.
PIDGains
(kp, ki, kd)¶ Struct to store values of PID gains. Used to transmit controller gain values while instantiating AngleLevel/AngleRate/Velocity/PositionControllerGains objects.
-
to_list
(self)¶
-
-
class
airsimdroneracinglab.
AngleRateControllerGains
(roll_gains=PIDGains(0.25, 0, 0), pitch_gains=PIDGains(0.25, 0, 0), yaw_gains=PIDGains(0.25, 0, 0))¶ Struct to contain controller gains used by angle level PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
AngleLevelControllerGains
(roll_gains=PIDGains(2.5, 0, 0), pitch_gains=PIDGains(2.5, 0, 0), yaw_gains=PIDGains(2.5, 0, 0))¶ Struct to contain controller gains used by angle rate PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
VelocityControllerGains
(x_gains=PIDGains(0.2, 0, 0), y_gains=PIDGains(0.2, 0, 0), z_gains=PIDGains(2.0, 2.0, 0))¶ Struct to contain controller gains used by velocity PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
PositionControllerGains
(x_gains=PIDGains(0.25, 0, 0), y_gains=PIDGains(0.25, 0, 0), z_gains=PIDGains(0.25, 0, 0))¶ Struct to contain controller gains used by position PID controller
-
to_lists
(self)¶
-
-
class
airsimdroneracinglab.
TrajectoryTrackerGains
(kp_cross_track=7.5, kd_cross_track=0.0, kp_vel_cross_track=5.0, kd_vel_cross_track=0.0, kp_along_track=0.4, kd_along_track=0.0, kp_vel_along_track=0.04, kd_vel_along_track=0.0, kp_z_track=2.0, kd_z_track=0.0, kp_vel_z=0.4, kd_vel_z=0.0, kp_yaw=3.0, kd_yaw=0.1)¶ Struct to contain trajectory tracker gains used by the pure pursuit controller for moveBySpline and moveBySplineVelConstraints
-
kp_cross_track
¶ P gain for position error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kd_cross_track
¶ D gain for position error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kp_vel_cross_track
¶ P gain for velocity error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-
kd_vel_cross_track
¶ D gain for velocity error measured perpendicular to path tangent, or in the “cross track” direction
- Type
-