Low-Level Topics
Low-level topics use DDS and are suitable for high-frequency state, sensor data, and joint control. C++ applications publish and subscribe through the ChannelPublisher and ChannelSubscriber templates.
Warning
Publishing rt/joint_ctrl directly participates in low-level joint control, and commands take effect only while the robot is in Custom mode. Call B1LocoClient::ChangeMode(RobotMode::kCustom) first, then verify the joint count, joint indices, and control frequency. Start with subscribe-only examples when debugging state topics.
Initialization
#include <booster/robot/channel/channel_factory.hpp>
booster::robot::ChannelFactory::Instance()->Init(0, "<network_ip>");
C++ Subscription Example
#include <chrono>
#include <iostream>
#include <thread>
#include <booster/idl/b1/LowState.h>
#include <booster/robot/b1/b1_api_const.hpp>
#include <booster/robot/channel/channel_factory.hpp>
#include <booster/robot/channel/channel_subscriber.hpp>
int main() {
booster::robot::ChannelFactory::Instance()->Init(0, "<network_ip>");
booster::robot::ChannelSubscriber<booster_interface::msg::LowState> sub(
booster::robot::b1::kTopicLowState,
[](const void *msg) {
const auto *state =
static_cast<const booster_interface::msg::LowState *>(msg);
std::cout << state->motor_state_parallel().size() << "\n";
});
sub.InitChannel();
std::this_thread::sleep_for(std::chrono::seconds(10));
sub.CloseChannel();
return 0;
}
C++ Publishing Example
This example creates a LowCmd frame with zero control weight. For actual control, configure every motor according to the robot model, control mode, and joint layout, then publish continuously at a stable rate.
#include <vector>
#include <booster/idl/b1/LowCmd.h>
#include <booster/idl/b1/MotorCmd.h>
#include <booster/robot/b1/b1_api_const.hpp>
#include <booster/robot/channel/channel_factory.hpp>
#include <booster/robot/channel/channel_publisher.hpp>
int main() {
booster::robot::ChannelFactory::Instance()->Init(0, "<network_ip>");
booster::robot::ChannelPublisher<booster_interface::msg::LowCmd> publisher(
booster::robot::b1::kTopicJointCtrl);
publisher.InitChannel();
std::vector<booster_interface::msg::MotorCmd> motors(
booster::robot::b1::kJointCnt);
for (auto &motor : motors) {
motor.mode(0);
motor.q(0.0F);
motor.dq(0.0F);
motor.tau(0.0F);
motor.kp(0.0F);
motor.kd(0.0F);
motor.weight(0.0F);
}
booster_interface::msg::LowCmd cmd;
cmd.cmd_type(booster_interface::msg::PARALLEL);
cmd.motor_cmd(std::move(motors));
publisher.Write(&cmd);
publisher.CloseChannel();
return 0;
}
Motion-Control Topics
Minimum firmware refers to the robot-side firmware version. Topics without a separate version record use >= v1.7.1.0.
Topic | C++ constant | C++ message type | Minimum firmware |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Use the topic string |
|
|
| Use the topic string |
|
|
ROS-Like Topics
These topics use common ROS message structures while still using the SDK DDS channel:
Topic | C++ constant | C++ message type | Minimum firmware |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note
rt/tf currently supports ROS 2 subscription only. TFMessage describes the wire schema; the current SDK release package does not expose a public C++ IDL header for this type.
AI and LUI Topics
Topic | C++ constant | C++ message type | Minimum firmware |
|---|---|---|---|
|
|
|
|
|
|
|
|
Joint Indices
Joint-index constants are defined in include/booster/robot/b1/b1_api_const.hpp:
Layout | Joint count | C++ enum |
|---|---|---|
Default layout |
|
|
K1 layout |
|
|
T1_7DofArm 7-DoF arm layout |
|
|
const auto head_yaw =
static_cast<int>(booster::robot::b1::JointIndex::kHeadYaw);
const auto right_wrist_yaw =
static_cast<int>(
booster::robot::b1::JointIndexWith7DofArm::kRightWristYaw);
Bundled Examples
example/low_level contains low-level publishing, low-level subscription, odometry, battery-state, and hand-data C++ examples. See C++ Example Index for build instructions and executable names.
Public Topic Constants and Enum Members
The following tables describe every application-facing topic constant in b1_api_const.hpp. Topic names are protocol contracts; use the kTopic* constants instead of constructing similar strings in application code.
Constant | Topic | Business meaning |
|---|---|---|
|
| Low-level joint commands; active only in Custom mode. Verify the layout and publish rate first. |
|
| Motor, joint-feedback, and low-level sensor state. |
|
| Fall detection and recovery state. |
|
| Planar odometry consumed by the motion controller. |
|
| Actuator feedback from an installed Booster hand; requires compatible hardware. |
|
| Touch-sensor data from a compatible hand; availability is hardware-dependent. |
|
| Current RobotMode, BodyControl, and Action states. |
|
| Prone-body and visual-kick status; non-inactive states depend on T1 body controllers. |
|
| ID of the upper-body trajectory being replayed; recording/replay is normally enabled on K1/T1. |
|
| Built-in or custom trained-trajectory execution state for action highlighting; T1 normally reports idle. |
|
| Robocup soccer behavior state for K1/T1; soccer mode is disabled on T2. |
|
| Ball-position/kick reference for visual kick; T2 has no visual-kick controller. |
Constant | Topic | Business meaning |
|---|---|---|
|
| Robot transform tree; the current release is consumed through ROS 2. |
|
| ROS |
|
| ROS |
|
| ROS |
JointIndex (the default 23-joint T1 layout):
Member | Value | Meaning |
|---|---|---|
| 0 | Head yaw. |
| 1 | Head pitch. |
| 2 / 3 | Left shoulder pitch / roll. |
| 4 / 5 | Left elbow pitch / yaw. |
| 6 / 7 | Right shoulder pitch / roll. |
| 8 / 9 | Right elbow pitch / yaw. |
| 10 | Waist yaw. |
| 11 / 12 / 13 | Left hip pitch / roll / yaw. |
| 14 | Left knee pitch. |
| 15 / 16 | Left upper / lower crank. |
| 17 / 18 / 19 | Right hip pitch / roll / yaw. |
| 20 | Right knee pitch. |
| 21 / 22 | Right upper / lower crank. |
JointIndexK1 (the 22-joint K1 layout):
Member | Value | Meaning |
|---|---|---|
| 0 / 1 | Head yaw / pitch. |
| 2 / 3 | Left shoulder pitch / roll. |
| 4 / 5 | Left elbow pitch / yaw. |
| 6 / 7 | Right shoulder pitch / roll. |
| 8 / 9 | Right elbow pitch / yaw. |
| 10 / 11 / 12 | Left hip pitch / roll / yaw. |
| 13 | Left knee pitch. |
| 14 / 15 | Left upper / lower crank. |
| 16 / 17 / 18 | Right hip pitch / roll / yaw. |
| 19 | Right knee pitch. |
| 20 / 21 | Right upper / lower crank. |
JointIndexWith7DofArm (the 29-joint T1_7DofArm layout):
Member | Value | Meaning |
|---|---|---|
| 0 / 1 | Head yaw / pitch. |
| 2 / 3 | Left shoulder pitch / roll. |
| 4 / 5 | Left elbow pitch / yaw. |
| 6 / 7 / 8 | Left wrist pitch / yaw / hand roll. |
| 9 / 10 | Right shoulder pitch / roll. |
| 11 / 12 | Right elbow pitch / yaw. |
| 13 / 14 / 15 | Right wrist pitch / yaw / hand roll. |
| 16 | Waist yaw. |
| 17 / 18 / 19 | Left hip pitch / roll / yaw. |
| 20 | Left knee pitch. |
| 21 / 22 | Left upper / lower crank. |
| 23 / 24 / 25 | Right hip pitch / roll / yaw. |
| 26 | Right knee pitch. |
| 27 / 28 | Right upper / lower crank. |
Hand and remote-controller enums:
Enum member | Value | Meaning |
|---|---|---|
| 0 / 1 | Left / right hand index used by hand and gripper APIs. |
| 0 | Inspire dexterous hand without touch feedback. |
| 2 | Inspire dexterous hand with touch sensing. |
| 3 | Revo dexterous hand. |
| -1 | Unknown or unavailable hand type. |
| 0 | Open the hand or start the selected hand action. |
| 1 | Close the hand or stop the selected action; individual APIs may restrict manual stopping. |
| 0 | No event. |
| 0x600 | Analog-axis motion. |
| 0x602 | Directional-hat position change. |
| 0x603 | Button pressed. |
| 0x604 | Button released. |
| 0x606 | Controller device removed. |