erwincoumans / motion_imitation

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

position drifting happens when set v=0 in whole_body_controller_example.py #66

Closed zhuyijie88 closed 3 years ago

zhuyijie88 commented 3 years ago

In this function,

_generate_example_linear_angular_speed(t)

I set the linear and angular velocity both zero. When simulated robot A1 marks time for tens of seconds, it drifts from the origin position gradually. I want to know the reason of this phenomenon, is it attributed to unprecise dynamic modeling? How do we fix it?

erwincoumans commented 3 years ago

The mpc model (inertia, center of mass location) is not very accurate, probably causing some drift. Also, convex mpc ignores feet mass, but there is some mass. There maybe other reasons for drift (feet collision, bit of sliding perhaps).

One workaround (hack) could be to measure drift compensate through the velocity.