Humanoid Line Follower
Unitree H1-2 as a Camera-Guided Line Follower
A technical challenge from the Robotics40 training course on the Unitree H1-2: make the 70 kg humanoid walk along a 5 cm tape on the floor using only the RealSense D435i in its head as position feedback, and stop by itself at the finish bar. The robot moves with Unitree's walking controller (LocoClient.Move); the challenge is the closed loop that decides which velocities to command from what the camera sees. It is not a wheeled line follower: the camera is 1.7 m above the floor with a blind zone in front of the feet, the image sways with every step, the gait responds with delay, the heading drifts about 2°/s and there is no odometry.
The solution is split into perception, estimation, control, supervisor and logging blocks, and the same code runs in simulation and on the robot. Perception works on the infrared image projected to a bird's-eye view of the floor, with an adaptive relative-contrast threshold that keeps detecting the tape inside shadows (2,897 points at 1.0 cm error, versus 15 points and 67% false detections with a fixed threshold). Control is pure pursuit with a short lookahead and gyro-based drift compensation, and the supervisor handles waiting, tracking, line loss, finish and emergency stop. Validated in a MuJoCo simulator with the measured camera intrinsics and gait delay: 12/12 successful runs over 4 track levels; on the level 3 track (curves, a 40 cm gap and a shadow) the robot stays on average 2.7 cm from the tape. Testing on the real robot is the next step.
- Camera Geometry, Calibration and Bird's-Eye-View Perception
- Pure-Pursuit Control with IMU-Based Drift Compensation
- Supervisor State Machine and Safety for a Walking Humanoid
For more information about the project, check the following links:
Source code (H1_2_Humanoid_Control / tareas / seguidor_linea)