-
Create a conda environment:
conda env create -f environment.yaml conda activate humanoid -
Install HumanoidBench benchmark.
cd src/env pip install -e . -
Download data.zip, unzip, and put it in
src/pkgs/RoHM/data. (You can directly download data.zip, or download each part from the following links.)The directory structure of
/src/pkgs/RoHM/datais - body_models: SMPL-X body model - checkpoints: RoHM checkpoints - eval_noise_smplx: Pre-computed motion noise for RoHM - smplx_vert_segmentation.json: SMPL-X vertices segmentation -
NOTE:
- More info can be found in HumanoidBench and RoHM.
- If you download the environment from HumanoidBench, please replace robots.py and wrapper.py, since they have been modified to get camera pose and robot global info, specifically,
class H1 in robots.py - camera_pose() - global_positioin() - global_orientation() class ObservationWrapper in wrapper.py - observation_space() - get_obs() - The interface of RoHM has been modified to facilitate calling.
-
Fill in your WANDB_API_KEY in the train.py. (wandb related settings can be found in config_model.py.)
os.environ['WANDB_API_KEY'] = 'xxxx' -
The humanoid task is set in src/config/config_env.py, and can be changed according to choices.
group.add_argument('--env', default='h1hand-run-v0', help='e.g. h1hand-walk-v0') -
Finally, just python script.
python train.py -
NOTE:
- Training curves can be found in
results/data_vis. - The results of baselines are taken from Humanoid-Bench and CQN-AS.
- The results of CQN-AS on
h1hand-sit_hard-v0,h1hand-balance_hard-v0,h1hand-stair-v0,h1hand-slide-v0, andh1hand-pole-v0, are reproduced accroding to the official implemention of CQN-AS. - For visualization, just
python *.py.
conda install -c conda-forge libstdcxx-ng
sudo apt install libgl1 libglx-mesa0 libgl1-mesa libgl1-mesa-glx
sudo apt install libgl1-mesa-dev libgl1-mesa-dri
sudo mkdir /usr/lib/dri
sudo ln -s /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so /usr/lib/dri/swrast_dri.so
sudo ln -s /usr/lib/x86_64-linux-gnu/dri/zink_dri.so /usr/lib/dri/zink_dri.so
- Could not get EGL display.
- Cannot initialize a EGL device display.
- AttributeError: module 'OpenGL.EGL' has no attribute 'EGLDeviceEXT'.
# * Reference: https://github.com/saqib1707/RL-Robot-Manipulation
conda install -c conda-forge glew
pip install pyrender PyOpenGL-accelerate
pip install pyopengl==3.1.4
pip install dm-control==1.0.19
5. 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'.
# * Please uninstall numpy and reinstall.
conda remove --force numpy
pip uninstall numpy
pip install numpy==1.23.4
pip install gymnasium==0.29.1
7. ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libGLEW.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
sudo apt install mesa-utils glew-utils libglew-dev
sudo apt install libosmesa6-dev
- NOTE:
- The code is tested on Ubuntu 20.04 and Linux Mint 22, packages maybe not found in your OS.
apt-cache search package-namecan be used to search relative packages.
- The code is tested on Ubuntu 20.04 and Linux Mint 22, packages maybe not found in your OS.
- To simplify implementation, the robot's global orientation is replaced with that of the pelvis joint. As a result, when visualizing long trajectory, you may notice a gradual deviation in their global orientation.
- The foundation model RoHM appears to be sensitive to certain random seeds. In other words, if a result from
[0, 1, 2]is suboptimal, you can try10. - TD-MPC2 is an excellent method, but it is extremely slow. Our experiments, including parameter tuning and formal evaluations, took over two months using four RTX 3090 GPUs (and even stronger). You can attempt to speed up the algorithm, but avoid using env parallelism, whether with AsyncVectorEnv or SubprocVecEnv, as it tends to flatten the learning curve. Don't waste time on this, this is the biggest lesson I learned from this work. At least, that was the outcome of my attempts.
- TODO. (I'll provide updates if I recall anything else.)
@article{zhang2025flam,
title={FLAM: Foundation Model-Based Body Stabilization for Humanoid Locomotion and Manipulation},
author={Zhang, Xianqi and Wei, Hongliang and Wang, Wenrui and Wang, Xingtao and Fan, Xiaopeng and Zhao, Debin},
journal={arXiv preprint arXiv:2503.22249},
year={2025}
}
This implementation is based on the following repo:
