This branch contains the code for learning the residual dynamic model for aggressive jumping maneuvers.
Paper: Variable-Frequency Model Learning and Predictive Control for Jumping Maneuvers on Legged Robots arXiv: https://arxiv.org/pdf/2407.14749
Hardware Experiment Video: https://www.youtube.com/watch?v=oqF4PsurAxU
@ARTICLE{10806807,
author={Nguyen, Chuong and Altawaitan, Abdullah and Duong, Thai and Atanasov, Nikolay and Nguyen, Quan},
journal={IEEE Robotics and Automation Letters},
title={Variable-Frequency Model Learning and Predictive Control for Jumping Maneuvers on Legged Robots},
year={2025},
volume={10},
number={2},
pages={1321-1328},
keywords={Robots;Accuracy;Legged locomotion;Predictive models;Robustness;Hardware;Aerodynamics;Uncertainty;Load modeling;Real-time systems;Model learning for control;legged robots;whole-body motion planning and control},
doi={10.1109/LRA.2024.3519864}}
-
tested with Ubuntu 20.04, Python 3.8 and Python 3.9
-
torch>=2.0.0, pandas, matplotlib
-
or use RAL_env.yml instead to setup environment for training:
conda env create -f RAL_env.yml conda activate RAL_env.yml
- Run
train_full.py
to train the model
cd residual_learning
python3 train_full.py --total_steps=20000 --learn_rate=2e-4 --num_points=11
- Run evaluation
cd residual_learning
python3 evaluation_full.py
- Generate a dataset for training and testing
cd residual_learning/data/mix-20traj/fmpc_pd/
python generate_dataset.py
- Convert the PyTorch model to Torch Script, then Serialize
cd residual_learning
python3 convert_to_hardware_full.py
- eigen-3.3.7
- lcm-1.4.0
- libtorch-cxx11--2.0.1 (link to download: https://drive.google.com/file/d/1n9Dj2QZbY6YWF01F3Eb1au3kTgvv5Ean/view?usp=sharing)
- MoCap system
cd hw_exp/a1_robot_code_jumpMPC/Controllers/optimization_data/jump2D/MDC
python parse_data_new.py
cd hw_exp/a1_robot_code_jumpMPC
mkdir build
cd build
cmake ..
make -j4
Note: Check the path of the downloaded libtorch library in a1_robot_code_jumpMPC/Controllers/CMakeLists.txt
list(APPEND CMAKE_PREFIX_PATH "/path/to/the/libtorch")
Chuong Nguyen -- [email protected] Abdullah Altawaitan -- [email protected] Thai Duong -- [email protected]