ndWorld::UpdateSkeletons asserts

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

ndWorld::UpdateSkeletons asserts

Postby Esharc » Wed May 10, 2023 8:28 am

Hi Julio, I have a sphere with two static cube bodies positioned in a triangle with the sphere at the bottom.
I then create two joints to connect the sphere to the two cube bodies. In both joints the sphere is the child body and the cube the parent for each joint.

The function
Code: Select all
ndWorld::UpdateSkeletons()
asserts on line 761 in the check
Code: Select all
ndAssert(childBody == skeleton->GetRoot()->m_body);


I am not sure if this assert is meant to be there, since it does not make sense to me, the skeleton is only created once for the first child body of the root
Code: Select all
if (!skeleton)
{
    skeleton = m_skeletonList.CreateContatiner(childBody);
}


When adding the second body, the assertion happens since the root body of the skeleton is still the first body
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa

Re: ndWorld::UpdateSkeletons asserts

Postby Julio Jerez » Wed May 10, 2023 7:57 pm

yes, topologies like these, bellow are not allowed.

Untitled.png
Untitled.png (6.7 KiB) Viewed 5001 times


that's by designed, because topologies with those loops generates singular mass matrices.

there was a time that the engine handled that, but at as the expense of been very, very slow since it will have to identify those rows by calculating eigen values or by Cholesky with household rotations on very large matrices. At that time, I was really proud, but the public was not ready to accept slow performance and we paid a heavy price.
therefore, by newton two, I started to made simplifications, so that we handle a subset of all graphs. mainly acyclic graphs.
Iterative solves can deal with matrices with very high condition numbers, but Newton uses a direct solver for joints. So, either we only deal with the type of system that by definition do not have singularities, or we deal with them by determining the singular rows. I chose the former.

That part of the code is the one that determine what part of the general graphs connected by joints is acyclic, and I call that: skeleton.

when solving singular joints, there is the possibility to generate singular matrices as well, but those are small matrices than can be factored quickly to check for singular rows,
then the way it is solved is by a technique called regularization.
you saw than with that other bug, you posted.
condition number problems are really hard to deal with if you want real-time performance.

My suggestion is that you try some different arrangement,

-a joint configuration can link different bodies the same or different static body.
-you can also make the static body a compound collision.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: ndWorld::UpdateSkeletons asserts

Postby Esharc » Thu May 11, 2023 12:39 am

Ah I see. Thank you for the explanation.

That test was only there previously to get myself acquainted with Newton when I took over the physics project in our company.

It is basically a Newton's cradle.
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 14 guests