RBQ API Overview
The RBQ API provides a comprehensive C++ interface for developers to control and interact with the RBQ quadruped robot. It is designed to support both low-level real-time control and high-level behavioral commands in a multi-process environment.
C++ Documentation
Process ID (Motion Ownership)
When creating an RBQ_API instance, a process ID must be provided:
cpp
RBQ_API api(20); // Process ID between 20 and 39 for user applicationsThis ID ensures safe multi-process control using a motion ownership mechanism, where each joint can only be controlled by its owner process.
⚠️ Always call setMotionOwner() before sending joint commands.
API Structure Summary
| Category | Component | Description |
|---|---|---|
| Control | Joint | Low-level joint control: position, torque, gains (Kp/Kd) |
startMoveJoint() / stopMoveJoint() | Start/stop jog motion per joint | |
lockUnlockJoint() | Locks/unlocks joints for manual manipulation | |
| Sensor | IMU | Access to orientation (quaternion/RPY), gyro, and acceleration |
getBatteryVoltage() | Reads battery voltage (internal only) | |
| Gamepad | Gamepad | Access Logitech F710 gamepad inputs: jogs, triggers, buttons |
| High-level Motion | motionStaticReady() / motionDynamicWalk() etc. | Predefined robot behaviors |
Joint Control API (RBQ_API::Joint)
Reading Sensor Values
| Function | Description |
|---|---|
getPos() | Read joint position (rad) |
getVel() | Read joint velocity (rad/s) |
getTorque() | Read joint torque (Nm) |
getGainKp() / getGainKd() | Read current Kp/Kd gains |
Sending Commands
| Function | Description |
|---|---|
setMotionOwner() | Take control of a joint |
setPosRef() | Set joint position target |
setTorqueRef() | Set torque target (Nm) |
setGainKp() / setGainKd() | Set control gains with quantization |
✅ Each joint must have an owner process to receive control commands.
IMU Sensor API (RBQ_API::IMU)
Provides access to robot orientation and motion state.
| Function | Output |
|---|---|
getQuaternion() | Orientation as Eigen quaternion (w, x, y, z) |
getRPY() | Roll, Pitch, Yaw (ZYX Euler angles, radians) |
getGyro() | Angular velocity in rad/s (X, Y, Z) |
getAcc() | Linear acceleration in m/s² (X, Y, Z) |
Gamepad API (RBQ_API::Gamepad)
Supports Logitech F710 (X mode) for teleoperation.
| Type | Function | Description |
|---|---|---|
| Joystick | getLeftJogX/Y(), getRightJogX/Y() | Range: [-1.0, 1.0] |
| Trigger | getLeftTrigger(), getRightTrigger() | Range: [0.0, 1.0] |
| Button | getButtonState(Button::X) | Returns true if pressed |
Built-in Motion Programs
Easily trigger predefined robot behaviors:
| Function | Description |
|---|---|
motionStaticReady() | Move to ready pose |
motionStaticGround() | Lie down to ground pose |
motionDynamicWalk() | Start dynamic walking |
motionDynamicRun() | Start dynamic running |
motionDynamicAim() | Aim pose for manipulation/vision |
motionDynamicStairs() | Stair climbing motion |
motionDynamicHealthCheck() | Diagnostic motion |
