[ODE] simulation of a servo

Stefan Castille castille at dd.chalmers.se
Tue Aug 26 05:52:01 2003


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