bulletphysics / bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
http://bulletphysics.org
Other
12.63k stars 2.88k forks source link

Inverse dynamics not working with a floating base #541

Closed DivideByZero2 closed 8 years ago

DivideByZero2 commented 8 years ago

Created using btMultiBodyTreeCreator. Fixed base works correctly

erwincoumans commented 8 years ago

The first inverse dynamics example code didn't support floating base. I modified the example to support floating base, by adding 6 dummy values that represent the floating base. See https://github.com/bulletphysics/bullet3/pull/542

DivideByZero2 commented 8 years ago

Thanks for the example. It looks like I just had a bug in my code (forgot the extra 6 dummy values). I think there might be a small typo in the example.

qdot6[6+i] = qdot6[i]; q6[6+i] = q6[i]; joint_force6[6+i] = joint_force6[i]; => qdot6[6 + i] = qdot[i]; q6[6 + i] = q[i]; joint_force6[6 + i] = joint_force[i];