__init__
VehicleClient.__init__(
ip="",
port=41451,
timeout_value=3600,
run_in_background: bool = False,
)
Initializes the VehicleClient IP address of the server, defaults to localhost
Port number of the server, defaults to 41451
Timeout value for the connection, defaults to 3600
Whether to run the client in background, defaults to False. When true, this client does not print info unless necessary.
reset
Reset the vehicle to its original starting state Note that you must call enableApiControl and armDisarm again after the call to reset
ping
If connection is established then this call will return true otherwise it will be blocked until timeout
getClientVersion
VehicleClient.getClientVersion()
No description provided!
getServerVersion
VehicleClient.getServerVersion()
No description provided!
getMinRequiredServerVersion
VehicleClient.getMinRequiredServerVersion()
No description provided!
getMinRequiredClientVersion
VehicleClient.getMinRequiredClientVersion()
No description provided!
enableApiControl
VehicleClient.enableApiControl(is_enabled, vehicle_name="")
Enables or disables API control for vehicle corresponding to vehicle_name True to enable, False to disable API control
Name of the vehicle to send this command to
isApiControlEnabled
VehicleClient.isApiControlEnabled(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. If API control is enabled
armDisarm
VehicleClient.armDisarm(arm, vehicle_name="")
Arms or disarms vehicle True to arm, False to disarm the vehicle
Name of the vehicle to send this command to
simPause
VehicleClient.simPause(is_paused)
Pauses simulation True to pause the simulation, False to release
simIsPause
VehicleClient.simIsPause()
Returns true if the simulation is paused If the simulation is paused
simContinueForTime
VehicleClient.simContinueForTime(seconds)
Continue the simulation for the specified number of seconds Time to run the simulation for
simContinueForFrames
VehicleClient.simContinueForFrames(frames)
Continue (or resume if paused) the simulation for the specified number of frames, after which the simulation will be paused. Frames to run the simulation for
getHomeGeoPoint
VehicleClient.getHomeGeoPoint(vehicle_name="")
Get the Home location of the vehicle Name of vehicle to get home location of
Home location of the vehicle
confirmConnection
VehicleClient.confirmConnection()
Checks state of connection every 1 sec and reports it in Console so user can see the progress for connection.
simSetLightIntensity
VehicleClient.simSetLightIntensity(light_name, intensity)
Change intensity of named light True if successful, otherwise False
simSwapTextures
VehicleClient.simSwapTextures(tags, tex_id=0, component_id=0, material_id=0)
Runtime Swap Texture API string of ”,” or ”, ” delimited tags to identify on which actors to perform the swap
indexes the array of textures assigned to each actor undergoing a swap
List of objects which matched the provided tags and had the texture swap perfomed
simSetObjectMaterial
VehicleClient.simSetObjectMaterial(object_name, material_name, component_id=0)
Runtime Swap Texture API name of object to set material for
name of material to set for object
simSetObjectMaterialFromTexture
VehicleClient.simSetObjectMaterialFromTexture(
object_name, texture_path, component_id=0
)
Runtime Swap Texture API name of object to set material for
path to texture to set for object
simSetObjectMaterialFromTextureURL
VehicleClient.simSetObjectMaterialFromTextureURL(
object_name, url, component_id=0
)
Runtime Swap Texture API name of object to set material for
url for texture to set for object
simSetTimeOfDay
VehicleClient.simSetTimeOfDay(
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 True to enable time-of-day effect, False to reset the position to original
Date & Time in %Y-%m-%d %H:%M:%S format, e.g. 2018-02-12 15:20:00
True to adjust for Daylight Savings Time
Run celestial clock faster or slower than simulation clock
Interval to update the Sun’s position
Whether or not to move the Sun
simEnableWeather
VehicleClient.simEnableWeather(enable: bool)
Enable Weather effects. Needs to be called before using simSetWeatherParameter API True to enable, False to disable
simSetWeatherParameter
VehicleClient.simSetWeatherParameter(param, val)
Enable various weather effects Intensity of the effect, Range 0-1
simGetImage
VehicleClient.simGetImage(camera_name, image_type, vehicle_name="", external=False, capture_3d=False, cubemap=False)
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 Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Name of the vehicle with the camera
Whether the camera is an External Camera
Whether to capture 3D images (default: False).
Whether to capture cubemap images otherwise equirectangular (default: False).
string literal of compressed png image
getImages
VehicleClient.getImages(
camera_name, image_types: List[ImageType], vehicle_name="", capture_3d=False, cubemap=False
)
Get multiple images Name of vehicle associated with the camera
Whether to capture 3D images (default: False).
Whether to capture cubemap images otherwise equirectangular (default: False).
simGetImages
VehicleClient.simGetImages(
requests: ImageRequest, vehicle_name="", external=False, capture_3d=False, cubemap=False
)
Get multiple images Name of vehicle associated with the camera
Whether the camera is an External Camera
Whether to capture 3D images (default: False).
Whether to capture cubemap images otherwise equirectangular (default: False).
simGetImagesAlongTrajectory
VehicleClient.simGetImagesAlongTrajectory(
poses: List[Pose], requests, vehicle_name="", external=False, capture_3d=False, cubemap=False
)
Get images along a trajectory (specified by position and pose) when list[Pose ]: A list of poses of the vehicle, at which images are to be requested Name of vehicle associated with the camera
Whether the camera is an External Camera, defaults to False
Whether to capture 3d images (default: False).
Whether to capture cubemap images otherwise equirectangular (default: False).
simGetPresetLensSettings
VehicleClient.simGetPresetLensSettings(
camera_name: str, vehicle_name: str = "", external: bool = False
)
Get the preset lens settings for the camera vechile name. Defaults to "".
Whether the camera is an External Camera. Defaults to False.
simGetLensSettings
VehicleClient.simGetLensSettings(
camera_name: str, vehicle_name: str = "", external=False
)
Get the lens settings for the camera vechile name. Defaults to "".
Whether the camera is an External Camera. Defaults to False.
simSetPresetLensSettings
VehicleClient.simSetPresetLensSettings(
preset_lens_settings,
camera_name: str,
vehicle_name: str = "",
external=False,
)
No description provided!
simGetPresetFilmbackSettings
VehicleClient.simGetPresetFilmbackSettings(
camera_name, vehicle_name="", external=False
)
No description provided!
simSetPresetFilmbackSettings
VehicleClient.simSetPresetFilmbackSettings(
preset_filmback_settings, camera_name, vehicle_name="", external=False
)
No description provided!
simGetFilmbackSettings
VehicleClient.simGetFilmbackSettings(camera_name, vehicle_name="", external=False)
No description provided!
simSetFilmbackSettings
VehicleClient.simSetFilmbackSettings(
sensor_width, sensor_height, camera_name, vehicle_name="", external=False
)
No description provided!
simGetFocalLength
VehicleClient.simGetFocalLength(camera_name, vehicle_name="", external=False)
No description provided!
simSetFocalLength
VehicleClient.simSetFocalLength(
focal_length, camera_name, vehicle_name="", external=False
)
No description provided!
simEnableManualFocus
VehicleClient.simEnableManualFocus(
enable, camera_name, vehicle_name="", external=False
)
No description provided!
simGetFocusDistance
VehicleClient.simGetFocusDistance(camera_name, vehicle_name="", external=False)
No description provided!
simSetFocusDistance
VehicleClient.simSetFocusDistance(
focus_distance, camera_name, vehicle_name="", external=False
)
No description provided!
simGetFocusAperture
VehicleClient.simGetFocusAperture(camera_name, vehicle_name="", external=False)
No description provided!
simSetFocusAperture
VehicleClient.simSetFocusAperture(
focus_aperture, camera_name, vehicle_name="", external=False
)
No description provided!
simEnableFocusPlane
VehicleClient.simEnableFocusPlane(enable, camera_name, vehicle_name="", external=False)
No description provided!
simGetCurrentFieldOfView
VehicleClient.simGetCurrentFieldOfView(camera_name, vehicle_name="", external=False)
No description provided!
simTestLineOfSightToPoint
VehicleClient.simTestLineOfSightToPoint(point, vehicle_name="")
Returns whether the target point is visible from the perspective of the inputted vehicle
simTestLineOfSightBetweenPoints
VehicleClient.simTestLineOfSightBetweenPoints(point1, point2)
Returns whether the target point is visible from the perspective of the source point
simGetWorldExtents
VehicleClient.simGetWorldExtents()
Returns a list of GeoPoints representing the minimum and maximum extents of the world
simRunConsoleCommand
VehicleClient.simRunConsoleCommand(command)
Allows the client to execute a command in Unreal’s native console, via an API.
Affords access to the countless built-in commands such as “stat unit”, “stat fps”, “open [map]”, adjust any config settings, etc. etc.
Allows the user to create bespoke APIs very easily, by adding a custom event to the level blueprint, and then calling the console command “ce MyEventName [args]”. No recompilation of airgen needed! Desired Unreal Engine Console command to run
simGetMeshPositionVertexBuffers
VehicleClient.simGetMeshPositionVertexBuffers()
Returns the static meshes that make up the scene list[MeshPositionVertexBuffersResponse] list[MeshPositionVertexBuffersResponse]
list[MeshPositionVertexBuffersResponse]
simGetCollisionInfo
VehicleClient.simGetCollisionInfo(vehicle_name="")
No description provided! Name of the Vehicle to get the info of. This call will also reset the collision info (state of the vehicle) to False.
simSetVehiclePose
VehicleClient.simSetVehiclePose(pose, ignore_collision, vehicle_name="", on_ground=False, ground_trace_range_up=13000, ground_trace_range_down=13000, timeout_sec=10)
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 (Pose ): Desired Pose pf the vehicle Whether to ignore any collision or not
Name of the vehicle to move
Whether to set the vehicle’s altitude to ground level while setting its position
From what distance above the Vehicle’s current altitude do we start looking for the ground (default is 13 KM)
How much distance below the Vehicles’s current altitude do we stop looking for the ground (default is 13 KM)
Timeout to find ground location (if on_ground is True)
future. call .join() to wait for method to finish.
simSetVehicleGeoPose
VehicleClient.simSetVehicleGeoPose(geopose, ignore_collision, vehicle_name="", on_ground=False, ground_trace_range_up=13000, ground_trace_range_down=13000, timeout_sec=10)
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 (Pose ): Desired Pose pf the vehicle Whether to ignore any collision or not
Name of the vehicle to move
Whether to set the vehicle’s altitude to ground level while setting its position
From what distance above the Vehicle’s current altitude do we start looking for the ground (default is 13 KM)
How much distance below the Vehicles’s current altitude do we stop looking for the ground (default is 13 KM)
Timeout to find ground location (if on_ground is True)
future. call .join() to wait for method to finish.
simSetGeoReference
VehicleClient.simSetGeoReference(geopoint)
Set the geo reference of the scene (only valid for Cesium) (GeoPoint ): Desired GeoPoint of the scene
simGetVehiclePose
VehicleClient.simGetVehiclePose(vehicle_name="")
The position inside the returned Pose is in the frame of the vehicle’s starting point Name of the vehicle to get the Pose of
pose (position and quaternion) of the vehicle
simSetTraceLine
VehicleClient.simSetTraceLine(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 desired RGBA values from 0.0 to 1.0
Name of the vehicle to set Trace line values for
simGetObjectPose
VehicleClient.simGetObjectPose(object_name)
The position inside the returned Pose is in the world frame Object to get the Pose of
pose (position and quaternion) of the object
simSetObjectPose
VehicleClient.simSetObjectPose(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 Name of the object(actor) to move
(Pose ): Desired Pose of the object Whether to move the object immediately without affecting their velocity
If the move was successful
simSetObjectGeoPose
VehicleClient.simSetObjectGeoPose(object_name, geopose, 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 Name of the object(actor) to move
(Pose ): Desired Pose of the object Whether to move the object immediately without affecting their velocity
If the move was successful
simGetObjectScale
VehicleClient.simGetObjectScale(object_name)
Gets scale of an object in the world Object to get the scale of
simSetObjectScale
VehicleClient.simSetObjectScale(object_name, scale_vector)
Sets scale of an object in the world Object to set the scale of
True if scale change was successful
simGetObjectDimensions
VehicleClient.simGetObjectDimensions(object_name)
Gets bounds of an object in the world Object to get the bounds of
simGetObjectCenter
VehicleClient.simGetObjectCenter(object_name)
Gets the center of an object in the world Object to get the center of
simListSceneObjects
VehicleClient.simListSceneObjects(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 String to match actor names against, e.g. “Cylinder.*”
List containing all the names
simListObjectsWithTag
VehicleClient.simListObjectsWithTag(tag_regex)
Lists the objects present in the environment with the input tag Regex can be used to return a list of objects with matching tags Tag to match actor tags against, e.g. “PalmTree” or ”.*Tree”
List containing all the actor names
simLoadLevel
VehicleClient.simLoadLevel(level_name)
Loads a level specified by its name Name of the level to load
True if the level was successfully loaded
simListAssets
VehicleClient.simListAssets()
Lists all the assets present in the Asset Registry
simSpawnObject
VehicleClient.simSpawnObject(
object_name,
asset_name,
pose,
scale,
physics_enabled=False,
is_blueprint=False,
)
Spawned selected object in the world Desired name of new object
Name of asset(mesh) in the project database
Whether to enable physics for the object
Whether to spawn a blueprint or an actor
Name of spawned object, in case it had to be modified
simSpawnObjectFromPath
VehicleClient.simSpawnObjectFromPath(object_name, path, pose=Pose(), scale=Vector3r(1,1,1), is_unlit=False, physics_enabled=False, use_complex=False, nav_enabled=False)
Spawned selected object in the world Desired name of new object
Name of asset(mesh) in the project database
Desired pose of object, default is Pose() (no rotation or translation)
scale airgen.Vector3r, optional
Desired scale of object, default is Vector3r(1,1,1) (no scaling)
Whether the object should be unlit (default is False)
Whether to enable physics for the object (default is False)
Whether to use a complex mesh for collision detection (default is False)
Whether the object should have navigation enabled (default is False)
True if object was spawned, False otherwise
simSpawnObjectFromURL
VehicleClient.simSpawnObjectFromURL(object_name, url, pose=Pose(), scale=Vector3r(1,1,1), is_unlit=False, physics_enabled=False, use_complex=False, nav_enabled=False)
Spawned selected object in the world Desired name of new object
Name of asset(mesh) in the project database
Desired pose of object, default is Pose() (no rotation or translation)
scale airgen.Vector3r, optional
Desired scale of object, default is Vector3r(1,1,1) (no scaling)
Whether the object should be unlit (default is False)
Whether to enable physics for the object (default is False)
Whether to use a complex mesh for collision detection (default is False)
Whether the object should have navigation enabled (default is False)
True if object was spawned, False otherwise
simDestroyObject
VehicleClient.simDestroyObject(object_name)
Removes selected object from the world Name of object to be removed
True if object is queued up for removal
simSetSegmentationObjectID
VehicleClient.simSetSegmentationObjectID(mesh_name, object_id, is_name_regex=False)
Set segmentation ID for specific objects Name of the mesh to set the ID of (supports regex)
Object ID to be set, range 0-255.
Whether the mesh name is a regex. If True, all meshes matching the regex will be set to the same ID
simSetSegmentationInstanceID
VehicleClient.simSetSegmentationInstanceID(mesh_name, instance_id, is_name_regex=False)
Set segmentation ID for specific instances Name of the mesh to set the ID of (supports regex)
start of instance ID to be set, range 0-255. Gets incremented each time for each instance (mesh)
Whether the mesh name is a regex
number of instances (meshes) matched with mesh_id updated
simGetSegmentationObjectID
VehicleClient.simGetSegmentationObjectID(mesh_name)
Returns Object ID for the given mesh name (case-sensitive) Name of the mesh to get the ID of
simAddDetectionFilterMeshName
VehicleClient.simAddDetectionFilterMeshName(
camera_name, image_type, mesh_name, vehicle_name="", external=False
)
Add mesh name to detect in wild card format For example: simAddDetectionFilterMeshName(“Car_”) will detect all instance named “Car_ ” Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
mesh name in wild card format
Vehicle which the camera is associated with
Whether the camera is an External Camera
simSetDetectionFilterRadius
VehicleClient.simSetDetectionFilterRadius(
camera_name, image_type, radius_cm, vehicle_name="", external=False
)
Set detection radius for all cameras Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Vehicle which the camera is associated with
Whether the camera is an External Camera
simClearDetectionMeshNames
VehicleClient.simClearDetectionMeshNames(
camera_name, image_type, vehicle_name="", external=False
)
Clear all mesh names from detection filter Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Vehicle which the camera is associated with
Whether the camera is an External Camera
simGetDetections
VehicleClient.simGetDetections(
camera_name, image_type, vehicle_name="", external=False
)
Get current detections Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Vehicle which the camera is associated with
Whether the camera is an External Camera
simPrintLogMessage
VehicleClient.simPrintLogMessage(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. Parameter to be printed next to the message
Range 0-3, inclusive, corresponding to the severity of the message
simGetCameraInfo
VehicleClient.simGetCameraInfo(camera_name, vehicle_name="", external=False)
Get details about the camera Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Vehicle which the camera is associated with
Whether the camera is an External Camera
simGetDistortionParams
VehicleClient.simGetDistortionParams(camera_name, vehicle_name="", external=False)
Get camera distortion parameters Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Vehicle which the camera is associated with
Whether the camera is an External Camera
(float): List of distortion parameter values corresponding to K1, K2, K3, P1, P2 respectively.
simSetDistortionParams
VehicleClient.simSetDistortionParams(
camera_name, distortion_params, vehicle_name="", external=False
)
Set camera distortion parameters Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Dictionary of distortion param names and corresponding values
Vehicle which the camera is associated with
Whether the camera is an External Camera
simSetDistortionParam
VehicleClient.simSetDistortionParam(
camera_name, param_name, value, vehicle_name="", external=False
)
Set single camera distortion parameter Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Name of distortion parameter
Value of distortion parameter
Vehicle which the camera is associated with
Whether the camera is an External Camera
simSetCameraPose
VehicleClient.simSetCameraPose(camera_name, pose, vehicle_name="", external=False)
Control the pose of a selected camera
Name of the camera to be controlled
(Pose ): Pose representing the desired position and orientation of the camera Name of vehicle which the camera corresponds to
Whether the camera is an External Camera
simSetCameraFov
VehicleClient.simSetCameraFov(
camera_name, fov_degrees, vehicle_name="", external=False
)
Control the field of view of a selected camera
Name of the camera to be controlled
Value of field of view in degrees
Name of vehicle which the camera corresponds to
Whether the camera is an External Camera
simCameraLookAt
VehicleClient.simCameraLookAt(camera_name, pose, vehicle_name="")
Control the pose of a selected camera
Name of the camera to be controlled
(Pose ): Pose representing the desired position the camera has to observe Name of vehicle which the camera corresponds to
Whether the camera is an External Camera
simGetGroundTruthKinematics
VehicleClient.simGetGroundTruthKinematics(vehicle_name="")
Get Ground truth kinematics of the vehicle The position inside the returned KinematicsState is in the frame of the vehicle’s starting point Ground truth of the vehicle
simSetKinematics
VehicleClient.simSetKinematics(state, ignore_collision, vehicle_name="")
Set the kinematics state of the vehicle If you don’t want to change position (or orientation) then just set components of position (or orientation) to floating point nan values Whether to ignore any collision or not
Name of the vehicle to move
simGetGroundTruthEnvironment
VehicleClient.simGetGroundTruthEnvironment(vehicle_name="")
Get ground truth environment state The position inside the returned EnvironmentState is in the frame of the vehicle’s starting point Ground truth environment state
getImuData
VehicleClient.getImuData(imu_name="", vehicle_name="")
No description provided! Name of IMU to get data from, specified in settings.json
Name of vehicle to which the sensor corresponds to
getBarometerData
VehicleClient.getBarometerData(barometer_name="", vehicle_name="")
No description provided! Name of Barometer to get data from, specified in settings.json
Name of vehicle to which the sensor corresponds to
getMagnetometerData
VehicleClient.getMagnetometerData(
magnetometer_name="", vehicle_name=""
)
No description provided! Name of Magnetometer to get data from, specified in settings.json
Name of vehicle to which the sensor corresponds to
getGpsData
VehicleClient.getGpsData(gps_name="", vehicle_name="")
No description provided! Name of GPS to get data from, specified in settings.json
Name of vehicle to which the sensor corresponds to
getDistanceSensorData
VehicleClient.getDistanceSensorData(
distance_sensor_name="", vehicle_name=""
)
No description provided! Name of Distance Sensor to get data from, specified in settings.json
Name of vehicle to which the sensor corresponds to
getLidarData
VehicleClient.getLidarData(lidar_name="", vehicle_name="")
No description provided! Name of Lidar to get data from, specified in settings.json
Name of vehicle to which the sensor corresponds to
simGetLidarSegmentation
VehicleClient.simGetLidarSegmentation(lidar_name="", vehicle_name="")
NOTE: Deprecated API, use getLidarData() API instead
Returns Segmentation ID of each point’s collided object in the last Lidar update Name of the vehicle wth the sensor
Segmentation IDs of the objects
simFlushPersistentMarkers
VehicleClient.simFlushPersistentMarkers()
Clear any persistent markers - those plotted with setting is_persistent=True in the APIs below
simPlotPoints
VehicleClient.simPlotPoints(
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 list[Vector3r ]: List of Vector3r objects desired RGBA values from 0.0 to 1.0
Duration (seconds) to plot for
If set to True, the desired object will be plotted for infinite time.
simPlotLineStrip
VehicleClient.simPlotLineStrip(
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] list[Vector3r ]: List of 3D locations of line start and end points, specified as Vector3r objects desired RGBA values from 0.0 to 1.0
Duration (seconds) to plot for
If set to True, the desired object will be plotted for infinite time.
simPlotLineList
VehicleClient.simPlotLineList(
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] list[Vector3r ]: List of 3D locations of line start and end points, specified as Vector3r objects. Must be even desired RGBA values from 0.0 to 1.0
Duration (seconds) to plot for
If set to True, the desired object will be plotted for infinite time.
simPlotArrows
VehicleClient.simPlotArrows(
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] list[Vector3r ]: List of 3D start positions of arrow start positions, specified as Vector3r objects list[Vector3r ]: List of 3D end positions of arrow start positions, specified as Vector3r objects desired RGBA values from 0.0 to 1.0
Duration (seconds) to plot for
If set to True, the desired object will be plotted for infinite time.
simPlotStrings
VehicleClient.simPlotStrings(
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. list[Vector3r ]: List of positions where the strings should be plotted. Should be in one-to-one correspondence with the strings’ list Font scale of transform name
desired RGBA values from 0.0 to 1.0
Duration (seconds) to plot for
VehicleClient.simPlotTransforms(
poses, scale=5.0, thickness=5.0, duration=-1.0, is_persistent=False
)
Plots a list of transforms in World NED frame. list[Pose ]: List of Pose objects representing the transforms to plot Length of transforms’ axes
Thickness of transforms’ axes
Duration (seconds) to plot for
If set to True, the desired object will be plotted for infinite time.
VehicleClient.simPlotTransformsWithNames(
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. list[Pose ]: List of Pose objects representing the transforms to plot List of strings with one-to-one correspondence to list of poses
Length of transforms’ axes
Thickness of transforms’ axes
Font scale of transform name
desired RGBA values from 0.0 to 1.0 for the transform name
Duration (seconds) to plot for
startRecording
VehicleClient.startRecording()
Start Recording Recording will be done according to the settings
stopRecording
VehicleClient.stopRecording()
Stop Recording
isRecording
VehicleClient.isRecording()
Whether Recording is running or not True if Recording, else False
simSetWind
VehicleClient.simSetWind(wind)
Set simulated wind, in World frame, NED direction, m/s (Vector3r ): Wind, in World frame, NED direction, in m/s
simCreateVoxelGrid
VehicleClient.simCreateVoxelGrid(position, x, y, z, res, of)
Construct and save a binvox-formatted voxel grid of environment (Vector3r ): Position around which voxel grid is centered in m Resolution of voxel grid in m
Name of output file to save voxel grid as
True if output written to file successfully, else False
simBuildSDF
VehicleClient.simBuildSDF(position, x, y, z, res)
Construct a signed distance field of the environment centered at position,
and with dimensions (x, y, z). Internally, the SDF is stored as a special
case of a voxel grid with floating point distances instead of boolean occupancy. (Vector3r ): Global position around which field is centered in m Resolution of distance field in m
simCheckOccupancy
VehicleClient.simCheckOccupancy(position)
Check and return occupancy of a point. Requires signed distance field to be
built beforehand. (Vector3r ): Global position at which occupancy is to be checked (m)
simGetSignedDistance
VehicleClient.simGetSignedDistance(position)
Get signed distance of a point (distance to the closest ‘object surface’)
in the environment. Requires signed distance field to be built beforehand. Distance is positive if the point is in free space, and negative if the point is
inside an object. (Vector3r ): Global position at which distance is to be computed (m) (float): Signed distance at the position
simGetSignedDistances
VehicleClient.simGetSignedDistances(positions)
Get signed distance of a list of points (distance to the closest ‘object surface’)
in the environment. Requires signed distance field to be built beforehand. Distance is positive if the point is in free space, and negative if the point is
inside an object. List of global positions at which distance is to be computed (m)
(list[float]): Signed distances at the positions
simGetSDFGradient
VehicleClient.simGetSDFGradient(position)
Get the SDF gradient at a point (vector pointing away from the closest
‘object surface’) in the environment. Requires signed distance field to be built
beforehand. (Vector3r ): Global position at which gradient is to be computed (m)
simCheckInVolume
VehicleClient.simCheckInVolume(position, volume_object_name)
Check if a point is inside a volume. (Vector3r ): Global position at which volume is to be checked (m) Name of the volume object
simProjectToFreeSpace
VehicleClient.simProjectToFreeSpace(position, mindist)
Project a given point into free space using the SDF, with a specified minimum clearance
from existing objects. Returns the same point if the point is already free, else follows
the SDF gradient to find a free point that satisfies the minimum distance constraint. (Vector3r ): Global position to project (m) Minimum distance from objects to satisfy when finding the free point
Vector3r : Projected position in free space
simSaveSDF
VehicleClient.simSaveSDF(filepath)
Save the constructed signed distance field to a file. Filename to save the SDF to
simLoadSDF
VehicleClient.simLoadSDF(filepath)
Load a saved signed distance field. Filename to load the SDF from
simGetRandomFreePoint
VehicleClient.simGetRandomFreePoint(search_radius)
Return a random free (unoccupied) point within a radius around the vehicle. Radius around the vehicle to search for a free point in m
/None: Free/unoccupied point coordinates if successful, else None
simPlanPathToRandomFreePoint
VehicleClient.simPlanPathToRandomFreePoint(search_radius, smooth_path, draw_path)
Plan a collision-free path to a random point within a radius around the vehicle and return the intermediate waypoints. Radius around the vehicle to search for a free point in m
Returns a smooth spline if True, else returns a list of coarse waypoints
Draws the path in the Unreal environment if True
List of waypoints if successful, else empty list
simPlanPathToRandomizeGoal
VehicleClient.simPlanPathToRandomizeGoal(
start, goal, search_radius, num_trials, smooth_path, draw_path
)
Plan a collision-free path from the current position to a random point within a radius around the goal and return the intermediate waypoints. (Vector3r ): Start position in airgen coordinates (Vector3r ): Goal position in airgen coordinates Radius around the vehicle to search for a free point in m
number of random points to query for a free point
Returns a smooth spline if True, else returns a list of coarse waypoints
Draws the path in the Unreal environment if True
List of waypoints if successful, else empty list
simPlanPath
VehicleClient.simPlanPath(start, goal, smooth_path, draw_path)
Plan a collision-free path between start and goal points and return the intermediate waypoints. (Vector3r ): Start position in airgen coordinates (Vector3r ): Goal position in airgen coordinates Returns a smooth spline if True, else returns a list of coarse waypoints
Draws the path in the Unreal environment if True
List of waypoints if successful, else empty list
getNavMeshInfo
VehicleClient.getNavMeshInfo()
Get NavMesh information, as an array of XYZ center, min and max values in global NED coordinates List of values if successful, else empty list
isPointInCollision
VehicleClient.isPointInCollision(point)
Get Collision information about a point. Returns True if point is in collision, else False (Vector3r ): Point to be checked in airgen coordinates True if point is in collision, else False
isAnyPointInCollisionBatch
VehicleClient.isAnyPointInCollisionBatch(points)
Get Collision information about an array of points. Returns True if any of the points is in collision, else False list[Vector3r ]: List of points to be checked in airgen coordinates True if any of the points is in collision, else False
simAddVehicle
VehicleClient.simAddVehicle(vehicle_name, vehicle_type, pose, pawn_path="")
Create vehicle at runtime Name of the vehicle being created
Type of vehicle, e.g. “simpleflight”
(Pose ): Initial pose of the vehicle Vehicle blueprint path, default empty wbich uses the default blueprint for the vehicle type
Whether vehicle was created
listVehicles
VehicleClient.listVehicles()
Lists the names of current vehicles List containing names of all vehicles
getSettingsString
VehicleClient.getSettingsString()
Fetch the settings text being used by airgen Settings text in JSON format
simCreateWaypoint
VehicleClient.simCreateWaypoint(context = "", vehicle_name = "")
Creates a waypoint using the vehicle transform.
The created waypoint will be associated with the specified waypoints-context. If context isn’t specified, it’ll default to the last-used context.
If there’s no context present and context isn’t specified, a context named ‘defaultWaypoints’ will be auto created. Name of the associated waypoints-context
simCreateWaypointFromPose
VehicleClient.simCreateWaypointFromPose(pose, context = "")
Creates a waypoint using the vehicle transform.
The created waypoint will be associated with the specified waypoints-context. If context isn’t specified, it’ll default to the last-used context.
If there’s no context present and context isn’t specified, a context named ‘defaultWaypoints’ will be auto created. Name of the associated waypoints-context
simDeleteWaypoints
VehicleClient.simDeleteWaypoints(context = "", only_recent = True, keep_context_alive = True)
Deletes waypoints for a specified context If ‘only_recent’ is True, it’ll delete the youngest waypoint of the specified waypoints-context.
If ‘only_recent’ is False, it’ll delete all waypoints for the specified context. If context isn’t specified, it’ll default to the last-used context.
If context isn’t specified and there’s no last-used context, it’ll throw an error. Name of the associated waypoints-context
Whether to delete only the youngest waypoint or all of them, for a context
If this is False, the context and all its associated waypoints will be deleted
simDeleteAllWaypoints
VehicleClient.simDeleteAllWaypoints()
Deletes all waypoints and all waypoint-contexts
simGetWaypointDataAsCsv
VehicleClient.simGetWaypointDataAsCsv(context = "")
Get the waypoints data of a waypoints-context as a CSV formatted string.
If context isn’t specified, it’ll default to the last-used context.
If context isn’t specified and there’s no last-used context, it’ll throw an error. Name of the waypoints-context
(str): Waypoint data as a CSV formatted string
simGetWaypointDataAsJson
VehicleClient.simGetWaypointDataAsJson(context = "")
Get the waypoints data of a waypoints-context as a JSON string.
If context isn’t specified, it’ll default to the last-used context.
If context isn’t specified and there’s no last-used context, it’ll throw an error. Name of the waypoints-context
(str): Waypoint data as a JSON formatted string
simSetWaypointColor
VehicleClient.simSetWaypointColor(color_rgb, index, context = "")
Changes the color of a given waypoint.
If context isn’t specified, it’ll default to the last-used context.
If context isn’t specified and there’s no last-used context, it’ll throw an error. desired RGB values from 0.0 to 1.0. e.g. [1, 1, 1]
The index of the Waypoint. The index of the first waypoint is 0.
Name of the waypoints-context.
(bool): True if the color change was a success, false otherwise.
simResetWaypointColor
VehicleClient.simResetWaypointColor(index, context = "")
Resets the color of a given waypoint to the original.
If context isn’t specified, it’ll default to the last-used context.
If context isn’t specified and there’s no last-used context, it’ll throw an error. The index of the Waypoint. The index of the first waypoint is 0.
Name of the waypoints-context.
(bool): True if the color reset was a success, false otherwise.