Skip to content

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

AreaWhat it contains
DDS I/Orbq_sdk/cpp/rbq_sdk_cpp/include/dds/Publisher.hpp, Subscriber.hpp — CycloneDDS-CXX typed reader/writer templates
High-level clientrbq_sdk/cpp/rbq_sdk_cpp/include/dds/SportClient.hpp — RPC wrapper for the Network service (Damp, Move, SwitchGait, …)
IDL messagesrbq_sdk/cpp/rbq_sdk_cpp/idl/rbq/, idl/ros2/, idl/go2/ — generated C++ types used on every topic
Control helpersJointControl, Policy/PolicyParams (ONNX), Filter, Timer, Thread (optional RT)

Requirements

ItemMinimum
OSUbuntu 22.04 (x86_64)
CMake≥ 3.22
C++ standardC++17
CycloneDDSDownloaded 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.bash

The 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

DirectionTopicMessage typeDescription
Publishrt/rbq/cmd/highLevelHighLevelCommand_Gait + velocity command
Publishrt/rbq/cmd/switchControlModeBool_Enable/disable EXT_JOY mode
Publishrt/rbq/ref/leg_joint/owner_20MotionRef_Per-joint position/gain reference
Publishrt/rbq/cmd/motion/joint_owner/_20JointOwnershipCmd_Claim joint ownership
Subscribert/rbq/info/imuImu_IMU angular velocity + orientation
Subscribert/rbq/info/leg_jointLegJointInfo_Leg joint position and velocity
Subscribert/rbq/ref/leg_joint/finalMotionRef_Final blended reference (read-back)
Subscribert/rbq/cmd/joy/finalJoy_Joystick axes forwarded by the stack

Example programs

ExampleWhat it demonstrates
Sport ClientTerminal CLI for all SportClient commands
Sport Client (Joystick)Gamepad + SportClient — full button mapping
High Level Command50 Hz HighLevelCommand publisher with joystick velocity
Low Level (RL Policy)Joint-level control + ONNX policy runner

This user manual is intended for RBQ users.