I had a lot of fun with Bullet but slightly less recently. I need to control the angle of a 6DOF join - the angle is changing over time. I am using a motors and try compute the velocity to move to the angle to the targeted value. Here is the magic:
Code: Select all
btScalar currentAngle = joinConstraint->getRotationalLimitMotor(i)->m_currentPosition;
joinConstraint->getRotationalLimitMotor(i)->m_targetVelocity = (targetedAngle - currentAngle) * 30;
joinConstraint->getRotationalLimitMotor(i)->m_maxMotorForce = 10.0f;
I looked at the MotorDemo and it seems like I doing something similar.
I look at the code of the motors and it seems to be doing a lot of smart things. Is there something I've mis configured?
I remember hearing about PID controller back at school. Should I replace the motors with one of this PID monster?
Have anyone done something similar that could lead me on the right direction.
Thanks in for any help or thoughts.
Julien