[ODE] Heightfield2

LR logreg at free.fr
Tue Sep 19 04:08:05 MST 2006


Excuse me, it's my fault: i saw that we certainly not execute the same
sample.

I updated test_cyl from svn and modify it to show the problem, steps to
reproduce are:

Modification 1:
Add the rotation (as already done with the #define CYL_GEOM_OFFSET )
>>   //LR
>>   dMatrix3 mat;
>>   dRFromAxisAndAngle(mat,1.0f,0.0f,0.0f,M_PI/2.0);
>>   dGeomSetOffsetRotation(cylgeom,mat);
>>   //END LR

Modification 2:
Add a plane for the ground


Modification 3:
Modify cylinder coords to be out of the trimesh, and falling on the plane
static void reset_state(void)
{
float sx=-0, sy=-12, sz=2; 



Then execute ,

--> you can see the cylinder falling under the plane

--> if you remove the dGeomSetOffsetRotation, the cylinder stay on the floor
...

LR





-----Message d'origine-----
De : Geoff Carlton [mailto:gcarlton at iinet.net.au] 
Envoyé : mardi 19 septembre 2006 10:16
À : LR
Cc : ode at q12.org
Objet : Re: [ODE] Heightfield2

Hi,
You'll need to describe exactly what the problem is.  I did insert those
lines and the cyl seemed to behave pretty much as normal, at least on my
build (windows, vs2005, dSINGLE).  It starts at an angle, falls down and is
pushed down the ramp next to the box.

Thanks,
Geoff

LR wrote:
> Hi,
>
> Ok , of course reading body position was not good :) I changed it in 
> the sample code.
>
> but it was not the problem:
>
> Try to insert a rotation offset into the test_cyl and with those lines:
>
> #ifdef CYL
>   
>>   cylbody = dBodyCreate (world);
>>   dMassSetSphere (&m,1,RADIUS);
>>   dMassAdjust (&m,WMASS);
>>   dBodySetMass (cylbody,&m);
>>   cylgeom = dCreateCylinder(0, RADIUS, WHEELW);
>>   dGeomSetBody (cylgeom,cylbody);
>>   
>>   //LR
>>   dMatrix3 mat;
>>   dRFromAxisAndAngle(mat,1.0f,0.0f,0.0f,M_PI/2.0);
>>   dGeomSetOffsetRotation(cylgeom,mat);
>>   //END LR
>>   
>>   dSpaceAdd (space, cylgeom);
>> #endif
>>     
>
>
>
>
>
> -----Message d'origine-----
> De : Geoff Carlton [mailto:gcarlton at iinet.net.au] Envoyé : mardi 19 
> septembre 2006 03:07 À : LR Cc : ode at q12.org Objet : Re: [ODE] 
> Heightfield2
>
> Ok, its a problem in the test code, not geom offsets.  It is drawing 
> the cylinder at the body's orientation rather than the geom's.
>
> Replace this:
>   const dReal *CPos = dBodyGetPosition(cylbody);
>   const dReal *CRot = dBodyGetRotation(cylbody); With this:
>   const dReal *CPos = dGeomGetPosition(cylgeom);
>   const dReal *CRot = dGeomGetRotation(cylgeom);
>
> Seems to work fine apart from that, so I checked in that change, with 
> an ifdef to add the geom offset rotation.  Other tests may have the 
> same problem, so be aware of it if you are experimenting with offsets.
>
> Thanks,
> Geoff
>
> LR wrote:
>   
>> Hi,
>>
>> Just take the test_cyl sample and replace the //LR section:
>>
>> #ifdef CYL
>>   cylbody = dBodyCreate (world);
>>   dMassSetSphere (&m,1,RADIUS);
>>   dMassAdjust (&m,WMASS);
>>   dBodySetMass (cylbody,&m);
>>   cylgeom = dCreateCylinder(0, RADIUS, WHEELW);
>>   dGeomSetBody (cylgeom,cylbody);
>>   
>>   //LR
>>   dMatrix3 mat;
>>   dRFromAxisAndAngle(mat,1.0f,0.0f,0.0f,M_PI/2.0);
>>   dGeomSetOffsetRotation(cylgeom,mat);
>>   //END LR
>>   
>>   dSpaceAdd (space, cylgeom);
>> #endif
>>  
>>
>> In this case, cylinder is ejected :)
>>
>> -----Message d'origine-----
>> De : Geoff Carlton [mailto:gcarlton at iinet.net.au] Envoyé : mardi 19 
>> septembre 2006 02:31 À : LR Cc : ode at q12.org Objet : Re: [ODE]
>> Heightfield2
>>
>> Hi,
>> If you have any code snippets that illustrate problems with offsets, 
>> send them along and I will have a look at it.
>>
>> Thanks,
>> Geoff
>>
>> LR wrote:
>>   
>>     
>>> Another thing curious with the cylinder /plane (and i just look with 
>>> the trimesh too):
>>>
>>>
>>> Up to the last week, i composed rigid bodies with transformed geoms
>>> -> all was ok
>>>
>>> Since this week i've replaced transformgeom for offsets then,
>>>
>>> -> coliding cylinder/plane when cylinder is up, circle tutching 
>>> -> plane
>>> generate contacts but not forces ...
>>> -> coliding mesh/plane not generate contacts (or generate contacts 
>>> -> but not
>>> forces) ....
>>>
>>>  
>>>  
>>>
>>> -----Message d'origine-----
>>> De : David Walters [mailto:hidden.asbestos at googlemail.com]
>>> Envoyé : lundi 18 septembre 2006 10:45 À : LR Cc : ode at q12.org Objet : 
>>> Re: [ODE] Heightfield2
>>>
>>> Is it possible for you to try with capsules instead of cylinders? it 
>>> is possible that there's a bug in the ray / cylinder or plane / 
>>> cylinder
>>>     
>>>       
>> code.
>>   
>>     
>>> I have seen this behaviour myself, but not investigated it as I 
>>> assumed it was the density of my heightfield grid rather than a 
>>> common problem for all cell edges.
>>>
>>> Regards,
>>> Dave
>>>
>>>
>>>   
>>>     
>>>       
>>>> Hi,
>>>>
>>>> I have a curious thing with the heigtfield:
>>>>
>>>> A robot with 2 cylinders as whells is running on a flat (it's a
>>>> test) heightfield : the robot jumps (shortly, about 10 cm on Z up
>>>> axis) when cylinders are about to go from a sub square to another.
>>>>
>>>> Reducing the number of square, i can look that it's exactly at the 
>>>> height squares transition.
>>>>
>>>> In fact robot own 2 cylinders as front wheels, and a shpere for the
>>>>         
> rear.
>   
>>>> Jumps occurs only on the cylinder witch is about to go from a quare 
>>>> to the next .... never on the sphere
>>>>
>>>> some one know what to do to avoid that ?
>>>>
>>>> thank you
>>>>
>>>> Laurent.
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ODE mailing list
>>>> ODE at q12.org
>>>> http://q12.org/mailman/listinfo/ode
>>>>
>>>>
>>>>
>>>>     
>>>>       
>>>>         
>>> _______________________________________________
>>> ODE mailing list
>>> ODE at q12.org
>>> http://q12.org/mailman/listinfo/ode
>>>
>>>
>>>   
>>>     
>>>       
>>
>>
>>   
>>     
>
>
>
>   





More information about the ODE mailing list