Module: Camera Subscriber Node (CamSubNode)
CamSubNode is one of the most mature reusable nodes in ros_base. Its responsibilities are clear:
- Subscribe to RGB, depth, infra, and
CameraInfo - Convert ROS image messages into
numpy.ndarrayautomatically - Cache the latest results into readable attributes
- Provide lightweight visualization and recording when needed
1. Data exposed by the current implementation
After the node starts, commonly used attributes include:
img: latest RGB image,numpy.ndarrayimg_timestampimg_shapedepthdepth_timestampdepth_shapergb_infoinfra1/infra2infra1_infoinfra_fxinfra_baseline
That is why handlers and agents can write:
2. Supported camera configurations
CamSubNode currently accepts either a string preset or a CameraProfile as config.
Built-in string presets include:
realsense_d435irealsense_d435i_compressedrealsense_d435i_alignrealsense_d435i_align_compressedrealsense_d435i_infrazed_mini
One detail to note: although the constructor type hint mentions dict, the current implementation actually accepts only:
strCameraProfile
3. Typical usage in attached mode
The entry script in SigLoMa-VLM registers it directly into nodes_dict:
Then the manager uses a handshake rule to guarantee that the first frame has arrived:
That way, by the time handlers.handle() actually starts, a valid image is usually already available.
4. Typical parameters
| Parameter | Default | Description |
|---|---|---|
config |
"realsense_d435i_align" |
Preset camera configuration |
record |
False |
Whether to record video in a background thread |
record_fps |
20 |
Maximum recording frame rate |
vis_rgb |
False |
Show an RGB window |
vis_depth |
False |
Show a pseudo-color depth window |
gamma |
2.0 |
Gamma preprocessing |
use_clahe |
False |
CLAHE local contrast enhancement |
Recording behavior
If record=True, the current implementation will:
- Start a background thread
- Write images to an
mp4 - Write timestamps into a text file
The output directory format is:
5. Standalone debugging
The source file already provides a command-line entry:
python3 ros_base/nodes/camera/cam_sub_node.py \
--camera realsense_d435i_align \
--vis_rgb \
--clahe
If you also want to inspect depth:
python3 ros_base/nodes/camera/cam_sub_node.py \
--camera realsense_d435i_align \
--vis_rgb \
--vis_depth
6. Working with PoseProcessor
CamSubNode itself only acquires images and camera info. The actual conversion from:
bbox + depthodomcamera extrinsics
into world coordinates is handled by ros_base.nodes.camera.pose_processor.PoseProcessor.
In SigLoMa-VLM, this object is held by Robot2VLMBridge.pose_processor and is used to:
- Get the robot base position in the world frame
- Convert a selected target box into world coordinates
7. What it should and should not do
Good responsibilities:
- Subscribe to and cache the latest image data
- Lightweight preprocessing
- Temporary visualization
- Development-time recording
Poor responsibilities:
- Running heavy model inference inside callbacks
- Holding the whole vision business logic
- Mixing complex state machines into a single callback
Those parts should stay in agents and handlers.