[ODE] simulation of a servo

Martin C. Martin martin at metahuman.org
Tue Aug 26 06:43:02 2003


1. You can start your application paused by giving it "-pause" on the
command line.

2. Try lowering the FMax, that may make your problems a little less
severe, so you can see what's going on.

3. You're setting the velocity to be always negative.  If the angle gets
too low, won't you need positive velocity?

4. Try setting the velocity to be the velocity needed to get to the
desired angle in a single timestep.  Something like (desired_angle[a] -
dJointGetHingeAngle(joint[a])) / delta_t.

- Martin

Stefan Castille wrote:
> 
> I'm currently working on a simulation of a humanoid robot in ODE. The
> model of the robot is almost finished but now i need to add servo's and
> sensors to the simulation.
> 
> I made a very simple model of a servo, basically it has a target angle and
> will go full speed until that angle has been met up to a certain accuracy.
> 
> for (int a = 0; a < nrJoints; a++)
> {
>         if (dJointGetHingeAngle(joint[a]) > servopos[a] + 0.005)
>         {
>                 dJointSetHingeParam(joint[a], dParamFMax, 0.5);
>                 dJointSetHingeParam(joint[a], dParamVel, -0.01);
>         }
> }
> 
> (with a similar structure to go the other way or to stop the servo)
> 
> However if i run this then the robot disintegrates almost immediately and
> i get a segmentation fault after a couple of frames. Before i can even
> pause the simulation.
> 
> Can anyone tell me what i'm doing wrong or give me any pointers on how to
> simulate a servo in a better way?
> 
> Stefan Castille
> 
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode