Roban2 Docs
Development InterfacesRoban2 C++ SDK Interfaces

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

ScenarioCYCLONEDDS_URIDescription
Local standard DDSfile://<Lejulab_ARM>/src/leju_launch/config/cyclonedds.xmlShared memory disabled; the startup script's --no-shm uses this mode
Local shared memoryfile:///etc/cyclonedds/cyclonedds_shm.xmlReduces same-host data copies via iceoryx RouDi; the configuration must be deployed first
Cross-host DDSBoth ends use the same network configurationThe 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.sh

After 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.sh

When --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 lo to 192.168.26.1.
  • If it does not exist, lo is 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

FunctionSDK MethodDDS Topic
Hardware statesubscribeHardwareState()/rt/hardware/state
IMUsubscribeImuData()/rt/imu_state
Joint statesubscribeRobotState()/rt/joint_state
Standard joysticksubscribeJoyData()/rt/joy
Low-level joint commandspublishRobotCmd()/rt/joint_cmd
Dual-hand commandspublishHandCmd()/rt/hand_cmd
Posture heightpublishPostureHeightCmd()/rt/posture_height_cmd
Stop commandpublishStopRobot()/rt/hardware/stop
Arm/head/waist trajectoriespublish...JointCmd()/rt/arm_trajectory, /rt/head_trajectory, /rt/waist_trajectory
Controller velocitypublishVelocityCmd()/rt/cmd_vel
VR input velocitypublishVrVelocityCmd()/rt/vr/cmd_vel
Quest bone posespublishQuestBonePoses() / subscribeQuestBonePoses()/rt/quest/bone_poses
Quest joystickpublishQuestJoystickData() / 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.sh

Troubleshooting order for common issues:

  1. Confirm that ROBOT_VERSION is the same in all terminals.
  2. Confirm that the CYCLONEDDS_URI of the publisher and subscriber points to the expected configuration.
  3. When using shared memory, confirm that leju-roudi.service is running properly.
  4. For cross-host setups, confirm that the XML is not bound to lo and that both ends are network-reachable.
  5. Then run the compiled examples hw_state_subscriber or joint_state_subscriber to 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