[ODE] Simulating a Human Leg
Gene Ruebsamen
gene at erachampion.com
Sat Feb 9 22:08:01 2002
Hello,
I'm still new to ODE, but I love it so far (thanks Russ!). I am trying
to model a simple bipedal humanoid in ODE. My question is, is using a
Ball & Socket joint the way to go to simulate where the upper leg
connects to the Torso??
I am using a hinge joint with stops to simulate the knee, and where the
torso connects to the leg, I am using a ball & socket joint. The problem
with the ball & socket is it seems like there is nothing to constrain
its degrees of freedom. I tried using an AMotor with the ball & socket
joint, but is that the way to go?
Example of what I'm doing:
// left Leg Socket
joint[5] = dJointCreateBall(world,0);
dJointAttach(joint[5],body[0],body[6]);
dJointSetBallAnchor(joint[5],-TORSO[0]/2,0,STARTZ-(TORSO[2]/2));
amotor[1] = dJointCreateAMotor(world,0);
dJointAttach(amotor[1],body[0],body[6]);
dJointSetAMotorMode(amotor[1],dAMotorEuler);
dJointSetAMotorAxis(amotor[1],0,1,0,1,0); // is this correct?
dJointSetAMotorAxis(amotor[1],2,2,1,0,0); // correct?
dJointSetAMotorParam(amotor[1],dParamLoStop,0); // not sure..
dJointSetAMotorParam(amotor[1],dParamHiStop,0.8); // not sure
// knee below (use hinge)
I could use a hinge for the upper leg to torso connection; however, then
I wouldn't be able to get any type of lateral movement in the legs, only
a back & forth movement. I don't want too much lateral movement, but a
stiff leg that can only move in one axis is unrealistic, which is why I
originally tried the ball & socket approach. I would like to approximate
the freedom of movement found in a human leg. Anyone have any examples
of using a ball & socket joint with Amotors?
Thanks,
Gene Ruebsamen