A good basic settings file that works with many of the examples can be found here as settings_example.json. It shows many of the custom sensors and vehicles that were added by Cosys-Lab.
Cosys-AirSim is searching for the settings definition in the following order. The first match will be used:
-
Looking at the (absolute) path specified by the
-settings
command line argument. For example, in Windows:AirSim.exe -settings="C:\path\to\settings.json"
In Linux./Blocks.sh -settings="/home/$USER/path/to/settings.json"
-
Looking for a json document passed as a command line argument by the
-settings
argument. For example, in Windows:AirSim.exe -settings={"foo":"bar"}
In Linux./Blocks.sh -settings={"foo":"bar"}
-
Looking in the folder of the executable for a file called
settings.json
. This will be a deep location where the actual executable of the Editor or binary is stored. For e.g. with the Blocks binary, the location searched is<path-of-binary>/LinuxNoEditor/Blocks/Binaries/Linux/settings.json
. -
Searching for
settings.json
in the folder from where the executable is launchedThis is a top-level directory containing the launch script or executable. For e.g. Linux:
<path-of-binary>/LinuxNoEditor/settings.json
, Windows:<path-of-binary>/WindowsNoEditor/settings.json
Note that this path changes depending on where its invoked from. On Linux, if executing the
Blocks.sh
script from inside LinuxNoEditor folder like./Blocks.sh
, then the previous mentioned path is used. However, if launched from outside LinuxNoEditor folder such as./LinuxNoEditor/Blocks.sh
, then<path-of-binary>/settings.json
will be used. -
Looking in the AirSim subfolder for a file called
settings.json
. The AirSim subfolder is located atDocuments\AirSim
on Windows and~/Documents/AirSim
on Linux systems.
The file is in usual json format. On first startup Cosys-AirSim would create settings.json
file with no settings at the users home folder. To avoid problems, always use ASCII format to save json file.
The default is to use multirotor. To use car simple set "SimMode": "Car"
like this:
{
"SettingsVersion": 2.0,
"SimMode": "Car"
}
To choose multirotor or skid vehicle, set "SimMode": "Multirotor"
or "SimMode": "SkidVehicle"
respectively. If you want to prompt user to select vehicle type then use "SimMode": ""
.
Below are complete list of settings available along with their default values. If any of the settings is missing from json file, then default value is used. Some default values are simply specified as ""
which means actual value may be chosen based on the vehicle you are using. For example, ViewMode
setting has default value ""
which translates to "FlyWithMe"
for drones and "SpringArmChase"
for cars.
Note this does not include most sensor types.
WARNING: Do not copy paste all of below in your settings.json. We strongly recommend adding only those settings that you don't want default values. Only required element is "SettingsVersion"
.
{
"SimMode": "",
"ClockType": "",
"ClockSpeed": 1,
"LocalHostIp": "127.0.0.1",
"ApiServerPort": 41451,
"RecordUIVisible": true,
"MoveWorldOrigin": false,
"InitialInstanceSegmentation": true,
"LogMessagesVisible": true,
"ShowLosDebugLines": false,
"ViewMode": "",
"RpcEnabled": true,
"EngineSound": true,
"PhysicsEngineName": "",
"SpeedUnitFactor": 1.0,
"SpeedUnitLabel": "m/s",
"Wind": { "X": 0, "Y": 0, "Z": 0 },
"CameraDirector": {
"FollowDistance": -3,
"X": NaN, "Y": NaN, "Z": NaN,
"Pitch": NaN, "Roll": NaN, "Yaw": NaN
},
"Recording": {
"RecordOnMove": false,
"RecordInterval": 0.05,
"Folder": "",
"Enabled": false,
"Cameras": [
{ "CameraName": "0", "ImageType": 0, "PixelsAsFloat": false, "VehicleName": "", "Compress": true }
]
},
"CameraDefaults": {
"CaptureSettings": [
{
"ImageType": 0,
"Width": 256,
"Height": 144,
"FOV_Degrees": 90,
"AutoExposureSpeed": 100,
"AutoExposureBias": 0,
"AutoExposureMaxBrightness": 0.64,
"AutoExposureMinBrightness": 0.03,
"MotionBlurAmount": 0,
"TargetGamma": 1.0,
"ProjectionMode": "",
"OrthoWidth": 5.12,
"MotionBlurAmount": 1,
"MotionBlurMax": 10,
"ChromaticAberrationScale": 2,
"IgnoreMarked": false,
"LumenGIEnable": true,
"LumenReflectionEnable": true,
"LumenFinalQuality": 1,
"LumenSceneDetail": 1,
"LumenSceneLightningDetail": 1
}
],
"NoiseSettings": [
{
"Enabled": false,
"ImageType": 0,
"RandContrib": 0.2,
"RandSpeed": 100000.0,
"RandSize": 500.0,
"RandDensity": 2,
"HorzWaveContrib":0.03,
"HorzWaveStrength": 0.08,
"HorzWaveVertSize": 1.0,
"HorzWaveScreenSize": 1.0,
"HorzNoiseLinesContrib": 1.0,
"HorzNoiseLinesDensityY": 0.01,
"HorzNoiseLinesDensityXY": 0.5,
"HorzDistortionContrib": 1.0,
"HorzDistortionStrength": 0.002,
"LensDistortionEnable": true,
"LensDistortionAreaFalloff": 2,
"LensDistortionAreaRadius": 1,
"LensDistortionInvert": false
}
],
"Gimbal": {
"Stabilization": 0,
"Pitch": NaN, "Roll": NaN, "Yaw": NaN
},
"X": NaN, "Y": NaN, "Z": NaN,
"Pitch": NaN, "Roll": NaN, "Yaw": NaN,
"UnrealEngine": {
"PixelFormatOverride": [
{
"ImageType": 0,
"PixelFormat": 0
}
]
}
},
"OriginGeopoint": {
"Latitude": 47.641468,
"Longitude": -122.140165,
"Altitude": 122
},
"TimeOfDay": {
"Enabled": false,
"StartDateTime": "",
"CelestialClockSpeed": 1,
"StartDateTimeDst": false,
"UpdateIntervalSecs": 60
},
"SubWindows": [
{"WindowID": 0, "CameraName": "0", "ImageType": 3, "VehicleName": "", "Visible": false},
{"WindowID": 1, "CameraName": "0", "ImageType": 5, "VehicleName": "", "Visible": false},
{"WindowID": 2, "CameraName": "0", "ImageType": 0, "VehicleName": "", "Visible": false}
],
"PawnPaths": {
"BareboneCar": {"PawnBP": "Class'/AirSim/VehicleAdv/Vehicle/VehicleAdvPawn.VehicleAdvPawn_C'"},
"DefaultCar": {"PawnBP": "Class'/AirSim/VehicleAdv/SUV/SuvCarPawn.SuvCarPawn_C'"},
"DefaultQuadrotor": {"PawnBP": "Class'/AirSim/Blueprints/BP_FlyingPawn.BP_FlyingPawn_C'"},
"DefaultComputerVision": {"PawnBP": "Class'/AirSim/Blueprints/BP_ComputerVisionPawn.BP_ComputerVisionPawn_C'"}
},
"Vehicles": {
"SimpleFlight": {
"VehicleType": "SimpleFlight",
"DefaultVehicleState": "Armed",
"AutoCreate": true,
"PawnPath": "",
"EnableCollisionPassthrough": false,
"EnableCollisions": true,
"AllowAPIAlways": true,
"EnableTrace": false,
"RC": {
"RemoteControlID": 0,
"AllowAPIWhenDisconnected": false
},
"Cameras": {
//same elements as CameraDefaults above, key as name
},
"X": NaN, "Y": NaN, "Z": NaN,
"Pitch": NaN, "Roll": NaN, "Yaw": NaN
},
"PhysXCar": {
"VehicleType": "PhysXCar",
"DefaultVehicleState": "",
"AutoCreate": true,
"PawnPath": "",
"EnableCollisionPassthrough": false,
"EnableCollisions": true,
"RC": {
"RemoteControlID": -1
},
"Cameras": {
"MyCamera1": {
//same elements as elements inside CameraDefaults above
},
"MyCamera2": {
//same elements as elements inside CameraDefaults above
},
},
"X": NaN, "Y": NaN, "Z": NaN,
"Pitch": NaN, "Roll": NaN, "Yaw": NaN
}
}
}
SimMode determines which simulation mode will be used. Below are currently supported values:
""
: prompt user to select vehicle type multirotor or car"Multirotor"
: Use multirotor simulation"Car"
: Use car simulation"ComputerVision"
: Use only camera, no vehicle or physics"SkidVehicle"
: use skid-steering vehicle simulation
The ViewMode determines which camera to use as default and how camera will follow the vehicle. For multirotors, the default ViewMode is "FlyWithMe"
while for cars the default ViewMode is "SpringArmChase"
.
FlyWithMe
: Chase the vehicle from behind with 6 degrees of freedomGroundObserver
: Chase the vehicle from 6' above the ground but with full freedom in XY plane.Fpv
: View the scene from front camera of vehicleManual
: Don't move camera automatically. Use arrow keys and ASWD keys for move camera manually.SpringArmChase
: Chase the vehicle with camera mounted on (invisible) arm that is attached to the vehicle via spring (so it has some latency in movement).NoDisplay
: This will freeze rendering for main screen however rendering for subwindows, recording and APIs remain active. This mode is useful to save resources in "headless" mode where you are only interested in getting images and don't care about what gets rendered on main screen. This may also improve FPS for recording images.
The annotation system allows you to choose different groundtruth labeling techniques to create more data from your simulation. Find more info here for defining the settings.
This setting controls the position of Sun in the environment. By default Enabled
is false which means Sun's position is left at whatever was the default in the environment and it doesn't change over the time. If Enabled
is true then Sun position is computed using longitude, latitude and altitude specified in OriginGeopoint
section for the date specified in StartDateTime
in the string format as %Y-%m-%d %H:%M:%S, for example, 2018-02-12 15:20:00
. If this string is empty then current date and time is used. If StartDateTimeDst
is true then we adjust for day light savings time. The Sun's position is then continuously updated at the interval specified in UpdateIntervalSecs
. In some cases, it might be desirable to have celestial clock run faster or slower than simulation clock. This can be specified using CelestialClockSpeed
, for example, 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.
Also see Time of Day API.
This setting specifies the latitude, longitude and altitude of the Player Start component placed in the Unreal environment. The vehicle's home point is computed using this transformation. Note that all coordinates exposed via APIs are using NED system in SI units which means each vehicle starts at (0, 0, 0) in NED system. Time of Day settings are computed for geographical coordinates specified in OriginGeopoint
.
This setting determines what is shown in each of 3 subwindows which are visible when you press 1,2,3 keys.
WindowID
: Can be 0 to 2CameraName
: is any available camera on the vehicleImageType
: integer value determines what kind of image gets shown according to ImageType enum.VehicleName
: string allows you to specify the vehicle to use the camera from, used when multiple vehicles are specified in the settings. First vehicle's camera will be used if there are any mistakes such as incorrect vehicle name, or only a single vehicle.Annotation
: string allows you to specify the annotation layer to use for the camera. This is only if using the Annotation camera type forImageType
(value is 10).
For example, for a single car vehicle, below shows driver view, front bumper view and rear view as scene, depth and surface normals respectively.
"SubWindows": [
{"WindowID": 0, "ImageType": 0, "CameraName": "3", "Visible": true},
{"WindowID": 1, "ImageType": 3, "CameraName": "0", "Visible": true},
{"WindowID": 2, "ImageType": 6, "CameraName": "4", "Visible": true}
]
In case of multiple vehicles, different vehicles can be specified as follows-
"SubWindows": [
{"WindowID": 0, "CameraName": "0", "ImageType": 3, "VehicleName": "Car1", "Visible": false},
{"WindowID": 1, "CameraName": "0", "ImageType": 5, "VehicleName": "Car2", "Visible": false},
{"WindowID": 2, "CameraName": "0", "ImageType": 0, "VehicleName": "Car1", "Visible": false}
]
The recording feature allows you to record data such as position, orientation, velocity along with the captured image at specified intervals. You can start recording by pressing red Record button on lower right or the R key. The data is stored in the Documents\AirSim
folder (or the folder specified using Folder
), in a time stamped subfolder for each recording session, as tab separated file.
RecordInterval
: specifies minimal interval in seconds between capturing two images.RecordOnMove
: specifies that do not record frame if there was vehicle's position or orientation hasn't changed.Folder
: Parent folder where timestamped subfolder with recordings are created. Absolute path of the directory must be specified. If not used, thenDocuments/AirSim
folder will be used. E.g."Folder": "/home/<user>/Documents"
Enabled
: Whether Recording should start from the beginning itself, setting totrue
will start recording automatically when the simulation starts. By default, it's set tofalse
Cameras
: this element controls which cameras are used to capture images. By default scene image from camera 0 is recorded as compressed png format. This setting is json array so you can specify multiple cameras to capture images, each with potentially different image types.- When
PixelsAsFloat
is true, image is saved as pfm file instead of png file. VehicleName
option allows you to specify separate cameras for individual vehicles. If theCameras
element isn't present,Scene
image from the default camera of each vehicle will be recorded.- If you don't want to record any images and just the vehicle's physics data, then specify the
Cameras
element but leave it empty, like this:"Cameras": []
- add the field
Annotation
, a string allowing you to specify the annotation layer to use for the camera. This is only if using the Annotation camera type forImageType
. For example, theCameras
element below records scene & segmentation images forCar1
& scene forCar2
-
- When
"Cameras": [
{ "CameraName": "0", "ImageType": 0, "PixelsAsFloat": false, "VehicleName": "Car1", "Compress": true },
{ "CameraName": "0", "ImageType": 5, "PixelsAsFloat": false, "VehicleName": "Car1", "Compress": true },
{ "CameraName": "0", "ImageType": 0, "PixelsAsFloat": false, "VehicleName": "Car2", "Compress": true }
]
Check out Modifying Recording Data for details on how to modify the kinematics data being recorded.
This setting allows you to set the speed of simulation clock with respect to wall clock. For example, value of 5.0 would mean simulation clock has 5 seconds elapsed when wall clock has 1 second elapsed (i.e. simulation is running faster). The value of 0.1 means that simulation clock is 10X slower than wall clock. The value of 1 means simulation is running in real time. It is important to realize that quality of simulation may decrease as the simulation clock runs faster. You might see artifacts like object moving past obstacles because collision is not detected. However slowing down simulation clock (i.e. values < 1.0) generally improves the quality of simulation.
This setting specifies the wind speed in World frame, in NED direction. Values are in m/s. By default, speed is 0, i.e. no wind.
This element specifies the settings used for the camera following the vehicle in the ViewPort.
FollowDistance
: Distance at which camera follows the vehicle, default is -8 (8 meters) for Car, -3 for others.X, Y, Z, Yaw, Roll, Pitch
: These elements allows you to specify the position and orientation of the camera relative to the vehicle. Position is in NED coordinates in SI units with origin set to Player Start location in Unreal environment. The orientation is specified in degrees.
The CameraDefaults
element at root level specifies defaults used for all cameras. These defaults can be overridden for individual camera in Cameras
element inside Vehicles
as described later.
Like other sensors the pose of the sensor in the vehicle frame can be defined by X, Y, Z, Roll, Pitch, Yaw parameters. Furthermore there are some other settings available:
DrawSensor
: Draw the physical sensor in the world on the vehicle with a 3D axes shown where the sensor is.External
: Uncouple the sensor from the vehicle. If enabled, the position and orientation will be relative to Unreal world coordinates. Note that ifMoveWorldOrigin
in the settings.json is set totrue
the Unreal coordinates will be moved to be the same origin as the player start location and as such this may effect where the sensor will spawn.ExternalLocal
: When in external mode, if this is enabled the retrieved pose of the sensor will be in Local NED coordinates(from starting position from vehicle) and not converted Unreal NED coordinates which is default. Note that ifMoveWorldOrigin
in the settings.json is set totrue
the Unreal coordinates will be moved to be the same origin as the player start location and as such this may effect what coordinates are returned if set tofalse
.
The ImageType
element in JSON array determines which image type that settings applies to. The valid values are described in ImageType section.
For example, CaptureSettings
element is json array so you can add settings for multiple image types easily.
The CaptureSettings
determines how different image types such as scene, depth, disparity, surface normals and segmentation views are rendered. The Width, Height and FOV settings should be self explanatory. The AutoExposureSpeed decides how fast eye adaptation works. We set to generally high value such as 100 to avoid artifacts in image capture. Similarly we set MotionBlurAmount to 0 by default to avoid artifacts in ground truth images. The ProjectionMode
decides the projection used by the capture camera and can take value "perspective" (default) or "orthographic". If projection mode is "orthographic" then OrthoWidth
determines width of projected area captured in meters.
To disable the rendering of certain objects on specific cameras or all, use the IgnoreMarked
boolean setting. This requires to mark individual objects that have to be ignore using an Unreal Tag called MarkedIgnore. You can also tweak the motion blur and chromatic Aberration here.
Unreal 5 introduces Lumen lightning. Due to the cameras using scene capture components enabling Lumen for them can be costly on performance. Settings have been added specfically for the scene camera to customize the usage of Lumen for Global Illumination and Reflections.
The LumenGIEnable
and LumenReflectionEnable
settings enable or disable Lumen for the camera. The LumenFinalQuality
(0.25-2) setting determines the quality of the final image. The LumenSceneDetail
(0.25-4) setting determines the quality of the scene. The LumenSceneLightningDetail
(0.25-2) setting determines the quality of the lightning in the scene.
For explanation of other settings, please see this article.
The NoiseSettings
allows to add noise to the specified image type with a goal of simulating camera sensor noise, interference and other artifacts. By default no noise is added, i.e., Enabled: false
. If you set Enabled: true
then following different types of noise and interference artifacts are enabled, each can be further tuned using setting. The noise effects are implemented as shader created as post processing material in Unreal Engine called CameraSensorNoise.
Demo of camera noise and interference simulation:
This adds random noise blobs with following parameters.
RandContrib
: This determines blend ratio of noise pixel with image pixel, 0 means no noise and 1 means only noise.RandSpeed
: This determines how fast noise fluctuates, 1 means no fluctuation and higher values like 1E6 means full fluctuation.RandSize
: This determines how coarse noise is, 1 means every pixel has its own noise while higher value means more than 1 pixels share same noise value.RandDensity
: This determines how many pixels out of total will have noise, 1 means all pixels while higher value means lesser number of pixels (exponentially).
This adds horizontal bumps / flickering / ghosting effect.
HorzWaveContrib
: This determines blend ratio of noise pixel with image pixel, 0 means no noise and 1 means only noise.HorzWaveStrength
: This determines overall strength of the effect.HorzWaveVertSize
: This determines how many vertical pixels would be effected by the effect.HorzWaveScreenSize
: This determines how much of the screen is effected by the effect.
This adds regions of noise on horizontal lines.
HorzNoiseLinesContrib
: This determines blend ratio of noise pixel with image pixel, 0 means no noise and 1 means only noise.HorzNoiseLinesDensityY
: This determines how many pixels in horizontal line gets affected.HorzNoiseLinesDensityXY
: This determines how many lines on screen gets affected.
This adds fluctuations on horizontal line.
HorzDistortionContrib
: This determines blend ratio of noise pixel with image pixel, 0 means no noise and 1 means only noise.HorzDistortionStrength
: This determines how large is the distortion.
This adds radial lens distortion to the camera sensor.
LensDistortionEnable
: Enable or disable this featureLensDistortionAreaFalloff
: The size of the area to distortLensDistortionAreaRadius
: The distortion radiusLensDistortionInvert
: Set to true to invert and create 'pincushion distortion' or false for 'barrel distortion'
The Gimbal
element allows to freeze camera orientation for pitch, roll and/or yaw. This setting is ignored unless ImageType
is -1. The Stabilization
is defaulted to 0 meaning no gimbal i.e. camera orientation changes with body orientation on all axis. The value of 1 means full stabilization. The value between 0 to 1 acts as a weight for fixed angles specified (in degrees, in world-frame) in Pitch
, Roll
and Yaw
elements and orientation of the vehicle body. When any of the angles is omitted from json or set to NaN, that angle is not stabilized (i.e. it moves along with vehicle body).
This element contains settings specific to the Unreal Engine. These will be ignored in the Unity project.
PixelFormatOverride
: This contains a list of elements that have both aImageType
andPixelFormat
setting. Each element allows you to override the default pixel format of the UTextureRenderTarget2D object instantiated for the capture specified by theImageType
setting. Specifying this element allows you to prevent crashes caused by unexpected pixel formats (see #4120 and #4339 for examples of these crashes). A full list of pixel formats can be viewed here.
Each simulation mode will go through the list of vehicles specified in this setting and create the ones that has "AutoCreate": true
. Each vehicle specified in this setting has key which becomes the name of the vehicle. If "Vehicles"
element is missing then this list is populated with default car named "PhysXCar" and default multirotor named "SimpleFlight".
VehicleType
: This could be eitherPhysXCar
,ArduRover
orBoxCar
for the Car SimMode,SimpleFlight
,ArduCopter
orPX4Multirotor
for the MultiRotor SimMode,ComputerVision
for the ComputerVision SimMode andCPHusky
orPioneer
for SkidVehicle SimMode. you can use There is no default value therefore this element must be specified.PawnPath
: This allows to override the pawn blueprint to use for the vehicle. For example, you may create new pawn blueprint derived from ACarPawn for a warehouse robot in your own project outside the Cosys-AirSim code and then specify its path here. See also PawnPaths. Note that you have to specify your custom pawn blueprint class path inside the globalPawnPaths
object using your proprietarily defined object name, and quote that name inside theVehicles
setting. For example,
{
...
"PawnPaths": {
"CustomPawn": {"PawnBP": "Class'/Game/Assets/Blueprints/MyPawn.MyPawn_C'"}
},
"Vehicles": {
"MyVehicle": {
"VehicleType": ...,
"PawnPath": "CustomPawn",
...
}
}
}
DefaultVehicleState
: Possible value for multirotors isArmed
orDisarmed
.AutoCreate
: If true then this vehicle would be spawned (if supported by selected sim mode).RC
: This sub-element allows to specify which remote controller to use for vehicle usingRemoteControlID
. The value of -1 means use keyboard (not supported yet for multirotors). The value >= 0 specifies one of many remote controllers connected to the system. The list of available RCs can be seen in Game Controllers panel in Windows, for example.X, Y, Z, Yaw, Roll, Pitch
: These elements allows you to specify the initial position and orientation of the vehicle. Position is in NED coordinates in SI units with origin set to Player Start location in Unreal environment. The orientation is specified in degrees.Sensors
: This element specifies the sensors associated with the vehicle, see Sensors page for details.IsFpvVehicle
: This setting allows to specify which vehicle camera will follow and the view that will be shown when ViewMode is set to Fpv. By default, Cosys-AirSim selects the first vehicle in settings as FPV vehicle.Cameras
: This element specifies camera settings for vehicle. The key in this element is name of the available camera and the value is same asCameraDefaults
as described above. For example, to change FOV for the front center camera to 120 degrees, you can use this forVehicles
setting:
"Vehicles": {
"FishEyeDrone": {
"VehicleType": "SimpleFlight",
"Cameras": {
"front-center": {
"CaptureSettings": [
{
"ImageType": 0,
"FOV_Degrees": 120
}
]
}
}
}
}
By default we use simple_flight so you don't have to do separate HITL or SITL setups. We also support "PX4" for advanced users. To use PX4 with Cosys-AirSim, you can use the following for Vehicles
setting:
"Vehicles": {
"PX4": {
"VehicleType": "PX4Multirotor",
}
}
The defaults for PX4 is to enable hardware-in-loop setup. There are various other settings available for PX4 as follows with their default values:
"Vehicles": {
"PX4": {
"VehicleType": "PX4Multirotor",
"Lockstep": true,
"ControlIp": "127.0.0.1",
"ControlPortLocal": 14540,
"ControlPortRemote": 14580,
"LogViewerHostIp": "127.0.0.1",
"LogViewerPort": 14388,
"OffboardCompID": 1,
"OffboardSysID": 134,
"QgcHostIp": "127.0.0.1",
"QgcPort": 14550,
"SerialBaudRate": 115200,
"SerialPort": "*",
"SimCompID": 42,
"SimSysID": 142,
"TcpPort": 4560,
"UdpIp": "127.0.0.1",
"UdpPort": 14560,
"UseSerial": true,
"UseTcp": false,
"VehicleCompID": 1,
"VehicleSysID": 135,
"Model": "Generic",
"LocalHostIp": "127.0.0.1",
"Logs": "d:\\temp\\mavlink",
"Sensors": {
...
}
"Parameters": {
...
}
}
}
These settings define the MavLink SystemId and ComponentId for the Simulator (SimSysID, SimCompID), and for the vehicle (VehicleSysID, VehicleCompID) and the node that allows remote control of the drone from another app this is called the offboard node (OffboardSysID, OffboardCompID).
If you want the simulator to also forward mavlink messages to your ground control app (like QGroundControl) you can also set the UDP address for that in case you want to run that on a different machine (QgcHostIp, QgcPort). The default is local host so QGroundControl should "just work" if it is running on the same machine.
You can connect the simulator to the LogViewer app, provided in this repo, by setting the UDP address for that (LogViewerHostIp, LogViewerPort).
And for each flying drone added to the simulator there is a named block of additional settings. In the above you see the default name "PX4". You can change this name from the Unreal Editor when you add a new BP_FlyingPawn asset. You will see these properties grouped under the category "MavLink". The MavLink node for this pawn can be remote over UDP or it can be connected to a local serial port. If serial then set UseSerial to true, otherwise set UseSerial to false. For serial connections you also need to set the appropriate SerialBaudRate. The default of 115200 works with Pixhawk version 2 over USB.
When communicating with the PX4 drone over serial port both the HIL_* messages and vehicle control
messages share the same serial port. When communicating over UDP or TCP PX4 requires two separate
channels. If UseTcp is false, then UdpIp, UdpPort are used to send HIL_* messages, otherwise the
TcpPort is used. TCP support in PX4 was added in 1.9.2 with the lockstep
feature because the
guarantee of message delivery that TCP provides is required for the proper functioning of lockstep.
Cosys-AirSim becomes a TCP server in that case, and waits for a connection from the PX4 app. The second
channel for controlling the vehicle is defined by (ControlIp, ControlPort) and is always a UDP
channel.
The Sensors
section can provide customized settings for simulated sensors, see
Sensors. The Parameters
section can set PX4 parameters during initialization of the
PX4 connection. See Setting up PX4 Software-in-Loop for an example.
ArduPilot Copter & Rover vehicles are supported in latest Cosys-AirSim main branch & releases v1.3.0
and later. For settings and how to use, please see ArduPilot SITL with Cosys-AirSim
To turn off the engine sound use setting "EngineSound": false
. Currently this setting applies only to car.
This allows you to specify your own vehicle pawn blueprints, for example, you can replace the default car in AirSim with your own car. Your vehicle BP can reside in Content folder of your own Unreal project (i.e. outside of AirSim plugin folder). For example, if you have a car BP located in file Content\MyCar\MySedanBP.uasset
in your project then you can set "DefaultCar": {"PawnBP":"Class'/Game/MyCar/MySedanBP.MySedanBP_C'"}
. The XYZ.XYZ_C
is a special notation required to specify class for BP XYZ
. Please note that your BP must be derived from CarPawn class. By default this is not the case but you can re-parent the BP using the "Class Settings" button in toolbar in UE editor after you open the BP and then choosing "Car Pawn" for Parent Class settings in Class Options. It is also a good idea to disable "Auto Possess Player" and "Auto Possess AI" as well as set AI Controller Class to None in BP details. Please make sure your asset is included for cooking in packaging options if you are creating binary.
For cars, we support only PhysX for now (regardless of value in this setting). For multirotors, we support "FastPhysicsEngine"
and "ExternalPhysicsEngine"
. "ExternalPhysicsEngine"
allows the drone to be controlled via setVehiclePose (), keeping the drone in place until the next call. It is especially useful for moving the AirSim drone using an external simulator or on a saved path.
Now when connecting to remote machines you may need to pick a specific Ethernet adapter to reach those machines, for example, it might be over Ethernet or over Wi-Fi, or some other special virtual adapter or a VPN. Your PC may have multiple networks, and those networks might not be allowed to talk to each other, in which case the UDP messages from one network will not get through to the others.
So the LocalHostIp allows you to configure how you are reaching those machines. The default of 127.0.0.1 is not able to reach external machines, this default is only used when everything you are talking to is contained on a single PC.
This setting determines the server port that used by airsim clients, default port is 41451. By specifying different ports, the user can run multiple environments in parallel to accelerate data collection process.
Unit conversion factor for speed related to m/s
, default is 1. Used in conjunction with SpeedUnitLabel. This may be only used for display purposes for example on-display speed when car is being driven. For example, to get speed in miles/hr
use factor 2.23694.
Unit label for speed, default is m/s
. Used in conjunction with SpeedUnitFactor.