Skip to content

DRCL-USC/Learning_MPC_Jumping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Variable-Frequency Model Learning

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

How to cite

@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}}

Prerequisites

  • 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
    

Training and evaluation

  • 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

Real-time MPC Execution

Prerequisites

Get jumping reference

cd hw_exp/a1_robot_code_jumpMPC/Controllers/optimization_data/jump2D/MDC
python parse_data_new.py

Build and run

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")

Contact Information:

Chuong Nguyen -- [email protected] Abdullah Altawaitan -- [email protected] Thai Duong -- [email protected]

About

Learning Model for Aggressive Jumping Maneuvers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published