[ODE] Re: FMax and Vel doesnt wrok for me! Y?

Daniel Marbach daniel.marbach at epfl.ch
Tue Nov 2 18:35:27 MST 2004


Hi,

Looks alright to me, try testing just two bodies lying on the ground, contected
with a hinge:

	double actualAngle = dJointGetHingeAngle(hingeJoint);
	double desiredAngle = (M_PI/2.0)*sin(2*M_PI*t); // update t at each step

	// I tested it, 10 seems perfect
	double v = param*(desiredAngle - actualAngle); // I determined param just by
setting the minimal value that resulted in an oscillation with amplitude 90
degrees
	dJointSetHingeParam(hingeJoint, dParamVel, v);


--- and to create the hinge, my code looks like this:

	// Create and attach the joint
	hingeJoint = dJointCreateHinge(ode->world, ode->hingeGroup);
	dJointAttach(hingeJoint, cubeBody, leverBody);
	// Set the anchor
	dBodyGetRelPointPos(leverBody, 0.013*X, 0, 0, pos);
	dJointSetHingeAnchor(hingeJoint, pos[0], pos[1], pos[2]);
	// Set the axis (it is the local z-axis)
	dJointSetHingeAxis(hingeJoint, y_axis[0], y_axis[1], y_axis[2]);
	// Set low and high stops
        dJointSetHingeParam(hingeJoint, dParamLoStop, -M_PI/2.0); // LOW STOP
	dJointSetHingeParam(hingeJoint, dParamHiStop, M_PI/2.0); // HIGH STOP
	dJointSetHingeParam (hingeJoint,dParamFMax, 0.73*X); // MAX FORCE ??? was 0.73

I hope that helps,
   Daniel

PS: Don't generate contact joints for objects that are connected in the
nearcallback, maybe that's the problem?


----------------------------------------
Daniel Marbach
Bitziusstr. 9
CH-3006 Bern

Tel: 031 351 11 09
WWW: http://icwww.epfl.ch/~marbach/
----------------------------------------


More information about the ODE mailing list