Skip to main content

Sensor Functions

1. Sensor capabilities​

1.1. Overall framework​

1.2. Parameter configuration and queries​

1.2.1. Service overview​
ServiceDescriptionservice_typeConfiguration notesDetails
/set_camera_optionDynamically set camera options (gain/exposure/brightness/white_balance, etc.). Send the complete camera_options.json; route by sensor_id to the sensor plugin's ApplySensorOptionFromJson()rcl_interfaces/srv/SetParametersSetParameters request; the first parameter's string_value carries the full JSONJSON / Schema
/sensor/sensor_vla_camera/sensor_versionQuery versions of all registered sensors, including firmware and device modelsrobby_sensor_msgs/srv/GetSensorVersionsService name is formed dynamically from module_name; each RobbySensorCenter process has a unique service nameJSON / Schema

1.3. Service​

1.3.1. Communication JSON: set_camera_option​
{
"channels": {
"set_camera_option_rpc": {
"type": "hybrid_rpc",
"hybrid_rpc": {
"service_prefix": "/",
"enable_shm": false,
"enable_ros2": true,
"auto_route": false,
"default_timeout_ms": 2000
},
"ros2": {
"service_prefix": "/",
"service_type": "rcl_interfaces/srv/SetParameters"
}
}
}
}

Invocation method: set_camera_option. Concatenate service_prefix and method for the full service name. This is an RFrame client integration template; Sensor Center registers the server using native ROS2. The 2000 ms client timeout is an example, not a server guarantee.

Service name: The code registers the relative name set_camera_option, which resolves to /set_camera_option in the default root namespace. Adjust it for ROS namespaces or remapping. The node's standard parameter service /SensorCenterNode0x54/set_parameters does not replace this application callback.

1.3.1.1. Type Schema​

Type: rcl_interfaces/srv/SetParameters

Source: rcl_interfaces

# A list of parameters to set.
Parameter[] parameters

---
# Indicates whether setting each parameter succeeded or not and why.
SetParametersResult[] results
1.3.1.2. Type Schema​

Type: rcl_interfaces/msg/Parameter

Source: rcl_interfaces

# This is the message to communicate a parameter. It is an open struct with an enum in
# the descriptor to select which value is active.

# The full name of the parameter.
string name

# The parameter's value which can be one of several types, see
# `ParameterValue.msg` and `ParameterType.msg`.
ParameterValue value
uint8 type
bool bool_value
int64 integer_value
float64 double_value
string string_value
byte[] byte_array_value
bool[] bool_array_value
int64[] integer_array_value
float64[] double_array_value
string[] string_array_value
1.3.1.3. Type Schema​

Type: rcl_interfaces/msg/SetParametersResult

Source: rcl_interfaces

# A true value of the same index indicates that the parameter was set
# successfully. A false value indicates the change was rejected.
bool successful

# Reason why the setting was either successful or a failure. This should only be
# used for logging and user interfaces.
string reason

Request JSON structure (string_value payload):

{
"camera_set_option": [
{
"sensor_id": "0x1",
"color": {
"gain": 0,
"brightness": 0,
"exposure": 156,
"white_balance": 3800,
"gamma": 150,
"auto_exposure": false,
"auto_white_balance": false
},
"depth": {
"gain": 20,
"exposure": 4500,
"auto_exposure": false,
"laser_contrl_bool": true
},
"ir": {
"gain": 20,
"exposure": 4500,
"brightness": 0,
"auto_exposure": false
}
}
]
}

Invocation example

# Set sensor_id=0x1 Color stream exposure to 156 and disable auto-exposure
ros2 service call /set_camera_option rcl_interfaces/srv/SetParameters \
"{parameters: [{name: 'camera_option', value: {type: 4, string_value: '{\"camera_set_option\": [{\"sensor_id\": \"0x1\", \"color\": {\"exposure\": 156, \"auto_exposure\": false}}]}'}}]}"

Semantics: The request is standard SetParameters; the first parameter's string_value contains the complete camera_options.json. The callback parses the camera_set_option array and routes by sensor_id to the sensor plugin's ApplySensorOptionFromJson(). Fields in color / depth / ir sections can be set independently; send only those being changed.

1.3.2. Communication JSON: sensor_version​
{
"channels": {
"sensor_version_rpc": {
"type": "hybrid_rpc",
"hybrid_rpc": {
"service_prefix": "/sensor/sensor_vla_camera/",
"enable_shm": false,
"enable_ros2": true,
"auto_route": false,
"default_timeout_ms": 2000
},
"ros2": {
"service_prefix": "/sensor/sensor_vla_camera/",
"service_type": "robby_sensor_msgs/srv/GetSensorVersions"
}
}
}
}

