[ODE] Assembling Bodies

Jaap Stolk jwstolk at gmail.com
Tue Apr 18 12:56:57 MST 2006


On 4/18/06, Wesley Smith <wesley.hoke at gmail.com> wrote:
> Ok, so I'm having some trouble getting the ball and socket thing to
> work.  In the code below, I create 2 bodies with linked geoms that are
> spheres of radius 0.1.  The bodies are placed equidistant from a ball
> joint that connects them.  What I'm expecting to see from the code
> below is that they remain coupled yet at a certain distance from each
> other.  I'm trying out 2 cases:
> 1-> where I don't collide the 2 balls and
> 2-> where I do.
>
> In case 1, the 2 balls end up occupying the exact same space.

That sounds ok. both balls still have equal distance to the joint.
You will need to add an angular motor to stop the ball joint from moving about.

> In case 2, the 2 balls bounce off the ground with increasing height,
> probably from extra energy from the collision of the 2 balls.

That should not happen. are you using any friction for the ground?
also the dContactApprox1 setting my have an effect here. not sure.

(your code looks ok)

hmm, reading the doc's again, setting the number of axes to zero
"effectively deactivates the joint" Does that mean it's effectively
not there, or it doesn't move ?
can you try to add an angular motor?  (and keep the ball joint)
mot_id = dJointCreateAMotor (dWorldID, dJointGroupID);
dJointSetAMotorNumAxes (mot_id, 0);

You may still get into the same problems as with the fixed joint.
I still think it would be nicer if you could replace the two bodies
with a single body. that would also make the simulation more
efficient. Do you need to connect and disconnect the bodies a lot? as
I understand it, if two spheres collide, you want them to connect
instead of bounce off each other. is that correct? Do you need to
connect more than two bodies? if it's just spheres of the same size,
that makes it easy to calculate the center of mass of the new
(connected) body.



More information about the ODE mailing list