[ODE] move body and encapsulated objects in ODE

Sharad Gupta sharadgupta at ariworld.com
Wed May 3 05:16:06 MST 2006


Thanks a lot for the info, Jon. I am able to run my first integeration. I 
placed 5-6 containers in the air and because of the ODE gravity, they came 
down falling and then toppled after colliding with each other. just got 
thrilled to see that happening.

However i am facing some problems like,

1. After falling, my containers are going inside each other quite a bit? I 
changed the timestep (dWorldQuickStep (theWorld,0.1);) increased the ERP etc 
but not much difference. This is how i am creating my world and object

void CreateODEObject()
 body = dBodyCreate(theWorld);
 dMass m;
 dMassSetBox (&m,1,12.191,2.591,2.438); // these are the actual l,w,h of my 

    geom= dCreateBox (theSpace,12.191,2.591,2.438);

 dBodySetMass (body,&m);
 dBodySetData(body, (void*)odeObj->noOfGeoms);
 dGeomSetBody(  geom, body);

void InitODE()
 theWorld=dWorldCreate(); theSpace=dHashSpaceCreate(0);
 dWorldSetCFM (theWorld,1e-5);
 dWorldSetAutoDisableFlag (theWorld,1);
 dWorldSetContactMaxCorrectingVel (theWorld,0.1);
 dWorldSetContactSurfaceLayer (theWorld,0.001);
 dCreatePlane (theSpace,0,1.0,0,0);
 //dWorldSetERP(theWorld, 0.8);

and finally this is how i am setting my contact properties in callback. I 
dont want my cargo containers  to bounce.

 dContact contact[MAX_CONTACTS];
  contact[i].surface.mode = dContactBounce;   contact[i].surface.mu = 
  contact[i].surface.mu2 = 0;
  contact[i].surface.bounce = 0.05;   contact[i].surface.bounce_vel = 0.1;
  //contact[i].surface.soft_cfm = 0.01;

2. I could not understand what is the use of dMassRotate and dMassTranslate. 
e.g. i have a body and a box geom. Now in this context how can i use 
massrotate and mass translate functions.

3. Also please advise on how can i specify in ODE my container which is 
partly loaded on one side i.e. its CG is not actually in the center but more 
towards one side of it.


----- Original Message ----- 
From: "Jon Watte (ODE)" <hplus-ode at mindcontrol.org>
To: "Sharad Gupta" <sharadgupta at ariworld.com>
Cc: <ode at q12.org>
Sent: Monday, May 01, 2006 11:02 PM
Subject: Re: [ODE] move body and encapsulated objects in ODE

> Sharad Gupta wrote:
>> 1) Cordinate system. Do i need to interchange my coordinates. I reason i
> The coordinate system in ODE is whatever you want it to be. If you set 
> gravity to 0,-9.82,0, then it's Y up, with earth gravity, assuming SI 
> units.
>> 2) Since i am using triangulated meshes, do i need to use 
>> boxes/cylinders/spheres etc to build corresponding shape in ODE. My
> Proxy objects will always perform better (use less CPU) and be more 
> stable. This is true for all physics APIs. Arbitrary, concave, triangle 
> mesh geometries are typically only used for static objects so that you 
> don't get trimesh/trimesh tests, only proxy/trimesh tests.
> This means you probably have to model a separate representation of your 
> objects using proxy objects, and store that in the .X file, or a parallel 
> data file. That's what most games do.
>> 3) How to do setposition of body and its many geoms's? Initially at the
> Anything that moves with relation to something else is its own body. You 
> connect bodies with joints. The body is always positioned at the center of 
> gravity for that component of the object. Geoms are positioned relative to 
> a body, either using the new geom position functionality, or using the 
> geomtransform geom.
> If a body moves, then the geoms that are attached to the body will move. 
> However, you should not setposition on bodies, as that will introduce 
> instability in the simulation (especially if there are joints or 
> collisions involved). Instead, let ODE run the simulation, and get the 
> position out of ODE.
>> 4) In the ODE text_boxstack example, i could not understand this bit for 
>> composite objects under case 'x';
> The "offset" part of dMass is ignored by bodies; the body-local origin is 
> always the center of gravity.
> Cheers,
> / h+

More information about the ODE mailing list