This repository contains all necessary resources for the summer simulations, divided into weekly tasks.
- Spawn Pupper/SO100 in MuJoCo, look into .mjcf format which is different from urdf/xacro.
- Check mass, joint and actuator limits, prop sensor config.
- Write a function to send torque cmd and check joint movement.
- Write a function to read and log prop sensor data to the terminal.
- Finally, add sliders to control joint angles and observe if it moves correctly.
-
Clone the repo
git clone --recurse-submodules https://github.com/AviralxD/the-sims.gitYou can also fork the repo, in that case be sure to
git fetchthe latest changes. -
Download mujoco and try loading some examples in the default viewer.
-
Convert the urdf to mjcf, you can use this repo. Try to mess around with the generated xml to understand how the mjcf format works.
Tip: joints and actuators need physics like damping, friction, limits etc; do look into contype and conaffinity.
Use this code as a template to build upon.
import mujoco
import mujoco.viewer
import numpy as np
import time
model = mujoco.MjModel.from_xml_path("path_of_model/model.xml")
data = mujoco.MjData(model)
for i in range(model.njnt):
name = mujoco.mj_id2name(model, mujoco.mjtObj.mjOBJ_JOINT, i)
print(f"Joint {i}: {name}")
with mujoco.viewer.launch_passive(model, data) as viewer:
while viewer.is_running():
mujoco.mj_step(model, data)
viewer.sync()
time.sleep(model.opt.timestep)
- mujoco docs
- mujoco_menagerie: compilation of mjcf files for various robots
- urdf2mjcf: urdf to mujoco converter
- mujoco_ros_pkgs: ROS1 wrapper for mujoco
-
Study rotations, forward and inverse kinematics from the provided resources.
-
Derive forward kinematics for the bots, write a function to get coordinates of the end-effector.
-
Write an IK solver by deriving the equations geometrically, limit yourself to 3 DOF.
-
Exercise:
For the SO-100, restrict the arm to 3 DOF by fixing the wrist and lower arm joint angles. Given a set of points, make the end effector go through these points via a cubic spline.For the Pupper, implement sine wave gait which varies the X and Z coordinates of the foot sinusoidally wrt time. Provide phase offsets to each leg and make the dog walk. -
Try to implement an iterative solver for your bot, and compare it with the geometrically derived alternative.
- Arjun's Glorious LaTeX
- Interactive example
- A Mathematical Introduction to Robotic Manipulation: After completing the tasks, go through the first three chapters thoroughly.
Follow the huggingface deep RL course, completing units 0, 1, 4, 5, 6, 8.
Read the introduction to RL, then proceed with the tasks detailed in the workplan.