[ODE] Sliding box on plane Question

Jon Watte (ODE) hplus-ode at mindcontrol.org
Sun Nov 11 14:42:04 MST 2007


1) Turn on dContactApprox in the flags.
2) When composing binary flags, use a single bar, not double bar.
3) To make a simulation stable, make sure that you're using a fixed time 
step. Variable time step sizes, say based on the clock, will introduce 
energy into the system.
4) You will probably want to add some rotational inertial dampening to 
the system to make it fully robust. Each step, for each body, find the 
angular velocity, and add a counter-torque that's about -0.02 times that 
angular velocity, to start with. Tweak from there.


Cheers,

          / h+

Bob Cober wrote:
> I am learning ODE.
>
> I have built a simple app that drops boxes and spheres, similar to the boxstack demo.
>
> Everything works, except that the boxes slowly slide off the plane.  i.e. They tumble and roll accurately, but instead of resting in place they slowly slide off the plane in the direction they had been rolling.
>
> I thought there might be no friction to hold them, but I generate the contact point with(smilar to boxstack):
>
>   for(i=0; i < MAX_CONTACTS; i++)
>   {
> 	contact[i].surface.mode = dContactBounce || dContactSoftCFM;
> 	contact[i].surface.mu = dInfinity;
> 	contact[i].surface.mu2 = 0;
> 	contact[i].surface.bounce = 0.1;
> 	contact[i].surface.bounce_vel = 0.1;
> 	contact[i].surface.soft_cfm = 0.01;
>   }
>   
>   if(int numc = dCollide(o1,o2,MAX_CONTACTS, &contact[0].geom, sizeof(dContact)))
>   {
> 	for (i=0; i<numc; i++ )
> 	{
> 	    dJointID c = dJointCreateContact(world,contactgroup, contact);
> 	    dJointAttach(c, b1, b2);
> 	}
>   }
>
>
> Thanks in advance for any advice
>
>
> _______________________________________________
> ODE mailing list
> ODE at ode.org
> http://ode.org/mailman/listinfo/ode
>
>
>   


More information about the ODE mailing list