Roban2 Docs
Development Interfaces

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/ToolPublic Entry PointFunctional 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 toolplay_audio_cliRequests 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.bash

You 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.sh

launch_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_init

vr_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 TaskPrimary APIDetailed Tutorial
SDK initialization, directories, and basic environmentGlobalRobot, RobanVRAPIRoban2 C++ SDK Introduction
DDS configuration, shared memory, and cross-machine troubleshootingCYCLONEDDS_URI, Cyclone DDS, RouDiDDS Communication and Remote Development
Basic information, hardware, joints, and IMUgetMotorNames(), subscribeHardwareState(), subscribeRobotState(), subscribeImuData()Robot Information and Status
Standard gamepad, Quest controller, and bone posessubscribeJoyData(), subscribeQuestJoystickData(), subscribeQuestBonePoses()Robot Information and Status
Arms, head, waist, and handspublishArmJointCmd(), publishHeadJointCmd(), publishWaistJointCmd(), publishHandCmd()Body Part Control
Advanced full-joint controlpublishRobotCmd()Body Part Control
Walking velocity and posture heightpublishVrVelocityCmd(), publishVelocityCmd(), publishPostureHeightCmd()Robot Locomotion and Controllers
Controllers, body part modes, and runtimegetControllerState(), switchController(), set...Mode(), getRuntimeState(), startRuntime(), stopRuntime()Robot Locomotion and Controllers
CSV motion and tact actionsgetMotionState(), startMotion(), playTact()Motion and Audio Tools
Local audio filesplay_audio_cliMotion and Audio Tools

DDS Topic Overview

FunctionSDK Data TypeTopic
Hardware statusStringData/rt/hardware/state
IMUImuData/rt/imu_state
Joint states/commandsRobotState / RobotCmd/rt/joint_state / /rt/joint_cmd
Standard gamepadJoyData/rt/joy
Hand commandsHandCmd/rt/hand_cmd
Posture heightdouble parameter wrapper/rt/posture_height_cmd
StopWrapped internally by the SDK/rt/hardware/stop
Arm/head/waistJointTrajectoryPoint/rt/arm_trajectory, /rt/head_trajectory, /rt/waist_trajectory
Final velocity/VR input velocityVelocityCmd / VrVelocityCmd/rt/cmd_vel / /rt/vr/cmd_vel
Quest bones/gamepadQuestBonePosesData / 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 when use_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:=17

To specify a Quest IP or use incremental IK:

roslaunch leju_launch vr_teleop.launch \
  robot_version:=17 \
  quest_ip:=<Quest-IP> \
  use_incremental_ik:=true

If 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_node

Minimal 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.h
  • installed/include/lejusdk-lowlevel/data_types.h
  • installed/include/lejusdk-vr/vr_api/vr_base.h
  • installed/include/lejusdk-vr/data_types.h
  • src/lejusdk/examples/
  • src/leju_launch/