Skip to main content

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

rt/joint_ctrl

b1::kTopicJointCtrl

booster_interface::msg::LowCmd

>= v1.0.0.0

rt/low_state

b1::kTopicLowState

booster_interface::msg::LowState

>= v1.0.0.0

rt/fall_down

b1::kTopicFallDown

booster_interface::msg::FallDownState

>= v1.2.0.2

rt/odometer_state

b1::kTopicOdometerState

booster_interface::msg::Odometer

>= v1.3.1.1

rt/booster_hand_data

b1::kTopicBoosterHandData

booster_interface::msg::HandReplyData

>= v1.7.1.0

rt/booster_hand_touch_data

b1::kTopicHandTouchData

booster_interface::msg::HandTouchData

>= v1.7.1.0

rt/robot_states

b1::kTopicRobotStates

booster_interface::msg::RobotStatesMsg

>= v1.3.1.1

rt/prone_body_control_status

b1::kTopicProneBodyControlStatus

booster_interface::msg::ProneBodyControlStatus

>= v1.7.1.0

rt/robot_replay_traj_id

b1::kTopicRobotReplayTrajID

booster_interface::msg::RobotReplayTrajID

>= v1.7.1.0

rt/trained_traj_status

b1::kTopicTrainedTrajStatus

booster_interface::msg::TrainedTrajStatus

>= v1.8.0.9

rt/robocup_behavior_status

b1::kTopicRobocupBehaviorStatus

booster_interface::msg::RobocupBehaviorStatus

>= v1.7.1.0

rt/kick_ball

b1::kTopicKickReference

booster_interface::msg::Kick

>= v1.7.1.0

rt/button_event

Use the topic string

booster_interface::msg::ButtonEventMsg

>= v1.7.1.0

rt/remote_controller_state

Use the topic string

booster_interface::msg::RemoteControllerState

>= v1.2.0.2

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

rt/tf

b1::kTopicTF

tf2_msgs::msg::TFMessage

>= v1.1.0.6

rt/odom

b1::kTopicRosOdometer

nav_msgs::msg::Odometry

>= v1.7.1.0

rt/imu/data

b1::kTopicRosImu

sensor_msgs::msg::Imu

>= v1.7.1.0

rt/joint_states

b1::kTopicRosJointStates

sensor_msgs::msg::JointState

>= v1.7.1.0

💡

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

rt/ai_subtitle

kTopicAiSubtitle

booster_interface::msg::Subtitle

>= v1.3.1.1

rt/lui_asr_chunk

kTopicLuiAsrChunk

booster_interface::msg::AsrChunk

>= v1.5.0.9

Joint Indices​

Joint-index constants are defined in include/booster/robot/b1/b1_api_const.hpp:

Layout

Joint count

C++ enum

Default layout

kJointCnt = 23

JointIndex

K1 layout

kJointCntK1 = 22

JointIndexK1

T1_7DofArm 7-DoF arm layout

kJointCnt7DofArm = 29

JointIndexWith7DofArm

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

kTopicJointCtrl

rt/joint_ctrl

Low-level joint commands; active only in Custom mode. Verify the layout and publish rate first.

kTopicLowState

rt/low_state

Motor, joint-feedback, and low-level sensor state.

kTopicFallDown

rt/fall_down

Fall detection and recovery state.

kTopicOdometerState

rt/odometer_state

Planar odometry consumed by the motion controller.

kTopicBoosterHandData

rt/booster_hand_data

Actuator feedback from an installed Booster hand; requires compatible hardware.

kTopicHandTouchData

rt/booster_hand_touch_data

Touch-sensor data from a compatible hand; availability is hardware-dependent.

kTopicRobotStates

rt/robot_states

Current RobotMode, BodyControl, and Action states.

kTopicProneBodyControlStatus

rt/prone_body_control_status

Prone-body and visual-kick status; non-inactive states depend on T1 body controllers.

kTopicRobotReplayTrajID

rt/robot_replay_traj_id

ID of the upper-body trajectory being replayed; recording/replay is normally enabled on K1/T1.

kTopicTrainedTrajStatus

rt/trained_traj_status

Built-in or custom trained-trajectory execution state for action highlighting; T1 normally reports idle.

kTopicRobocupBehaviorStatus

rt/robocup_behavior_status

Robocup soccer behavior state for K1/T1; soccer mode is disabled on T2.

kTopicKickReference

rt/kick_ball

Ball-position/kick reference for visual kick; T2 has no visual-kick controller.

Constant

Topic

Business meaning

kTopicTF

rt/tf

Robot transform tree; the current release is consumed through ROS 2.

kTopicRosOdometer

rt/odom

ROS nav_msgs/Odometry-compatible odometry; requires the ROS bridge.

kTopicRosImu

rt/imu/data

ROS sensor_msgs/Imu-compatible IMU data; requires the ROS bridge.

kTopicRosJointStates

rt/joint_states

ROS sensor_msgs/JointState-compatible joint state; requires the ROS bridge.

