[ODE] Re: ODE Digest, Vol 15, Issue 30

Pete Baron sibaroni at hotmail.com
Fri Nov 19 07:48:35 MST 2004


Hi Jan,

I think you have not had a reply because your question is not very clear.
It sounds to me as though you are perhaps mis-using the angular motor.  If
you have one body in space (your spaceship) then you don't need an angular
motor (which would normally be used to link two bodies together through a
joint - eg, the driving wheels on a car would use an angular motor to make
them spin).
To make your spaceship turn, you would probably just add torque to the body
(this would nicely simulate the firing of small positional jets attached to
spaceship).
You've attached your angular motor only to one body and in the docs it says
"An angular motor (AMotor) allows the relative angular velocities of two
bodies to be controlled".  Try getting rid of it and adding forces directly.

Hope this helps,

Pete Baron
sibaroni at hotmail.com

http://home.btconnect.com/pete/homepage.html


Date: Wed, 17 Nov 2004 19:49:26 +0100 (CET)
From: honza at jikos.cz
Subject: Re: [ODE] Angular motor and axis newbie question
To: ode at q12.org
Message-ID: <Pine.LNX.4.58.0411171948400.25749 at twin.jikos.cz>
Content-Type: TEXT/PLAIN; charset=US-ASCII

Ok i reply to myself.

On Tue, 16 Nov 2004 honza at jikos.cz wrote:

> Hello,
>  i have troubles with angular motors and i didn't find answer to my
> stupid questions in archives (i bet it is there but ...)
> I am simulating spaceship (so no gravity etc) as one body then i attach
> angular motor to it. It works just fine but when i rotate the body a
> little and then i try to rotate it again around another axis it looks like
> it is trying to rotate it according to "unrotated axis", but i want to
> rotate relative to body position.
> I'll paste relevant code:
>
> Initialization:
>     motor = new ode::dAMotorJoint(manager->world->id());
>     motor->attach( body->id(), 0);
>     motor->setNumAxes(3);
>     motor->setAxis(0, 1, 1,0,0);
>     motor->setAxis(1, 1, 0,1,0);
>     motor->setAxis(2, 1, 0,0,1);
>     motor->setParam(ode::dParamFMax, 1);
>     motor->setParam(ode::dParamFMax2, 1);
>     motor->setParam(ode::dParamFMax3, 1);
>
> When request on motor angular velocities sent:
pseudo_code
rot = body->getRotation();
desiredAngVel = desiredAngVel * rot;
solves given problem.
But shouldn't this rotation by done by ode? It is more then clear that i
missunderstand something. But what?
Jan Kratochvil

>     motor->setParam(ode::dParamVel, desiredAngVel[0]);
>     motor->setParam(ode::dParamVel2, desiredAngVel[1]);
>     motor->setParam(ode::dParamVel3, desiredAngVel[2]);
>
> i thought that second parameter in setAxis is telling that axis are
> relative to the body. (anchored to the body .. as documentation says)
>
> Can i use dAMotorEuler? I am scared of this line in doc
>  Axis 0 must be anchored to the first body, axis 2 must be anchored to the
> second body.
>
> Thanks a lot for your potential advice :)
> Jan Kratochvil


More information about the ODE mailing list