btInternalEdgeUtility doesn't help, how to debug?

cadabra
Posts: 3
Joined: Thu May 10, 2012 4:51 am
Location: sfbay

btInternalEdgeUtility doesn't help, how to debug?

Post by cadabra »

I have a sphere slowly rolling on a trimesh floor. At 60hz, it's a pretty bumpy ride... btGenerateInternalEdgeInfo is supposed to fix this, but I don't see any difference. I've verified that my custom combiner callback is called and it seems to go through the right code path inside btAdjustInternalEdgeContacts.

- The sphere has a radius of ~0.2 and the triangles have sides between 0.3 and 1.3. I tried scaling everything by 5, but it made no difference.

- I tried adjusting the btTriangleInfoMap fields and didn't see any improvement, but I'm not sure I fully understand what each does and what reasonable values are.

- I tried enabling BT_INTERNAL_EDGE_DEBUG_DRAW, rebuilding bullet, and setting btSetDebugDrawer. I can see normals going from the trimesh+sphere contact and up, and normals rotating along with the sphere when it rolls over edges, but I'm not sure how this tells me if the internal edge utility is working or not. I looked at the internal edge demo and its visualization seems to contain lines along the floor that mine does not. I modified the internal edge demo to skip btGenerateInternalEdgeInfo and the visualization went away, but I couldn't tell if it made any difference to the behavior of the demo.

Is there anything else I can do to debug and understand what's going on here?

I've attached a serialized world.bullet, in case it contains anything useful.
You do not have the required permissions to view the files attached to this post.
jazztickets
Posts: 21
Joined: Tue Dec 29, 2009 12:48 am

Re: btInternalEdgeUtility doesn't help, how to debug?

Post by jazztickets »

Reviving this thread because i'm getting the same problem as you. I have a test case set up for debugging this at https://github.com/jazztickets/btest

Like you, i have the internal edge utility set up and it appears to be working (i.e. m_normalWorldOnB is getting corrected). However, when the friction constraints get resolved there's an impulse that gets applied that is not colinear with m_normalWorldOnB. Obviously Erwin can speak on this matter better than anyone, so i'm going to issue a bug report with all the data i've collected.

I tracked it down to be m_tmpSolverBodyPool.m_data[1].m_deltaLinearVelocity.m_floats[0] inside btSequentialImpulseConstraintSolver.cpp that influences the sphere.

The only the thing that i found that solves the internal edge problem is using a very small time step (500 to 1000 hz).

EDIT:
Video of bug: http://www.youtube.com/watch?v=71jd0g6PsdE