This repository is an open-source code for the course project of the MIT 2.74 Bio-inspired Robotics class.
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
- Choose the task ('rigid' or 'spine') in
main.m
- Run
main.m
- (Optional) If you change the dynamics in either
buildLegDynamics_sym.m
orbuildSpineLegDynamics_sym.m
, you have to run this script first individually. It will update codegen codes. - Some keyboard controls:
L
: forward velocity commandH
: backward velocity commandR
: reset environmentV
: pause simulationESC
: end simulation and save data
Rigid robot:
Spine Robot:
You can check more analysis results in analysis
folder.
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.