I'm building a simulator for a 4-legged robot using Bullet, every leg has 2 hinge constraints with motors (simulating servos).
Called at each step :
Code: Select all
btScalar velocity(1.0), maximpulse(10.0);
btScalar diff= phinge->getHingeAngle() - target_angle;
if(diff < -epsilon)
phinge->enableAngularMotor(true, velocity, maximpulse);
else if(diff > epsilon)
phinge->enableAngularMotor(true, -velocity, maximpulse);
else
phinge->enableAngularMotor(false, 0.0, 0.0);
I simply can't simulate a slow but high-torque motor.
Please help me, I don't understand what's the problem here...
Thanks.