Scene Configuration Settings¶
The scene config JSONC file specifies the settings for the scene’s actors, clock, and other scene-level settings.
The scene is loaded from the JSONC file that is specified when the World
object is initialized in the client script. The client can also reload a specified scene config file through an API call while the simulation is running.
Main scene configuration¶
scene_basic_drone.jsonc
{
"id": "SceneBasicDrone",
"actors": [...],
"environment-actors": [...],
"environment-objects": [...],
"clock": {...},
"home-geo-point": {...},
"segmentation": {...},
"scene-type": "UnrealNative"
}
Parameter |
Value |
Description |
---|---|---|
|
string |
Name identifier for the scene (simulation world). |
|
array of Actor settings |
Actor settings for each actor to spawn in the scene. |
|
array of Environment actor settings |
Environment actor settings for each actor to spawn in the scene. |
|
array of Environment object settings |
Environment object settings for each object to spawn in the scene. |
|
Simulation clock settings. |
|
|
GeoPoint coordinates (latitude, longitude, altitude) corresponding to the scene origin. |
|
|
Segmentation ID settings for automatically assigning segmentation IDs to objects in the scene. |
|
|
string |
(Optional) Use ‘CustomGIS’ if you are running a geospecific GIS scenario. Defaults to ‘UnrealNative’ for non-GIS scenes. |
|
string |
(Optional) Local path containing the GIS tiles used when |
|
float |
(Optional) Our tiles have altitude values of WGS84 ellipsoidal height. Sometimes other altitude models are preferred, so you can use this setting to offset the tiles by the provided value in meters. Most GIS software use a geoid relative altitude, so you can query the geoid height at some coord and enter it here: https://geographiclib.sourceforge.io/cgi-bin/GeoidEval |
|
integer |
(Optional) Maximum level of detail for tiles. Default is 19. Maximum allowed is 23. |
|
integer |
(Optional) Minimum level of detail for tiles. Default is 13. Minimum allowed is 13. |
Actor settings¶
"actors": [
{
"type": "robot",
"name": "Drone1",
"origin": {
"xyz": "109.05 -7.5 -19.42", // or "geo-point": "33.047329 -97.292618 4.5"
"rpy-deg": "0 0 0"
},
"robot-config": "robot_quadrotor_fastphysics.jsonc",
"start-landed": true
},
...
]
Parameter |
Value |
Description |
---|---|---|
|
|
Type of actor, currently only |
|
string |
Name identifier for the actor. |
|
string of 3 floats |
Spawning origin position “X Y Z” coordinates with units of SI meters in the NED frame (up = negative z). Note: “0 0 0” is at the global UE origin, not relative to |
|
string of 3 floats |
Alternative to |
|
string of 3 floats |
Spawning origin orientation “Roll Pitch Yaw” angles with units of SI radians with right-hand rotation around the NED frame X Y Z axes. |
|
string |
Filename for JSONC config file for this actor’s Robot Configuration Settings. |
|
bool |
(Optional) Start from a manually-set landed state at the spawned origin (without needing to drop onto a mesh with collision). For FastPhysics, a landed state means that the position is locked until a net vertical force up exceeds the weight of the body (to counter gravity forces) such as from rotors during takeoff, or there is already an upward velocity. Defaults to false if omitted. |
Environment actor settings¶
"environment-actors": [
{
"type": "env_car",
"name": "car1",
"origin": {
"xyz": "3.0 0.0 -5.0",
"rpy-deg": "0 0 0"
},
"env-actor-config": "env_actor_car.jsonc"
},
...
]
Parameter |
Value |
Description |
---|---|---|
|
|
Types of environment actors: |
|
string |
Name identifier for the actor. |
|
string of 3 floats |
Spawning origin position “X Y Z” coordinates with units of SI meters in the NED frame (up = negative z). Note: “0 0 0” is at the global UE origin, not relative to |
|
string of 3 floats |
Alternative to |
|
string of 3 floats |
Spawning origin orientation “Roll Pitch Yaw” angles with units of SI radians with right-hand rotation around the NED frame X Y Z axes. |
|
string |
Filename for JSONC config file for this actor’s Environment Actor Configuration Settings. |
Environment object settings¶
"environment-objects": [
{
"type": "env_particle_effect",
"name": "fire1",
"origin": {
"xyz": "3.0 0.0 -5.0",
"rpy-deg": "0 0 0"
},
"env-object-config": "env_particle_effect_nfire_02.jsonc"
},
...
]
Parameter |
Value |
Description |
---|---|---|
|
|
Types of environment objects: |
|
string |
Name identifier for the environment object. |
|
string of 3 floats |
Spawning origin position “X Y Z” coordinates with units of SI meters in the NED frame (up = negative z). Note: “0 0 0” is at the global UE origin, not relative to |
|
string of 3 floats |
Alternative to |
|
string of 3 floats |
Spawning origin orientation “Roll Pitch Yaw” angles with units of SI radians with right-hand rotation around the NED frame X Y Z axes. |
|
string |
Filename for JSONC config file for this object’s Environment Object Configuration Settings. |
Clock settings¶
"clock": {
"type": "steppable",
"step-ns": 3000000,
"real-time-update-rate": 3000000,
"pause-on-start": false
}
Parameter |
Value |
Description |
---|---|---|
|
|
Type of simulation clock. Defaults to |
|
integer |
Step size in nanosec for |
|
integer |
Real-time execution period in nanosec between each simulation loop and clock update for all clock types. Defaults to 3000000 (3 ms) if omitted. |
|
bool |
Flag to start with simulation paused for |
There are 2 supported simulation clock types:
Steppable clock
Real-time clock
See below for example of how to configure each type of simulation clock.
Steppable clock¶
"clock": {
"type": "steppable",
"step-ns": 3000000,
"real-time-update-rate": 3000000,
"pause-on-start": false
}
Steppable clock is a fixed-step clock with sim time step = step-ns
nanosecs that is stepped every execution period set by real-time-update-rate
real-time nanosecs.
For example, with step-ns
= 3 ms and real-time-update-rate
= 3 ms, the sim clock will advance by exactly 3 ms every execution period, which is also every ~3 ms so the simulation will appear to move at ~1x real-time but with deterministic fixed time steps.
With step-ns
= 6 ms and real-time-update-rate
= 3 ms, the sim clock will advance by exactly 6 ms every execution period, which is still 3 ms so the simulation will appear to move at ~2x faster than real-time.
The pause-on-start
option allows the simulation to start paused to allow full-manual control of the time step advancement through the clock APIs.
Real-time clock¶
"clock": {
"type": "real-time",
"real-time-update-rate": 3000000
}
Real-time clock is a variable-step clock with sim time step = real-time step between each execution period set by real-time-update-rate
real-time nanosecs. Since the real-time step between each execution period varies slightly by the system clock, the sim time step will also have variations.
Note: Since real-time
clock follows real-time advancement, it can not be paused and is not deterministic or repeatable. In order to do the simulation at a scaled multiple of real-time, use a steppable clock with the desired ratio set between step-ns
and real-time-update-rate
as described in the Steppable clock section.
Home GeoPoint settings¶
"home-geo-point": {
"latitude": 47.641468,
"longitude": -122.140165,
"altitude": 122.0
}
Parameter |
Value |
Description |
---|---|---|
|
float |
Latitude coordinate of the scene origin. |
|
float |
Longitude coordinate of the scene origin. |
|
float |
Altitude value of the scene origin in SI meters (positive values are higher, not NED). |
The home GeoPoint is used to correlate the simulation scene origin to a position on Earth to use as a reference point for GPS sensor values and for physics calculations such as air temperature, pressure, etc.
The default value is set for the Microsoft Building 99 parking garage in Redmond, WA, but a new desired location’s latitude/longitude values can be easily looked up by right-clicking anywhere on Bing maps.
Segmentation settings¶
"segmentation": {
"initialize-ids": true,
"ignore-existing": false,
"use-owner-name": true
}
Parameter |
Value |
Description |
---|---|---|
|
bool |
Flag to initialize the segmentation ID for the scene objects at simulation start. Defaults to |
|
bool |
Flag to ignore any existing segmentation IDs already set and initialize them for everything. Defaults to |
|
bool |
Flag to use each mesh component’s owner’s name (usually the actor name) instead of the mesh component’s name for hashing the segmentation ID. Defaults to |
The segmentation IDs can be set on scene objects of class UStaticMeshComponent
, USkinnedMeshComponent
, and ALandscapeProxy
, including any derived classes (instanced static meshes, etc). The IDs are set using Unreal’s CustomDepth Stencil parameter so that the object can be rendered with all pixels set to the RGB color that is mapped to the segmentation pallet based on its segmentation ID.
The segmentation ID (CustomDepth Stencil value) can be set manually on objects using the Unreal Editor, or using the client’s world API SetSegmentationIDByName
. To get the existing segmentation ID of an object, you can use the client’s world API GetSegmentationIDByName
.
To have the segmentation IDs automatically assigned at the start of simulation, set initialize-ids
to true
. If ignore-existing
is set false
, then any object that has already been manually assigned an ID (the CustomDepth Stencil rendering is already enabled on the object) will keep its original value. Otherwise, all objects will get reassigned segmentation IDs that are calculated by a hash method based on the sum of the chars in the name (lowercased and ignoring number/symbol chars) and then modulo 256 to get an ID in the allowed range of 0~255. If use-owner-name
is true
, the name used for this hash will be the mesh object’s owner’s name (ex. the StaticMeshActor’s name that contains the StaticMeshComponent that will be assigned the ID). Using the owner’s name may provide better grouping of the IDs and uses the names that are readable in the Editor’s object tree.
To find out what object names were assigned what segmentation ID, check the simulation server log’s output for InitSegmentationID
lines, such as:
[2020.08.13-15.20.45:719] [InitSegmentationID] seg_id: 95, seg_name: 'cylinder8'
[2020.08.13-15.20.45:720] [InitSegmentationID] seg_id: 95, seg_name: 'cylinder_2'
[2020.08.13-15.20.45:720] [InitSegmentationID] seg_id: 148, seg_name: 'ground'
[2020.08.13-15.20.45:720] [InitSegmentationID] seg_id: 0, seg_name: 'templatecube_48'
[2020.08.13-15.20.45:720] [InitSegmentationID] seg_id: 241, seg_name: 'templatecube_rounded_1'
...
Copyright (C) Microsoft Corporation. All rights reserved.