This repo implements a controller for the H1-2 robot.
You can control the position and orientation of the two end-effectors.
This repo is archived and read-only; future development is continued in h12_ros2_controller repo.
- Install Python dependencies from
environment.yml
:conda env create -f environment.yml
- All dependencies are available on pip, so using pip for installation should also work.
- Install the Unitree Python SDK from here so the code can communicate with the robot.
archive/
contains the old controller implementation.assets/
contains robot description files.data/
contains data such as joint configurations.h12_controller/
:utility/
contains useful scripts to inspect robot descriptions, process collision pairs, and lock the robot configuration.robot_model.py
tracks robot states and provides useful functions for kinematics, Jacobians, etc., using Pinocchio.controller.py
solves inverse kinematics and provides functions to control end-effectors and query their states.channel_interface.py
implements a publisher for motor commands and a subscriber for motor states using the Unitree Python SDK.
-
Kinematics Tracker & Solver (
robot_model.py
)- Initialize using robot description file.
- Subscribe to robot motor states; track joint positions
$q$ and torque$\tau$ . - Given a body name, return the transformation matrix.
- Given a body name and target position, solve inverse kinematics (avoid self-collision using pink).
- Given a body name, return the Jacobian.
- Given a body name, return the estimated wrench.
- Given a configuration, check validity (joint limits, collisions, etc.).
-
Joint Controller (
controller.py
)- Publish motor commands.
- Control modes: position, velocity, force (Motor SDK).
- Import the kinematics tracker & solver to track robot states.
- Implement position, velocity, and force control routines for left and right arms.
- Add safety threshold on moving velocity.