RobotLocomotion / LittleDog

Example of quadruped planning and control in drake using LittleDog -- a small quadruped robot from Boston Dynamics.
Other
67 stars 28 forks source link

Inverse dynamics for control #3

Open GuiyangXin opened 7 years ago

GuiyangXin commented 7 years ago

Hello all, I am using Drake to implement model-based control on LittleDog. I encountered two questions. First, why will LittleDog fall down when I just run LittleDog.runPDhome? Secondly, I compute joint torques using inverse dynamics when the robot is in static state. Then apply these torques to do simulation. I think LittleDog can stand on the ground. But it failed, i.e., LittleDog fall down very quickly. Is anyone can help me? I am a beginner to use drake.

RussTedrake commented 7 years ago

I've confirmed that the littledog runPDhome test appears broken on master. I'm sorry to see that, and thank you for letting us know.

We're in the midst of moving everything to a much stronger implementation in c++, so aren't focused on supporting the matlab versions anymore. But if you are falling through the ground, you might make sure that you compiled drake with bullet support enabled.

We'll move this example to C++ soon and it will be much better (and will not break)

GuiyangXin commented 7 years ago

Glad to hear your response Russ. In my case, LittleDog does not fall through the ground. It just fall down on the ground. What's more, is my idea correct to implement static standing on ground by calculating inverse dynamics? In this case, C(q,v,f_ext)=G=B*tau. But as a constrained robot, the dynamic equations of LittleDog is H(q)*qddot+C(q,v)=B*tau+J'_c*λ. λ means the forces enforced on feet. So, is λ=f_ext right in Drake? Do I need to optimise λ in order to solve tau? If I need to do this, my code as follows is wrong because I do not take the constraint forces into consideration. [H,C,B] = manipulatorDynamics(sys,qstar,zeros(nq,1)); tau=pinv(B)*(H*zeros(nq,1)+C);

wxmerkt commented 7 years ago

@GuiyangXin responding here to email - is little dog falling to ground "slowly" [compared with 0 torque case]? I believe the issue might be with the constant torque without PD feedback/torque and numerical integration errors that slowly accrue over the 1000 timesteps

GuiyangXin commented 7 years ago

Thank you Wolf and Russ, I have done inverse dynamic control for LittleDog based on your help. Thanks again.