[ODE] problem with stops
ray@his.atr.co.jp
ray at his.atr.co.jp
Mon Jul 14 01:28:01 2003
ODE:
I have implemented angle motors with stops, but the stops do
not work. The joints continue rotating in one directions, like
wheels on axles. Any advice?
Tom Ray
----
#define PI 3.141529654f
dBodyID body;
dJointID motor;
...
motor = dJointCreateAMotor(world, 0);
dJointAttach(motor, body, Seg2.body);
dJointSetAMotorMode(motor, dAMotorUser);
dJointSetAMotorNumAxes(motor, 3);
dBodyGetRelPointPos(body, 1, 0, 0, xyzNRF);
dJointSetAMotorAxis (motor, 0, 2, xyzNRF[0], xyzNRF[1], xyzNRF[2]);
dBodyGetRelPointPos(body, 0, 1, 0, xyzNRF);
dJointSetAMotorAxis (motor, 1, 2, xyzNRF[0], xyzNRF[1], xyzNRF[2]);
dBodyGetRelPointPos(body, 0, 0, 1, xyzNRF);
dJointSetAMotorAxis (motor, 2, 2, xyzNRF[0], xyzNRF[1], xyzNRF[2]);
dJointSetAMotorParam (motor, dParamLoStop, -PI / 20);
dJointSetAMotorParam (motor, dParamLoStop2, -PI / 20);
dJointSetAMotorParam (motor, dParamLoStop3, -PI / 20);
dJointSetAMotorParam (motor, dParamHiStop, PI / 20);
dJointSetAMotorParam (motor, dParamHiStop2, PI / 20);
dJointSetAMotorParam (motor, dParamHiStop3, PI / 20);