JointIndex (the default 23-joint T1 layout):

Member

Value

Meaning

kHeadYaw

0

Head yaw.

kHeadPitch

1

Head pitch.

kLeftShoulderPitch / kLeftShoulderRoll

2 / 3

Left shoulder pitch / roll.

kLeftElbowPitch / kLeftElbowYaw

4 / 5

Left elbow pitch / yaw.

kRightShoulderPitch / kRightShoulderRoll

6 / 7

Right shoulder pitch / roll.

kRightElbowPitch / kRightElbowYaw

8 / 9

Right elbow pitch / yaw.

kWaist

10

Waist yaw.

kLeftHipPitch / kLeftHipRoll / kLeftHipYaw

11 / 12 / 13

Left hip pitch / roll / yaw.

kLeftKneePitch

14

Left knee pitch.

kCrankUpLeft / kCrankDownLeft

15 / 16

Left upper / lower crank.

kRightHipPitch / kRightHipRoll / kRightHipYaw

17 / 18 / 19

Right hip pitch / roll / yaw.

kRightKneePitch

20

Right knee pitch.

kCrankUpRight / kCrankDownRight

21 / 22

Right upper / lower crank.

JointIndexK1 (the 22-joint K1 layout):

Member

Value

Meaning

kHeadYaw / kHeadPitch

0 / 1

Head yaw / pitch.

kLeftShoulderPitch / kLeftShoulderRoll

2 / 3

Left shoulder pitch / roll.

kLeftElbowPitch / kLeftElbowYaw

4 / 5

Left elbow pitch / yaw.

kRightShoulderPitch / kRightShoulderRoll

6 / 7

Right shoulder pitch / roll.

kRightElbowPitch / kRightElbowYaw

8 / 9

Right elbow pitch / yaw.

kLeftHipPitch / kLeftHipRoll / kLeftHipYaw

10 / 11 / 12

Left hip pitch / roll / yaw.

kLeftKneePitch

13

Left knee pitch.

kCrankUpLeft / kCrankDownLeft

14 / 15

Left upper / lower crank.

kRightHipPitch / kRightHipRoll / kRightHipYaw

16 / 17 / 18

Right hip pitch / roll / yaw.

kRightKneePitch

19

Right knee pitch.

kCrankUpRight / kCrankDownRight

20 / 21

Right upper / lower crank.

JointIndexWith7DofArm (the 29-joint T1_7DofArm layout):

Member

Value

Meaning

kHeadYaw / kHeadPitch

0 / 1

Head yaw / pitch.

kLeftShoulderPitch / kLeftShoulderRoll

2 / 3

Left shoulder pitch / roll.

kLeftElbowPitch / kLeftElbowYaw

4 / 5

Left elbow pitch / yaw.

kLeftWristPitch / kLeftWristYaw / kLeftHandRoll

6 / 7 / 8

Left wrist pitch / yaw / hand roll.

kRightShoulderPitch / kRightShoulderRoll

9 / 10

Right shoulder pitch / roll.

kRightElbowPitch / kRightElbowYaw

11 / 12

Right elbow pitch / yaw.

kRightWristPitch / kRightWristYaw / kRightHandRoll

13 / 14 / 15

Right wrist pitch / yaw / hand roll.

kWaist

16

Waist yaw.

kLeftHipPitch / kLeftHipRoll / kLeftHipYaw

17 / 18 / 19

Left hip pitch / roll / yaw.

kLeftKneePitch

20

Left knee pitch.

kCrankUpLeft / kCrankDownLeft

21 / 22

Left upper / lower crank.

kRightHipPitch / kRightHipRoll / kRightHipYaw

23 / 24 / 25

Right hip pitch / roll / yaw.

kRightKneePitch

26

Right knee pitch.

kCrankUpRight / kCrankDownRight

27 / 28

Right upper / lower crank.

Hand and remote-controller enums:

Enum member

Value

Meaning

HandIndex::kLeftHand / kRightHand

0 / 1

Left / right hand index used by hand and gripper APIs.

BoosterHandType::kInspireHand

0

Inspire dexterous hand without touch feedback.

BoosterHandType::kInspireTouchHand

2

Inspire dexterous hand with touch sensing.

BoosterHandType::kRevoHand

3

Revo dexterous hand.

BoosterHandType::kUnknown

-1

Unknown or unavailable hand type.

HandAction::kHandOpen

0

Open the hand or start the selected hand action.

HandAction::kHandClose

1

Close the hand or stop the selected action; individual APIs may restrict manual stopping.

RemoteControllerEvent::NONE

0

No event.

RemoteControllerEvent::AXIS

0x600

Analog-axis motion.

RemoteControllerEvent::HAT

0x602

Directional-hat position change.

RemoteControllerEvent::BUTTON_DOWN

0x603

Button pressed.

RemoteControllerEvent::BUTTON_UP

0x604

Button released.

RemoteControllerEvent::REMOVE

0x606

Controller device removed.