VehicleClient
__init__
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
getClientVersion
No description provided!
getServerVersion
No description provided!
getMinRequiredServerVersion
No description provided!
getMinRequiredClientVersion
No description provided!
enableApiControl
isApiControlEnabled
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.
armDisarm
simPause
simIsPause
simContinueForTime
simContinueForFrames
getHomeGeoPoint
confirmConnection
Checks state of connection every 1 sec and reports it in Console so user can see the progress for connection.
simSetLightIntensity
simSwapTextures
Runtime Swap Texture API
simSetObjectMaterial
simSetObjectMaterialFromTexture
simSetObjectMaterialFromTextureURL
simSetTimeOfDay
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
Enable Weather effects. Needs to be called before using simSetWeatherParameter API
simSetWeatherParameter
Enable various weather effects
(WeatherParameter): Weather effect to be enabled
Intensity of the effect, Range 0-1
simGetImage
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).
getImages
simGetImages
Get multiple images
list[ImageRequest]: Images required
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).
list[ImageResponse]
simGetImagesAlongTrajectory
Get images along a trajectory (specified by position and pose) when
list[ImageRequest]: Images required
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).
list[ImageResponse]
simGetPresetLensSettings
simGetLensSettings
simSetPresetLensSettings
No description provided!
simGetPresetFilmbackSettings
No description provided!
simSetPresetFilmbackSettings
No description provided!
simGetFilmbackSettings
No description provided!
simSetFilmbackSettings
No description provided!
simGetFocalLength
No description provided!
simSetFocalLength
No description provided!
simEnableManualFocus
No description provided!
simGetFocusDistance
No description provided!
simSetFocusDistance
No description provided!
simGetFocusAperture
No description provided!
simSetFocusAperture
No description provided!
simEnableFocusPlane
No description provided!
simGetCurrentFieldOfView
No description provided!
simTestLineOfSightToPoint
simTestLineOfSightBetweenPoints
simGetWorldExtents
simRunConsoleCommand
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!
simGetMeshPositionVertexBuffers
simGetCollisionInfo
simSetVehiclePose
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
simSetVehicleGeoPose
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
simSetGeoReference
simGetVehiclePose
simSetTraceLine
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
simSetObjectPose
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
simSetObjectGeoPose
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
simGetObjectScale
simSetObjectScale
simGetObjectDimensions
simGetObjectCenter
simListSceneObjects
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
simLoadLevel
simListAssets
simSpawnObject
Spawned selected object in the world
Desired name of new object
Name of asset(mesh) in the project database
Desired pose of object
Desired scale of object
Whether to enable physics for the object
Whether to spawn a blueprint or an actor
simSpawnObjectFromPath
Spawned selected object in the world
Desired name of new object
Name of asset(mesh) in the project database
Desired pose of object
Desired scale of object
Whether to enable physics for the object
Whether to spawn a blueprint or an actor
simSpawnObjectFromURL
Spawned selected object in the world
Desired name of new object
Name of asset(mesh) in the project database
Desired pose of object
Desired scale of object
Whether to enable physics for the object
Whether to spawn a blueprint or an actor
simDestroyObject
simSetSegmentationObjectID
Set segmentation ID for specific objects
simSetSegmentationInstanceID
Set segmentation ID for specific instances
simGetSegmentationObjectID
simAddDetectionFilterMeshName
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
Set detection radius for all cameras
Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used
Radius in [cm]
Vehicle which the camera is associated with
Whether the camera is an External Camera
simClearDetectionMeshNames
Clear all mesh names from detection filter
simGetDetections
Get current detections
simPrintLogMessage
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
Get details about the camera
simGetDistortionParams
Get camera distortion parameters
simSetDistortionParams
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
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
- Control the pose of a selected camera
simSetCameraFov
simCameraLookAt
- Control the pose of a selected camera
simGetGroundTruthKinematics
simSetKinematics
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
(KinematicsState): Desired Pose pf the vehicle
Whether to ignore any collision or not
Name of the vehicle to move
simGetGroundTruthEnvironment
getImuData
getBarometerData
getMagnetometerData
getGpsData
getDistanceSensorData
getLidarData
simGetLidarSegmentation
NOTE: Deprecated API, use getLidarData()
API instead
Returns Segmentation ID of each point’s collided object in the last Lidar update
simFlushPersistentMarkers
Clear any persistent markers - those plotted with setting is_persistent=True
in the APIs below
simPlotPoints
Plot a list of 3D points in World NED frame
desired RGBA values from 0.0 to 1.0
Size of plotted point
Duration (seconds) to plot for
If set to True, the desired object will be plotted for infinite time.
simPlotLineStrip
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
Thickness of line
Duration (seconds) to plot for
If set to True, the desired object will be plotted for infinite time.
simPlotLineList
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
Thickness of line
Duration (seconds) to plot for
If set to True, the desired object will be plotted for infinite time.
simPlotArrows
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
Thickness of line
Size of arrow head
Duration (seconds) to plot for
If set to True, the desired object will be plotted for infinite time.
simPlotStrings
Plots a list of strings at desired positions in World NED frame.
List of strings to plot
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
simPlotTransforms
Plots a list of transforms in World NED frame.
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.
simPlotTransformsWithNames
Plots a list of transforms with their names in World NED frame.
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
Start Recording
Recording will be done according to the settings
stopRecording
Stop Recording
isRecording
simSetWind
simCreateVoxelGrid
Construct and save a binvox-formatted voxel grid of environment
simBuildSDF
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.
simCheckOccupancy
simGetSignedDistance
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.
simGetSignedDistances
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.
simGetSDFGradient
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.
simCheckInVolume
simProjectToFreeSpace
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.
simSaveSDF
simLoadSDF
simGetRandomFreePoint
simPlanPathToRandomFreePoint
Plan a collision-free path to a random point within a radius around the vehicle and return the intermediate waypoints.
simPlanPathToRandomizeGoal
Plan a collision-free path from the current position to a random point within a radius around the goal and return the intermediate waypoints.
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
simPlanPath
Plan a collision-free path between start and goal points and return the intermediate waypoints.
getNavMeshInfo
isPointInCollision
isAnyPointInCollisionBatch
simAddVehicle
Create vehicle at runtime
listVehicles
getSettingsString
simCreateWaypoint
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.
simDeleteWaypoints
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.
simDeleteAllWaypoints
Deletes all waypoints and all waypoint-contexts
simGetWaypointDataAsCsv
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.
simGetWaypointDataAsJson
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.
simSetWaypointColor
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.
simResetWaypointColor
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.
Was this page helpful?