Skip to content

Latest commit

 

History

History
59 lines (48 loc) · 2.9 KB

README.md

File metadata and controls

59 lines (48 loc) · 2.9 KB

SpineLeggedRobot2D

This repository is an open-source code for the course project of the MIT 2.74 Bio-inspired Robotics class.

Title: Galloping with Spine

Here, we implemented a 2D legged robot (2 legs) with a spinal joint and investigated the benefit of the spinal joint. The code stack is written in MATLAB and includes the derivation of the dynamics equation of motion, implementation of the simulator, and convex model predictive controller(MPC).

Contributors: Ho Jae Lee, Jaeyoun Choi, Harry Lee
Video Link: https://youtu.be/XR6XnnfqJGA


User Manual

How to Run the Simulation

  1. Choose the task ('rigid' or 'spine') in main.m
  2. Run main.m
  3. (Optional) If you change the dynamics in either buildLegDynamics_sym.m or buildSpineLegDynamics_sym.m, you have to run this script first individually. It will update codegen codes.
  4. Some keyboard controls:
    • L : forward velocity command
    • H : backward velocity command
    • R : reset environment
    • V : pause simulation
    • ESC : end simulation and save data

Results

Rigid robot:

         

Spine Robot:

         

You can check more analysis results in analysis folder.

Code Explanation

main.m : Main script that initiates Environment and Controller, and runs the experiment.
setupProject.m : Setup rigid robot.
setupProject_Spine.m : Setup spine robot.
buildLegDynamics_sym.m : Generate dynamics equation of motion for rigid robot using Lagrange equation of motion.
buildSpineLegDynamics_sym.m : Generate dynamics equation of motion for spine robot using Lagrange equation of motion.
Simulator.m : Class for dynamics simulator and renderer.
Logger.m : Class data logger and video recording
Environment.m : Class for overall environment. It inherits Simulator and contains Logger.
ConvexMPCController.m : Class for convex MPC controller.