[ODE] joint motor

whitt013 whitt013 at bama.ua.edu
Fri Mar 7 16:13:02 2003


If you want constant acceleration, just applying a force is the way to go.  If 
you want constant velocity, though, I would attach one end of a slider to your 
box and the other to the static environment.

If dir is the direction you want to push the box, vel is the speed you want it 
to move, and boxBody is the body:

dJointID joint = dJointCreateSlider(world,0);  //0 means no joint group
dJointAttach(joint, boxBody, 0);  //0 means static environment here
dJointSetSliderAxis(joint, dir[0], dir[1], dir[2]);
dJointSetSliderParam(joint, dParamFMax, 100);   //may need to play with this 
value, depends on mass of box
dJointSetSliderParam(joint, dParamVel, vel);

Something like that should work.  You may need to make one of vel or dir 
negative to get the right direction.

Good Luck,
David

>===== Original Message From "Henri Hakl" <henri@cs.sun.ac.za> =====
>Shouldn't you be just plain be applying a force?
>
>  ----- Original Message -----
>  From: vat
>  To: ode@q12.org
>  Sent: Friday, March 07, 2003 11:12 PM
>  Subject: [ODE] joint motor
>
>
>  Hi:
>
>  Is there a sample of how to use joint motor other than test_buggy? I'm just 
trying to push a box with no wheels at constant speed. What kind of joint 
should I use?
>
>  Thx