Berkeley Humanoid Lite Docs
  • Home
  • Releases
  • Getting Started with Hardware
    • Materials and Parts (BOM)
    • Preparing the Tools
    • 3D Printing Instructions
    • Building the Actuator
    • Flashing the Motor Controllers
    • Building the Robot
  • Getting Started with Software
    • Software Development Environment Overview
    • Training Environment
    • Sim2sim Validation
    • The On-board Computer
    • Motion Capture System
  • lerobot Integration
  • In-depth Contents
    • Field Oriented Control (FOC) Operation
    • Motor Controller Firmware Execution Timing Information
    • Motor Characterization
    • Actuator Characterization
    • CAN Communication
    • Joint ID Mapping
    • Exporting Robot Description Files from Onshape
    • Domain Randomizations for Training Locomotion
  • Contribute
Powered by GitBook
On this page
  • Install Dependencies
  • Controller
  • Launching the MuJoCo environment
  1. Getting Started with Software

Sim2sim Validation

PreviousTraining EnvironmentNextThe On-board Computer

Last updated 1 month ago

After finish training the policy, we can first put it into a different physics simulator to validate the policy. This procedure is typically called sim2sim validation.

Here, we use as the sim2sim physics engine.

Install Dependencies

We should have the dependencies installed during the previous section, when setting up the training environment. Run the install script again to make sure we have everything ready.

pip install -r ./requirements.txt

Controller

The sim2sim will read user commands from a gamepad controller, just like what the real robot would do. Plug the joystick controller in the host computer before running the sim2sim script.

Note

Getting USB gamepad controller working in Linux might be tricky. Here are some resources that might be helpful if you run into troubles reading from the joystick:

Launching the MuJoCo environment

After everything is set up, we can now test our newly trained policy in MuJoCo!

Run this script to launch the sim2sim environment. The Python script creates threads to handle joystick and policy inference. These threads communicate with the main physics simulation thread via UDP, mimicing the real-world deployment scenario.

python ./scripts/sim2sim/play_mujoco.py --config ./configs/policy_latest.yaml

Replace the file argument after --config to test different policies.

By default, the policy is trained to follow user command of linear velocity on X (forward-backward) and Y (sideways) axes, and angular velocity on Z (turning).

MuJoCo
https://notes.tk233.xyz/tools/ubuntu/solving-gamepad-not-detected-on-ubuntu-22.04
https://unix.stackexchange.com/questions/559652/udev-rule-doesnt-trigger-when-usb-gamepad-connected
https://www.xmodulo.com/change-usb-device-permission-linux.html
https://hackaday.com/2009/09/18/how-to-write-udev-rules/