erwincoumans / motion_imitation

Code accompanying the paper "Learning Agile Robotic Locomotion Skills by Imitating Animals"
Apache License 2.0
1.16k stars 291 forks source link

Unexpected behavior on hardware running whole_body_controller_example.py #51

Closed yueatsprograms closed 3 years ago

yueatsprograms commented 3 years ago

First, thank you for open sourcing your code! I am using the baseline MPC controller in your whole_body_controller_example.py. I have made minimal changes to your code so it's working in pybullet simulation.

However, it's producing unexpected behavior on my A1 hardware, if I switch on the use_real_robot flag. The back legs would suddenly jerk backwards, almost breaking the hardware. I tried lowering the gains by a large factor, and suspending the robot to observe the trajectories. I observe the back legs tilting inwards rubbing each other.

Have you made modifications to your A1 that might have made the code unable to work on a standard A1? Do you have suggestions to making your baseline MPC run on a real robot?

Thank you!

Yu

erwincoumans commented 3 years ago

Hi Yu,

The code should work unmodified with pybullet simulation:

python3 motion_imitation/examples/whole_body_controller_example.py should run but no display python3 motion_imitation/examples/whole_body_controller_example.py --show_gui=True should show pybullet --use_real_hardware=True should run on the real A1

Make sure the loop runs fast in simulation first. You can print the timings, you need around 1ms preferably (or 2ms at most). Enable the print("actual_duration=", actual_duration), only in simulation, comment out on real robot.

We tried on several different standard (unmodified) A1 robots. Not sure what is going on. Do the regular unitree test samples work? You need a fast CPU, we use Apple Mini M1 (Apple Silicon) mounted on the real robot, using 12V connection, but a fast Linux PC (Intel or AMD Ryzen 3900x etc) should work well too.

Good luck!

erwincoumans commented 3 years ago

We can't support real hardware, closing.