System
Running with the following system configuration:
Install Dependencies
Copy sudo apt install ninja-build
sudo apt install build-essential
Copy sudo apt install \
ros-humble-pinocchio \
ros-humble-ros2-control \
ros-humble-gazebo-ros2-control \
ros-humble-joint-state-broadcaster \
ros-humble-joint-state-publisher-gui \
ros-humble-xacro
Copy # pip install onnxruntime
Copy cd /tmp
wget https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/onnxruntime-linux-x64-1.7.0.tgz
tar xf onnxruntime-linux-x64-1.7.0.tgz
mkdir -p ~/.local/bin ~/.local/include/onnxruntime ~/.local/lib ~/.local/share/cmake/onnxruntime
rsync -a /tmp/onnxruntime-linux-x64-1.7.0/include/ ~/.local/include/onnxruntime
rsync -a /tmp/onnxruntime-linux-x64-1.7.0/lib/ ~/.local/lib
wget https://raw.githubusercontent.com/leggedrobotics/ocs2/refs/heads/main/ocs2_mpcnet/ocs2_mpcnet_core/misc/onnxruntime/cmake/onnxruntimeConfig.cmake -O ~/.local/share/cmake/onnxruntime/onnxruntimeConfig.cmake
wget https://raw.githubusercontent.com/leggedrobotics/ocs2/refs/heads/main/ocs2_mpcnet/ocs2_mpcnet_core/misc/onnxruntime/cmake/onnxruntimeVersion.cmake -O ~/.local/share/cmake/onnxruntime/onnxruntimeVersion.cmake
cd -
Copy export LD_LIBRARY_PATH = $HOME/.local/lib:$LD_LIBRARY_PATH
Setting up environment
Create the project directory and clone the required repositories. In this example, we will be working in the ./berkeley-humanoid
folder.
Copy mkdir ./berkeley-humanoid/
cd ./berkeley-humanoid/
git clone https://github.com/isaac-sim/IsaacLab.git
git clone https://github.com/HybridRobotics/isaac_berkeley_humanoid.git
Create conda environment
Copy conda create -yn humanoid-isaaclab python= 3.10
conda activate humanoid-isaaclab
Install Python package dependencies for IsaacSim
Copy pip install isaacsim-rl isaacsim-replicator isaacsim-extscache-physics isaacsim-extscache-kit-sdk isaacsim-extscache-kit isaacsim-app --extra-index-url https://pypi.nvidia.com
Go to the IsaacLab directory and install RSL-RL along with IsaacLab
Copy cd ./IsaacLab
./isaaclab.sh --install rsl_rl
cd ..
Accept the EULA when prompted.
Go to the Berkeley Humanoid extension and install this module
Copy cd ./isaac_berkeley_humanoid/exts/berkeley_humanoid
pip install -e .
cd ../../..
Training the policy
Copy cd ./isaac_berkeley_humanoid/
Copy python ./scripts/rsl_rl/train.py --task Velocity-Rough-Berkeley-Humanoid-v0
For first-time running the script, it might take a few minutes for IsaacLab to load all the configuration and compile the shaders.
Running in headless mode
Copy python ./scripts/rsl_rl/train.py --task Velocity-Rough-Berkeley-Humanoid-v0 --headless
Test out the trained policy
Copy python ./scripts/rsl_rl/play.py --task Velocity-Rough-Berkeley-Humanoid-Play-v0
Sim2sim transfer
source ros dependencies
Copy source /opt/ros/humble/setup.sh
source /usr/share/colcon_cd/function/colcon_cd.sh
Copy mkdir -p ./ros2_ws/src/
cd ./ros2_ws/src/
Copy # cd ./ros2_ws/src/
git clone git@github.com:qiayuanl/berkeley_humanoid_description.git
git clone git@github.com:qiayuanl/legged_control2.git
# cd ./ros2_ws/src/berkeley_humanoid_description
git checkout feature/ament_cmake
Copy # cd ./ros2_ws/
colcon build --packages-select berkeley_humanoid_description
Copy colcon build --symlink-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo --event-handlers console_direct+ --packages-up-to legged_rl_controllers
Copy source ./install/setup.bash
Copy ros2 launch berkeley_humanoid_description view_robot.launch.py
Copy ros2 launch berkeley_humanoid_description gazebo.launch.py