RBQ SDK — C/C++ Overview
The RBQ C++ SDK (rbq_sdk/cpp/) is a library built on Eclipse Cyclone DDS that lets external applications communicate with the on-robot software stack over a network.
It wraps DDS participants, topics, and generated IDL message types, and provides helpers for low-level joint control, learned RL policies, timing utilities, and optional RT threads.
SDK layout
| Area | What it contains |
|---|---|
| DDS I/O | rbq_sdk/cpp/rbq_sdk_cpp/include/dds/Publisher.hpp, Subscriber.hpp — CycloneDDS-CXX typed reader/writer templates |
| High-level client | rbq_sdk/cpp/rbq_sdk_cpp/include/dds/SportClient.hpp — RPC wrapper for the Network service (Damp, Move, SwitchGait, …) |
| IDL messages | rbq_sdk/cpp/rbq_sdk_cpp/idl/rbq/, idl/ros2/, idl/go2/ — generated C++ types used on every topic |
| Control helpers | JointControl, Policy/PolicyParams (ONNX), Filter, Timer, Thread (optional RT) |
Requirements
| Item | Minimum |
|---|---|
| OS | Ubuntu 22.04 (x86_64) |
| CMake | ≥ 3.22 |
| C++ standard | C++17 |
| CycloneDDS | Downloaded and installed system-wide by build_dds.bash (first-time bootstrap below) |
Build and install
From rbq_sdk/cpp/rbq_sdk_cpp/:
bash
# 1. Build bundled CycloneDDS (first time only)
sudo bash scripts/build_dds.bash
# 2. Configure, build, and install
sudo bash scripts/build.bashThe install tree adds include/rbq_sdk/ and the generated IDL headers to CMAKE_PREFIX_PATH.
Initialise DDS in your application
Every application must call ChannelFactory::Instance().Init() once before creating any publisher or subscriber:
cpp
#include <rbq_sdk/dds/ChannelFactory.hpp>
// argv[1] is the network interface name, e.g. "eth0"
rbq_sdk::ChannelFactory::Instance().Init(0, argv[1]);Publishing messages
cpp
#include <rbq_sdk/dds/Publisher.hpp>
#include <rbq_sdk/idl/rbq/HighLevelCommand_.hpp>
rbq_sdk::Publisher<rbq_msgs::msg::dds_::HighLevelCommand_> pub("rt/rbq/cmd/highLevel");
rbq_msgs::msg::dds_::HighLevelCommand_ msg;
msg.gait_state() = 1; // STANDING
msg.gait_transition() = true;
msg.vel_x() = 0.5f;
pub.write(msg);Subscribing to messages
cpp
#include <rbq_sdk/dds/Subscriber.hpp>
#include <rbq_sdk/idl/ros2/Imu_.hpp>
sensor_msgs::msg::dds_::Imu_ imuMsg;
rbq_sdk::Subscriber<sensor_msgs::msg::dds_::Imu_> sub(&imuMsg, "rt/rbq/info/imu");
// imuMsg is updated each time a new sample arrives.Key DDS topics
| Direction | Topic | Message type | Description |
|---|---|---|---|
| Publish | rt/rbq/cmd/highLevel | HighLevelCommand_ | Gait + velocity command |
| Publish | rt/rbq/cmd/switchControlMode | Bool_ | Enable/disable EXT_JOY mode |
| Publish | rt/rbq/ref/leg_joint/owner_20 | MotionRef_ | Per-joint position/gain reference |
| Publish | rt/rbq/cmd/motion/joint_owner/_20 | JointOwnershipCmd_ | Claim joint ownership |
| Subscribe | rt/rbq/info/imu | Imu_ | IMU angular velocity + orientation |
| Subscribe | rt/rbq/info/leg_joint | LegJointInfo_ | Leg joint position and velocity |
| Subscribe | rt/rbq/ref/leg_joint/final | MotionRef_ | Final blended reference (read-back) |
| Subscribe | rt/rbq/cmd/joy/final | Joy_ | Joystick axes forwarded by the stack |
Example programs
| Example | What it demonstrates |
|---|---|
| Sport Client | Terminal CLI for all SportClient commands |
| Sport Client (Joystick) | Gamepad + SportClient — full button mapping |
| High Level Command | 50 Hz HighLevelCommand publisher with joystick velocity |
| Low Level (RL Policy) | Joint-level control + ONNX policy runner |