Invocation method: sensor_version. Concatenate service_prefix and method for the full service name. This is an RFrame client integration template; Sensor Center registers the server using native ROS2. The 2000 ms client timeout is an example, not a server guarantee.

1.3.2.1. Type Schema​

Type: robby_sensor_msgs/srv/GetSensorVersions

Source: RTypes: robby_sensor_msgs/srv/GetSensorVersions.srv

# GetSensorVersions.srv

# Request
string sensor_type # Sensor type
---
# Response
bool success # Whether the request succeeded
string version # Version information in JSON format

Response JSON structure:

{
"HeadMonoDepthCamera": {
"firmware_ver":"1.6.00",
"hw_ver":"0.1",
"sn":"CP2BC53000H3"
},
"LeftWristMonoDepthCamera": {
"firmware_ver":"1.0.70",
"hw_ver":"0.1",
"sn":"CV2R46P0005T"
}
}

Invocation example

# Query versions of all sensors under the current module
ros2 service call /sensor/sensor_vla_camera/sensor_version robby_sensor_msgs/srv/GetSensorVersions "{sensor_type: ''}"

Semantics: The request includes sensor_type, but the current Sensor Center callback does not read or filter by it. The response contains success and version. With no version records, success=false and version is empty. Otherwise success=true; devices expected to provide a version but unavailable have null values. version is a JSON string keyed by sensor_tag (the unique sensor identifier), with values containing firmware_ver, hw_ver, and sn.

1.3.3. Main configuration​

Configuration path: /opt/robby/robby-sensor-center/config/robby_r2_fun/sensor_center/sensor_global_cam_pvt.json

After editing the configuration, restart robby-sensor-center.service (sudo systemctl restart robby-sensor-center.service).

FieldTypeDefaultMeaningOptions / examples
sync_enableboolfalseEnable multi-camera hardware synchronization. Cameras use hardware triggers for frame-level synchronizationtrue (enabled) / false (disabled)
sync_modestringNoneSynchronization role, effective only when sync_enable=true"slave" (slave synchronization) / "master" (outputs trigger signals) / "sw_trigger" (software trigger)
enable_colorboolfalseEnable the Color streamtrue / false
enable_depthboolfalseEnable the Depth streamtrue / false
enable_irboolfalseEnable IR streams, including Left IR and Right IRtrue / false
time_srcstring"system_time"Frame timestamp source: system or camera hardware time for each frame's time_stamp"system_time" (host time) / "camera_time" (camera global timestamp getGlobalTimeStampUs())
d2c_enablebooltrueEnable Depth-to-Color spatial alignment. Align depth coordinates to color coordinates; requires both streamstrue (aligned) / false (unaligned)
filter_max_diffint32256Maximum difference threshold for depth noise filtering. Sets OrbbecSDK OB_PROP_DEPTH_NOISE_REMOVAL_FILTER_MAX_DIFF_INT; adjacent-pixel depth differences exceeding it are treated as noise and removed256 (default) / 128 (stricter) / 512 (looser) / 0 (off)
filter_max_speckle_sizeint32300Maximum speckle size for depth noise filtering. Sets OB_PROP_DEPTH_NOISE_REMOVAL_FILTER_MAX_SPECKLE_SIZE_INT; contiguous noise regions larger than this are removed300 (default) / 150 (more aggressive) / 600 (more conservative) / 0 (off)
tegra_jpegboolfalseUse NVIDIA Tegra hardware JPEG encoding (ARM64/Orin only). Color stream encoding uses GPU hardware acceleration to reduce CPU loadtrue (Tegra hardware encoding) / false (CPU encoding)
color_widthint0Color stream width in pixels1280 / 640 / 848 / 1920
color_heightint0Color stream height in pixels720 / 480 / 530 / 1080
color_fpsint0Target Color frame rate (fps). In hw_trigger mode, code forces it to 1030 / 10 / 15 / 60
depth_widthint0Depth stream width in pixels1280 / 640 / 848 / 800
depth_heightint0Depth stream height in pixels720 / 480 / 530 / 576
depth_fpsint0Target Depth frame rate (fps). In hw_trigger mode, code forces it to 1030 / 10 / 15 / 60

Field dependencies:

  • sync_mode applies only when sync_enable=true.
  • d2c_enable=true requires both enable_color=true and enable_depth=true.
ModelBrand
Gemini 335LOrbbec
Gemini 335Orbbec
Gemini 335Orbbec
Gemini 305LOrbbec
Gemini 305Orbbec
Femto BoltOrbbec
RealSense D405Intel
RealSense D415Intel
RealSense D435Intel
RealSense D455Intel

Note: 335 and 305 are treated as equivalent (305 can replace 335). RealSense cameras are matched by SN; any device supported by librealsense2 can run. The code does not enforce a model-level allowlist.