Interface Usage Guide
This page is an overview of the Roban2 secondary development interfaces, for choosing an SDK, finding feature entry points, and completing a first run. The complete fields, prerequisites, C++ code, and repository examples for each interface are in the Roban2 C++ SDK tutorial, so that the same interface documentation is not maintained in two places.
SDK Scope
| SDK/Tool | Public Entry Point | Functional Scope |
|---|---|---|
lejusdk-lowlevel | <lejusdk-lowlevel/leju_sdk.h> | Robot information, joint states, IMU, standard gamepad, hardware status; low-level joint, dual-hand, posture height, and stop commands |
lejusdk-vr | <lejusdk-vr/lejusdk_vr.h> | Arms, head, waist, velocity, Quest data, control modes, controllers, runtime, motion, and tact |
| Bundled audio tool | play_audio_cli | Requests audio_player_node to play local audio; not currently a public C++ SDK |
The current development package does not provide public secondary development interfaces for lidar, cameras, the legacy speech synthesis, or arm FK/IK. This documentation set does not cover the legacy Python SDK, ROS1, rosbridge, or WebSocket usage.
Development Environment
Lejulab_ARM already provides compiled headers, shared libraries, nodes, and examples under installed/; there is no need to rebuild the SDK. <Lejulab_ARM> below is a placeholder for the development package root directory; replace it with your own actual directory.
Roban2.2 uses version number 17:
cd <Lejulab_ARM>
export ROBOT_VERSION=17
source installed/setup.bashYou must set ROBOT_VERSION before sourcing setup.bash. It adds installed/bin and the SDK shared libraries to the current terminal environment.
Starting the Basic Control Chain
Real robot startup:
cd <Lejulab_ARM>
export ROBOT_VERSION=17
source installed/setup.bash
sudo -E bash src/leju_launch/scripts/launch_real.shlaunch_real.sh starts the hardware, gamepad, RL controller, and recorder, and starts the microphone, audio playback, and system monitoring as optional nodes. If an optional node exits, the basic control chain is not terminated.
For simulation startup and architecture matching, see Simulation Environment Usage.
Quick Verification
After the basic control chain has started, you can directly run the bundled compiled examples:
hw_state_subscriber
joint_state_subscriber
imu_data_subscriber
vr_01_basic_initvr_01_basic_init is a generic VR SDK initialization example; its source code uses KuavoVRAPI. Roban2 programs should use leju::vr::RobanVRAPI, and for the Roban arm you can refer directly to vr_07_roban_arm.
Feature Entry Points
| Development Task | Primary API | Detailed Tutorial |
|---|---|---|
| SDK initialization, directories, and basic environment | GlobalRobot, RobanVRAPI | Roban2 C++ SDK Introduction |
| DDS configuration, shared memory, and cross-machine troubleshooting | CYCLONEDDS_URI, Cyclone DDS, RouDi | DDS Communication and Remote Development |
| Basic information, hardware, joints, and IMU | getMotorNames(), subscribeHardwareState(), subscribeRobotState(), subscribeImuData() | Robot Information and Status |
| Standard gamepad, Quest controller, and bone poses | subscribeJoyData(), subscribeQuestJoystickData(), subscribeQuestBonePoses() | Robot Information and Status |
| Arms, head, waist, and hands | publishArmJointCmd(), publishHeadJointCmd(), publishWaistJointCmd(), publishHandCmd() | Body Part Control |
| Advanced full-joint control | publishRobotCmd() | Body Part Control |
| Walking velocity and posture height | publishVrVelocityCmd(), publishVelocityCmd(), publishPostureHeightCmd() | Robot Locomotion and Controllers |
| Controllers, body part modes, and runtime | getControllerState(), switchController(), set...Mode(), getRuntimeState(), startRuntime(), stopRuntime() | Robot Locomotion and Controllers |
| CSV motion and tact actions | getMotionState(), startMotion(), playTact() | Motion and Audio Tools |
| Local audio files | play_audio_cli | Motion and Audio Tools |
DDS Topic Overview
| Function | SDK Data Type | Topic |
|---|---|---|
| Hardware status | StringData | /rt/hardware/state |
| IMU | ImuData | /rt/imu_state |
| Joint states/commands | RobotState / RobotCmd | /rt/joint_state / /rt/joint_cmd |
| Standard gamepad | JoyData | /rt/joy |
| Hand commands | HandCmd | /rt/hand_cmd |
| Posture height | double parameter wrapper | /rt/posture_height_cmd |
| Stop | Wrapped internally by the SDK | /rt/hardware/stop |
| Arm/head/waist | JointTrajectoryPoint | /rt/arm_trajectory, /rt/head_trajectory, /rt/waist_trajectory |
| Final velocity/VR input velocity | VelocityCmd / VrVelocityCmd | /rt/cmd_vel / /rt/vr/cmd_vel |
| Quest bones/gamepad | QuestBonePosesData / QuestJoystickData | /rt/quest/bone_poses / /rt/quest/joysticks |
Controller switching, mode setting, state querying, runtime start/stop, and action playback use DDS-RPC wrapped internally by the SDK; your application does not need to generate RPC messages itself.
VR Teleoperation Startup Entry Point
src/leju_launch/launch/vr_teleop.launch itself does not start the real robot hardware or the main controller. It starts:
quest_udp_to_dds_node: receives Quest UDP data and publishes Quest DDS topics.quest_vr_abs_control_node: the default absolute IK control.quest_vr_control_node: the incremental IK control used whenuse_incremental_ik:=true.
In a full development environment that provides roslaunch, run the following after the basic control chain has started:
cd <Lejulab_ARM>
export ROBOT_VERSION=17
source installed/setup.bash
roslaunch leju_launch vr_teleop.launch robot_version:=17To specify a Quest IP or use incremental IK:
roslaunch leju_launch vr_teleop.launch \
robot_version:=17 \
quest_ip:=<Quest-IP> \
use_incremental_ik:=trueIf the bundled deployment environment does not include roslaunch, run the following in two separate terminals with the SDK environment loaded:
# 终端 1:Quest UDP -> DDS
export LEJU_ASSETS_PATH="$PWD/src/leju_assets"
quest_udp_to_dds_node# 终端 2:默认绝对 IK
export LEJU_ASSETS_PATH="$PWD/src/leju_assets"
quest_vr_abs_control_nodeMinimal Secondary Development Skeleton
#include <lejusdk-vr/lejusdk_vr.h>
int main() {
const auto version = leju::RobotVersion::from_env();
leju::vr::RobanVRAPI vr(version);
if (!vr.initialize()) return 1;
leju::vr::ControllerState state;
if (vr.getControllerState(state)) {
// 在这里根据服务端的实际状态选择后续功能。
}
vr.shutdown();
return 0;
}User projects must use C++17 and link the corresponding SDK shared libraries. src/lejusdk/examples/CMakeLists.txt in the repository is the actual reference for linking lejusdk-lowlevel and lejusdk-vr; it is for your own programs and does not mean the Lejulab_ARM SDK needs to be rebuilt.
Reading state does not drive the robot. Any publish*Cmd(), mode switch, startRuntime(), startMotion(), or playTact() may cause the robot to move. Before testing on a real robot, you must secure the robot, clear the work area, confirm the emergency stop is available, and have on-site personnel supervise.
References
The interface names, data types, and examples in this documentation set are based on the following files in the development package:
installed/include/lejusdk-lowlevel/robot_api/robot_base.hinstalled/include/lejusdk-lowlevel/data_types.hinstalled/include/lejusdk-vr/vr_api/vr_base.hinstalled/include/lejusdk-vr/data_types.hsrc/lejusdk/examples/src/leju_launch/