Page 1 of 1

Does btMultiBody::addJointTorque work?

Posted: Fri Sep 26, 2014 4:43 am
by teh_ballerer
I understand the Featherstone related code is still very much a work in progress. Using the Featherstone demo as a guide, I have constructed a btMultiBody consisting of the base and one child link, connected by a revolute joint. The multi body falls to the ground and comes to rest during the simulation as expected, with it's revolute joint appearing to constrain the links properly.

I would now like to power the joint that connects the two links. I would prefer to do this by applying joint torques because I'm trying to implement a research paper which applies joint torques to animate their multi body characters.

If I call btMultiBody::addJointTorque(0, F) to add torque to the joint created on multibody link 0, where F is my force, before every simulation step, it has no effect. I've tried small (1) and large (2000) values for F, and it makes no difference.

I can manage to make the joint move by creating a btMultiBodyJointMotor for my btMultiBody, and adding it to the dynamicsWorld's constraints:

Code: Select all

btMultiBodyJointMotor * con = new btMultiBodyJointMotor(multiBody,0,3,500000); 
this->dynamicsWorld->addMultiBodyConstraint(con);

However this motor is setup by specifying a target velocity and the max force used to reach the target velocity, and as I said earlier, I would like a way to simply add joint torques so that I can more easily implement a research paper. It looks like btMultiBody::addJointTorque is the answer, but am I using it incorrectly, or is it not fully implemented yet?

P.S. I'm using Bullet 2.82 with debug drawing.

Re: Does btMultiBody::addJointTorque work?

Posted: Fri Sep 26, 2014 4:44 am
by teh_ballerer
I resolved this by simply upgrading from bullet 2.82 to building the current head of bullet3 master from source (46bd05f4f769ae0c6229489bb515ea6e471f17b7).

https://github.com/bulletphysics/bullet ... 6e471f17b7

And btMultiBody::addJointTorque works now with no modifications to my code. Awesome!

Re: Does btMultiBody::addJointTorque work?

Posted: Thu Oct 13, 2016 3:45 pm
by Erwin Coumans
Please update to Bullet 2.85, it has many improvements to btMultiBody.

There is pybullet and URDF/SDF file loading, which makes it much easier to prototype a btMultiBody, with Featherstone joints, limit and also motors.

Re: Does btMultiBody::addJointTorque work?

Posted: Thu Oct 13, 2016 3:45 pm
by Erwin Coumans
Please update to latest Bullet (2.85 at this momemt), it has many improvements to btMultiBody.
See https://github.com/bulletphysics/bullet3/releases

There is pybullet and URDF/SDF file loading, which makes it much easier to prototype a btMultiBody, with Featherstone joints, limit and also motors.