Sensor Configuration
Sensors are defined in the sensors
array of an agent object. Each sensor is defined using a new
dictionary in the list.
"sensors":[
{
"sensor_name": "FrontCamera",
"sensor_type": "RGBCamera",
"socket": "socket name",
"location": [1.0, 2.0, 3.0],
"rotation": [1.0, 2.0, 3.0],
"Hz": 5,
"lcm_channel": "channel_name",
"ros_publish": "False",
"configuration": {
"array of sensor configurations"
}
}
]
Sensor Placement
Sensor placement can be defined in several ways:
Provide a socket name
This will place the sensor in the given socket.
{ "sensor_type": "RGBCamera", "socket": "CameraSocket" }
Provide a socket, location and/or rotation
The sensor will be placed offset to the socket by the location and rotation. The rotation is
[roll, pitch, yaw]
in degrees, rotated about XYZ fixed axes, ie R_z R_y R_x.{ "sensor_type": "RGBCamera", "socket": "CameraSocket" "location": [1.0, 2.0, 3.0], "rotation": [1.0, 2.0, 3.0], }
Provide just a location and/or rotation
The sensor will be placed at the given coordinates, offset from the root of the agent.
{ "sensor_type": "RGBCamera", "location": [1.0, 2.0, 3.0], "rotation": [1.0, 2.0, 3.0] }
Sensor Sample Rate
The sensor will be sampled at the rate specified in Hz
. Note this must be less then ticks_per_sec
, and
preferably a divisor of ticks_per_sec
as well. See Frame Rates for more info
on ticks_per_sec
.
{
"sensor_type": "RGBCamera",
"Hz": 20
}
Publish Message
HoloOcean supports publishing sensor messages and data to LCM. A HoloOcean-ROS2 Bridge package is also available.
To publish sensor data to LCM, specify the type to publish and the channel to publish to:
{
"sensor_type": "RGBCamera",
"lcm_channel": "CAMERA"
}
To publish sensor data to ROS2, set ros_publish
to True
:
{
"sensor_type": "RGBCamera",
"ros_publish": "True"
}
See Publishing Data Using ROS2 Bridge for more information on the ROS2 Bridge.
Configuration Block
The contents of the configuration
block are sensor-specific. The configuration block is
passed verbatim to the sensor itself, which parses it.
For example, the docstring for RGBCamera
states that
it accepts CaptureWidth
and CaptureHeight
parameters, so an example
sensor configuration would be:
"sensors": [
{
"sensor_name": "RBGCamera",
"sensor_type": "RGBCamera",
"socket": "CameraSocket",
"configuration": {
"CaptureHeight": 1920,
"CaptureWidth": 1080
}
}
]