[ODE] Has anybody had any luck with dJointSetAMotorAngle?
Patrick McColgan
patrick at torcinteractive.com
Mon Jan 24 16:16:25 MST 2005
I finally (hopefully) have AMotors working the way I want so here's my
take on it:
setAMotorAngle is exclusively for User mode meaning that you are
completely responsible for updating the motor, as far as I can see you
aren't telling the amotor what the angle should be; you're informing it
of what it is.
I use an AMotor to stand a cylinder upright, normally the cylinder lies
along the z axis so what I do is first rotate the cylinder 90 degrees
about its local x axis and position it's bottom end on a surface. Then
I set up the AMotor, I use 3 axis set as a unit vector along the global
x, y and z axis. Then I call setAMotorAngle to initialise all the axis
to zero degrees, so in spite of ODE knowing that I have rotated the body
I have told the amotor that this upright cylinder is unrotated initially
with respect to the amotor. Then each frame I calculate the angular
difference between the cylinder's local x, y and z axes and the global
x, y and z axes (as I use the internal rotational matrix of the body I
have to account for my initial rotation). The differences I find
between each I set as new AMotor angles for the corresponding AMotor
axes. And that's all I have to do, the motor maintains the cylinder
vertically.
I hope that makes sense, as I say I finally have AMotors working the way
I want them. But it wasn't easy.
Gerritt Brownlee wrote:
>
> I am trying to set the initial conditions of my motor. It doesn't
> move the joint to any angle.
>
> If I can't get the setAMotorAngle to work I guess I will have to use
> quaternions to set the inital conditions.
>
> Please respond if you got this function to work.
>
> Thanks
>
> Gerald Boone
>
>------------------------------------------------------------------------
>
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>
>
More information about the ODE
mailing list