DDS Communication and Remote Development
The Roban2 C++ SDK uses Cyclone DDS to transport Topics and DDS-RPC. The SDK has already wrapped the underlying messages; business programs should prefer calling publish...(), subscribe...(), and the state/control services, rather than depending directly on internally generated DDS types.
Communication Modes
| Scenario | CYCLONEDDS_URI | Description |
|---|---|---|
| Local standard DDS | file://<Lejulab_ARM>/src/leju_launch/config/cyclonedds.xml | Shared memory disabled; the startup script's --no-shm uses this mode |
| Local shared memory | file:///etc/cyclonedds/cyclonedds_shm.xml | Reduces same-host data copies via iceoryx RouDi; the configuration must be deployed first |
| Cross-host DDS | Both ends use the same network configuration | The development machine and the robot must be able to reach each other over the network, and the DDS interface, multicast, and domain configurations must match |
By default, cyclonedds.xml and the undeployed cyclonedds_shm.xml in the repository bind to lo and can only discover local processes. Do not treat the default lo configuration as a cross-host configuration.
Local Standard DDS
When shared memory is not used, you can explicitly select the repository configuration:
cd <Lejulab_ARM>
export ROBOT_VERSION=17
source installed/setup.bash
export CYCLONEDDS_URI="file://$PWD/src/leju_launch/config/cyclonedds.xml"When using the startup script, --no-shm selects the same standard DDS configuration for that startup chain. Your own SDK programs must also use the same configuration; otherwise they may fail to discover the other side.
Local Shared Memory
The deployment script provided in the repository installs the RouDi system service, the DDS configuration, and the environment variables:
cd <Lejulab_ARM>
sudo bash src/leju_launch/scripts/setup_cyclonedds_config.shAfter deployment, log in again, or refresh the iceoryx group membership as prompted by the script. Verify the service and environment:
systemctl status leju-roudi.service --no-pager
echo "$CYCLONEDDS_URI"
bash src/leju_launch/scripts/check_shm.shWhen --no-shm is not explicitly passed, the startup script prefers /etc/cyclonedds/cyclonedds_shm.xml; only if that file does not exist does it use the shared memory configuration bundled with the repository.
Cross-Host Communication
During deployment, setup_cyclonedds_config.sh checks whether the local machine has a 192.168.26.1 address:
- If it exists, the deployed shared memory configuration changes the DDS network interface from
loto192.168.26.1. - If it does not exist,
lois kept, and only local communication is possible.
When deploying on other subnets, you need to modify the Cyclone DDS XML actually in use and point <NetworkInterface> at the NIC or IP through which the local machine communicates with the robot. Both ends must also satisfy the following:
- Their IPs can reach each other, and the firewall does not block DDS traffic.
- The programs participating in the same communication use compatible Cyclone DDS configurations.
- Do not rely on iceoryx to transport data across machines; shared memory only takes effect for processes on the same machine.
SDK Topic Quick Reference
| Function | SDK Method | DDS Topic |
|---|---|---|
| Hardware state | subscribeHardwareState() | /rt/hardware/state |
| IMU | subscribeImuData() | /rt/imu_state |
| Joint state | subscribeRobotState() | /rt/joint_state |
| Standard joystick | subscribeJoyData() | /rt/joy |
| Low-level joint commands | publishRobotCmd() | /rt/joint_cmd |
| Dual-hand commands | publishHandCmd() | /rt/hand_cmd |
| Posture height | publishPostureHeightCmd() | /rt/posture_height_cmd |
| Stop command | publishStopRobot() | /rt/hardware/stop |
| Arm/head/waist trajectories | publish...JointCmd() | /rt/arm_trajectory, /rt/head_trajectory, /rt/waist_trajectory |
| Controller velocity | publishVelocityCmd() | /rt/cmd_vel |
| VR input velocity | publishVrVelocityCmd() | /rt/vr/cmd_vel |
| Quest bone poses | publishQuestBonePoses() / subscribeQuestBonePoses() | /rt/quest/bone_poses |
| Quest joystick | publishQuestJoystickData() / subscribeQuestJoystickData() | /rt/quest/joysticks |
Topics are used for continuous data streams; controller switching, mode setting, state querying, runtime start/stop, and action playback are wrapped internally by lejusdk-vr as DDS-RPC.
Communication Checks
cd <Lejulab_ARM>
export ROBOT_VERSION=17
source installed/setup.bash
echo "$ROBOT_VERSION"
echo "$CYCLONEDDS_URI"
bash scripts/diagnostics/check_dds.shTroubleshooting order for common issues:
- Confirm that
ROBOT_VERSIONis the same in all terminals. - Confirm that the
CYCLONEDDS_URIof the publisher and subscriber points to the expected configuration. - When using shared memory, confirm that
leju-roudi.serviceis running properly. - For cross-host setups, confirm that the XML is not bound to
loand that both ends are network-reachable. - Then run the compiled examples
hw_state_subscriberorjoint_state_subscriberto verify the data path.
Corresponding Repository Files
- Standard DDS configuration:
src/leju_launch/config/cyclonedds.xml - Shared memory configuration:
src/leju_launch/config/cyclonedds_shm.xml - System deployment script:
src/leju_launch/scripts/setup_cyclonedds_config.sh - DDS selection logic in the startup script:
src/leju_launch/scripts/_launch_common.sh - DDS check:
scripts/diagnostics/check_dds.sh - Shared memory check:
src/leju_launch/scripts/check_shm.sh