Skip to content

Dynamics-Learning-Workshop/Legged-Robots-Bootcamp

Repository files navigation

Bootcamp for Legged Robots

doggie trot walker walk

Introduction

This is a learning bootcamp for legged robotics newbies. Nevertheless, fundamentals in robotics are grossly omitted; for those who have some basic knowledge, you are in the right place. In which, we have 2 main camps:

  1. 3D Walker: Naive simulator from scratch, which consists the development of:

    Goal:

    Walker 3D Control Partition

    via:

    • dynamics modelling (Euler-Lagrange Equations),
    • fixed points with Poicare maps,
    • forward and inverse kinematics,
    • trajectory optimization, and
    • feedback linearization.

    Double Pendulum Passive Walker
    Inverse Kinematics 3D Inverse Kinematics 2D
    Spring Mass Damper Raibert Hopper
    Bounce Projectile
  2. Quadruped: Basic controller design for quadruped with unitree Go1 in ROS/Gazebo simulation:

    Goal:

    trot trot
    pronk dance

    via:

    • forward and inverse kinematics,
    • dynamics modelling (Euler-Lagrange Equations),
    • quadratic programming, and
    • cycloid trajectories.

    stand swing
    balance squiggle

Usage

For biped scripts:

  1. Please first setup conda environment.
    git clone https://github.com/Dynamics-Learning-Workshop/Legged-Robots-Bootcamp.git
    
    conda create --name leg_bootcamp
    conda activate leg_bootcamp
    
    cd ./Legged-Robots-Bootcamp/biped_ctrl_scripts
    conda install --file setup.txt
    
  2. For 3D modelling, please do the following to wrap up python scripts in C, which will take around 1 minute (tested on M1 pro):
    cd ./biped_ctrl_scripts/5_walker_3D_control/f_walker_3D/dynamics/compiled_funcs
    python gen_lib.py
    
  3. Execute the python files.

For quadruped codes:

  1. Please follow this and that to setup the simulation environment.
    • please note that ROS is a prerequisite; we tested all the codes on ubuntu 20.04 + ROS Noetic.
    • also note that lcm, osqp and osqp-eigen should be installed.
    • I use tmux a lot, and this repo also used tmux. Please install tmux by sudo apt install tmux.
  2. Prepare a gaming controller that is compatible with /joy. Setup the controller via this instruction.
  3. My practice is to install unitree_ros and unitree_guide in one workspace, and this repo in another workspace.
# do sim_env install as instructed above

cd && mkdir -p leg_boot_ws/src && cd ~/leg_boot_ws_src
git clone https://github.com/Dynamics-Learning-Workshop/Legged-Robots-Bootcamp.git
  1. Say the workspaces are respectively leg_sim_ws and leg_boot_ws, first compile them with catkin_make, and then:
    cd ~ && ./leg_sim_ws/src/unitree_guide/sim.sh
    
  2. Then
    source ~/leg_boot_ws/devel/setup.bash 
    roslaunch quadruped_ros_ctrl ctrl.launch
    
  3. With the terminal, you will see some texts telling you the current FSM state. The control inputs via the controller are:

    PS4

Reference

Based on

  • UIC course (legged robotics) by Pranav Bhounsule,
    • I did my own implementation in Python
  • Open project by Boston Cleek and Unitree Guide.,
    • I took reference from the code structure
    • and designed my own controller that can
      • stand
      • walk
      • pronk
  • Simulation platform developed by UniTree Gazebo.
    • my implementation is based in Gazebo
@misc{pranav,
  title        = {Legged Robotics},
  author       = {Pranav Bhounsule},
  year         = 2021,
  note         = {\url{https://pab47.github.io/legs.html} [Accessed: 17/Sep/2024]}
}

@misc{qcontrol,
  title        = {Quadruped Control},
  author       = {Boston Cleek},
  year         = 2021,
  note         = {\url{https://github.com/bostoncleek/quadruped_control} [Accessed: 17/Sep/2024]}
}

@misc{unitree,
  title        = {Unitree Ros},
  author       = {Unitree},
  year         = 2024,
  note         = {\url{https://github.com/unitreerobotics/unitree_ros} [Accessed: 17/Sep/2024]}
}

@inproceedings{gehring2013control,
  title={Control of dynamic gaits for a quadrupedal robot},
  author={Gehring, Christian and Coros, Stelian and Hutter, Marco and Bloesch, Michael and Hoepflinger, Markus A and Siegwart, Roland},
  booktitle={2013 IEEE international conference on Robotics and automation},
  pages={3287--3292},
  year={2013},
  organization={IEEE}
}