Roban2 Docs
Feature Examples

Roban Body Simulation

Description

Lejulab_ARM provides a MuJoCo simulation launch chain that lets you verify the SDK state subscription and control flow without connecting real robot hardware. launch_mujoco_sim.sh starts the MuJoCo robot simulation, the gamepad, the RL controller, and the data recorder at the same time.

  • Note: installed/ contains precompiled artifacts shipped with the package, and the executables must match the architecture of the host machine (uname -m must match the output of file installed/bin/leju-mujoco-sim). An architecture mismatch produces ELF ... not found, Syntax error: "(" unexpected, or garbled output; this is not a script syntax error.
  • Note: In the terminal, you must set ROBOT_VERSION first and then run source installed/setup.bash; the order cannot be reversed.
  • Main files and brief descriptions:
    1. src/leju_launch/scripts/launch_mujoco_sim.sh: simulation launch orchestration (MuJoCo + gamepad + RL controller + recorder)
    2. src/leju_launch/scripts/_launch_common.sh: common launch and DDS logic
    3. src/leju_assets/models/biped_s17/: Roban2.2 model
    4. src/leju-controllers/leju-rl-controller/config/17/: Roban2.2 controller and remote controller configuration

Simulation Steps for the Robot's Host and Onboard Computers

  1. First, connect to the robot's onboard computer using realVNC, and confirm that the host machine architecture matches the precompiled artifacts

  2. In the Lejulab_ARM directory, run:

cd ~/Lejulab_ARM
uname -m
file installed/bin/leju-mujoco-sim
file installed/bin/run_rl_controller

If uname -m reports x86_64 while the program shows ARM aarch64, this package cannot run on the current computer; you need a development package that matches the host architecture. Re-running source installed/setup.bash will not solve this.

  1. Set the version and load the environment

    • Set the robot version first, then load the environment:

      cd ~/Lejulab_ARM
      export ROBOT_VERSION=17
      source installed/setup.bash
    • ROBOT_VERSION=17 corresponds to Roban2.2: model scene_rl.xml, controller controller_manager.yaml, remote controller teleop_bindings.yaml.

  2. Start the simulation

    #如果需要模拟遥控器节点需要先停止遥控器服务
    #sudo systemctl stop lejulab_joy_monitor.service
    
    sudo bash src/leju_launch/scripts/launch_mujoco_sim.sh
    • If you need ordinary DDS (without shared memory) for a first verification, append --no-shm:

      sudo bash src/leju_launch/scripts/launch_mujoco_sim.sh --no-shm
    • The programs started by this script are as follows:

      ProgramRequiredRole
      leju-mujoco-simYesLoads scene_rl.xml and provides DDS data for the MuJoCo robot, sensors, and motors
      run_rl_controllerYesRuns the controller manager and RL controller
      leju-joystickNoReads an ordinary gamepad; not started when --auto-start is added
      lejusdk_recorderNoRecords DDS data according to recorder.yaml
    • If any required program exits, the launcher stops the other child processes; an optional program exiting does not terminate the simulation on its own.

  3. (Optional) Verify SDK state subscription

    • Keep the simulation terminal running, and open a new terminal with the same DDS configuration:

      cd ~/Lejulab_ARM
      export ROBOT_VERSION=17
      source installed/setup.bash
      export CYCLONEDDS_URI="file://$PWD/src/leju_launch/config/cyclonedds.xml"
      hw_state_subscriber
    • You can also run joint_state_subscriber and imu_data_subscriber separately. Once state reading works normally, test the control interfaces according to the Interface Usage Documentation.

Expected Results

Connect to the robot's onboard computer remotely using realVNC. The MuJoCo simulation window opens and runs the robot physics simulation, the gamepad window shows the gamepad button states, and the subscription terminal continuously outputs joint/IMU/hardware state data.

VNC simulation

Interface Definitions

  • Subscription type (state reading): hw_state_subscriber, joint_state_subscriber, imu_data_subscriber

  • Control type: see the step-by-step tutorial in the Interface Usage Documentation

  • Common troubleshooting commands:

    bash scripts/diagnostics/check_dds.sh
  • Common issues: setup.bash prompts you to set the version first → check the order of export ROBOT_VERSION and source; the simulation window fails to open → check the graphical display environment (SSH/containers require properly configured display forwarding or graphics devices); no data in the subscription → verify that ROBOT_VERSION and CYCLONEDDS_URI are consistent across both terminals.