[ODE] motor stops don't work
ray@his.atr.co.jp
ray at his.atr.co.jp
Mon Jul 14 19:38:02 2003
ODE:
I want to thank slipch and Martin for responding. I had already
set the FMax parameter > 0. At slipch's suggestion, I tried to
solve the problem with dJointSetAMotorAngle(), but it still
doesn't work. I attach a more complete code sample below.
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 joint;
dJointID motor;
...
joint = dJointCreateBall (world, 0);
dJointAttach(joint, Seg2.body, body);
dJointSetBallAnchor (joint, xyzNRF[0], xyzNRF[1], xyzNRF[2]);
...
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]);
dJointSetAMotorAngle (motor, 0, 0.0f);
dJointSetAMotorAngle (motor, 1, 0.0f);
dJointSetAMotorAngle (motor, 2, 0.0f);
dJointSetAMotorParam (motor, dParamFMax, PI);
dJointSetAMotorParam (motor, dParamFMax2, PI);
dJointSetAMotorParam (motor, dParamFMax3, PI);
dJointSetAMotorParam (motor, dParamCFM, CFM);
dJointSetAMotorParam (motor, dParamCFM2, CFM);
dJointSetAMotorParam (motor, dParamCFM3, CFM);
dJointSetAMotorParam (motor, dParamStopCFM, CFM);
dJointSetAMotorParam (motor, dParamStopCFM2, CFM);
dJointSetAMotorParam (motor, dParamStopCFM3, CFM);
dJointSetAMotorParam (motor, dParamStopERP, ERP);
dJointSetAMotorParam (motor, dParamStopERP2, ERP);
dJointSetAMotorParam (motor, dParamStopERP3, ERP);
dJointSetAMotorParam (motor, dParamLoStop, -PI / 4.f);
dJointSetAMotorParam (motor, dParamLoStop2, -PI / 4.f);
dJointSetAMotorParam (motor, dParamLoStop3, -PI / 4.f);
dJointSetAMotorParam (motor, dParamHiStop, PI / 4.f);
dJointSetAMotorParam (motor, dParamHiStop2, PI / 4.f);
dJointSetAMotorParam (motor, dParamHiStop3, PI / 4.f);