ODE Trimesh issue

I’ve made a ODE demo with the blender Monkey head as a trimesh object. I also make the room as a trimesh ODE object for collision detection:

hk.myblog.yahoo.com/clcheunghk/a … =1&mid=682

The monkey head becomes very unstable when it touches the room. It keeps bounding whenever it touches the ground. The cube and sphere objects behave very well.

If the room is not made from trimesh object, but uses several pieces of box object, then the monkey head can stably rest on the ground.

It looks like the collision algorithm between trimesh objects in Panda’s ODE causes this issue. Any idea ? How can I control the ODE near_callback routine in Panda ?

ODE Trimesh-Trimesh collisions are known to be unreliable. Consider using a more stable collision Geom for the monkey’s head, such as a sphere - I think the sphere Geom gives the best performance. Also check the settings for your ODE simulation like bounce, friction, CFM etc.

As for how to access the near_callback routine, see my other post, discourse.panda3d.org/viewtopic.php?p=32907#32907. It’s the same deal, you have to use PyODE. (Someone point out my mistake if I’m wrong)

aurilliance has pointed out the best thing you can do to get a stable simulation, using approximations of ODE geoms rather than trimesh’s will result in a much better simulation. ODE trimesh collisions are really a bit iffy performance wise and quality wise.

Another pointer for using ODE is the scale of your objects. Your ODE objects are scaled to be 1 unit = 1 meter. This might make your monkey head really big and therefore heavy.

As for the near_callback, if you wait for 1.6.0 you will be able to do the collisions (and therefore grab the joints) yourself rather than depending on auto_collide to handle collisions for you. You might also be able to use the ODE collision event system depending on how fast some of the devs can move on this.

I see. Thank you very much for the advices.

@clcheung -You’re welcome :wink:

[Off topic]
I probably haven’t looked hard enough through the forums, but is there a proposed release date for 1.6.0?
[/Off topic]


No release date but “within a few months”. It used to be “within a few weeks”, but then it has been delayed.

Another thing which might be causing the unstability. When two objects collide in ODE (say, a sphere lies on a plane) the sphere will actually lie a tiny bit inside the plane. How much that ‘tiny bit’ is is calculated based on the timestep. When the timestep differs, the object will jitter around, sometimes giving it a large force.
When using trimesh-trimesh collisions, this artifact is greatly amplified.
So, find a way to make sure the ODE step method is called at a constant rate. But it’s not a good idea to do trimesh-trimesh collisions anyways.

Wow, a few months… I’m in suspense now! :smiley: