Quick Start
Requirements
- Ubuntu 22.04 or Ubuntu 24.04.
- An x86_64 or aarch64 processor.
- The network IP address used to communicate with the robot, such as
127.0.0.1or192.168.10.102.<network_ip>refers to this IP address throughout the examples. - DDS domain ID
0is used by default. Publishers and subscribers must use the same domain ID when multiple DDS networks are present.
Install the C++ SDK
This guide uses <sdk_path> for the root of the SDK release package. The directory contains install.sh, include/, lib/, and example/. Install the SDK with the provided script:
cd <sdk_path>
sudo ./install.sh
The script installs build-essential and CMake, selects the prebuilt library for the current CPU architecture, and installs the SDK into the system paths:
- Headers are copied to
/usr/local/include. - Libraries are copied to
/usr/local/lib. ldconfigis run to refresh the linker cache.
After installation, applications can use #include <booster/...> and link the booster_robotics_sdk library by name. No SDK source path or custom installation prefix is required.
Build the Bundled Examples
The release package already contains a prebuilt SDK library. These commands only compile the C++ programs under example/:
cd <sdk_path>
cmake -S . -B build
cmake --build build -j
See C++ API Reference for a complete CMake configuration for your own application.
Minimal C++ Example
#include <cstdint>
#include <iostream>
#include <booster/robot/b1/b1_loco_client.hpp>
#include <booster/robot/channel/channel_factory.hpp>
#include <booster/robot/rpc/error.hpp>
int main() {
booster::robot::ChannelFactory::Instance()->Init(0, "<network_ip>");
booster::robot::b1::B1LocoClient client;
client.Init();
if (!client.WaitForService(5000)) {
std::cerr << "loco service is not available\n";
return 1;
}
int32_t ret = client.ChangeMode(booster::robot::RobotMode::kPrepare);
if (ret != booster::robot::kRpcStatusCodeSuccess) {
std::cerr << "ChangeMode failed: " << ret << "\n";
return 1;
}
client.GetUp();
client.ChangeMode(booster::robot::RobotMode::kWalking);
client.Move(0.2F, 0.0F, 0.0F);
client.Move(0.0F, 0.0F, 0.0F);
return 0;
}
Run Bundled Examples
Interactive motion-control client:
./build/b1_loco_example_client <network_ip>
Low-level state subscriber:
./build/b1_low_level_subscriber
See C++ Example Index for low-level command, arm-control, odometry, and other examples.
Warning
Motion, action, and low-level publishing examples affect the physical robot. Verify the robot mode, communication IP, and surrounding environment before running them.