div / 0 in BuildJacobianMatrix

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

div / 0 in BuildJacobianMatrix

Postby arkeon » Mon Sep 15, 2014 11:21 am

Hello,

I get several cases where it reach a div / 0 in the dgWorldDynamicUpdate::BuildJacobianMatrix function.

row->m_Jt.m_jacobianM0 and row->m_Jt.m_jacobianM1 are full of 0.
In which case it can happen ?
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Mon Sep 15, 2014 12:38 pm

A Jacobian can never be zero, ever.
you have some very wrong set up, because that should never happens.
The video that you show be before tell be that some operate are by far way out of bound.

if you are using Ogre Newton I will update it, maybe we can determine what it is that you are doing, but what ever it is no correct.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Mon Sep 15, 2014 12:51 pm

hmm :/

I don't use your last version of Ogre Newton.

the code I use is available here https://svn.scolring.org/trunk/scol/plu ... /ogrenewt/
modified version of newton here https://svn.scolring.org/trunk/dependen ... -dynamics/
I made some changes on the dcustomjoint library

but it will be very difficult to know where is goes wrong, since a lot of code part is also made by scripts :/

I was setting the physic framerate to 60 by default, and all is very more stable at 120 and I removed the collision scaling part for now, waiting for your tests on this.

if you have some clues where I can search to correct this out of bounds issues ^^
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Mon Sep 15, 2014 1:12 pm

Is there any reason why you do not use the later Ogre Newton?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Mon Sep 15, 2014 1:17 pm

Yes because I made a lot of changes for newton2 and didn't want to refactor all the engine for now.
I had to manage several cases like node hierarchy and particular joints. Since this is for an editor we do not control what the user can do, so we have to manage all the cases.

Also the new ogre newt use the dnewton lib and it will really make me to redo everything :/
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Mon Sep 15, 2014 1:28 pm

you should try the new Ogre Newton, it does all of that and a lot more.
In fact Ogre Newton now look just like Ogre.

there has being lot of fixes and improvement between Newton 2.xx and 3.13
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Mon Sep 15, 2014 1:32 pm

just to be sure
the Newton unit is 1 for 1 meter right ?
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Mon Sep 15, 2014 1:41 pm

yes most people use 1.0 as one meter

if you unit is something like an inch you can simple apply a uniform scale to all your shapes
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Mon Sep 15, 2014 1:55 pm

ok thanks. I use meter as unit.

so the out of bounds issue, should not be related to the body size.
I'll try to debug deeper I would like to understand :)
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Mon Sep 15, 2014 2:04 pm

instead of debugging it I suggest that you try OgreNewt2.
There were many thing that did work in OgreNewt1 but were not as they should has being done.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Mon Sep 15, 2014 6:25 pm

I found what is causing the div / 0;

in dgWorldDynamicUpdate::CalculateIslandReactionForces
you call CalculateReactionsForces (island, threadID, 0.0f, DG_SOLVER_MAX_ERROR);
with a time step of 0.0f;

then the submitConstraint on joints is called with this timestep.
but some of this joints divide the timestep to compute the friction.

Doh... then I have a crash in DG_INLINE dgVector Floor () const
on
dgVector truncated (_mm_cvtepi32_ps (_mm_cvttps_epi32 (m_type)));
"interrupt on multiple float" no idea what it mean ^^
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Mon Sep 15, 2014 7:22 pm

I take you are using Continue collision.
Yes the newton solver calculates reaction forces separate from impulse.
when the time step is zero, it means the solver is making a pass to resolve for impulse.
To give an example say you have a body falling of over a floor.
at the time of contact the solve will calculate the impulse that affect the velocity, but no force is applied, but if the ball is resting on the floor the solver calculate a resting force which is very different that an impulse.

all the joints callback handle that appropriately which joint is doing that divide by zero?
are you using legacy joints, or are you making you own joints?

can you show me the joint wit that problem.
also are you still using the build in joints?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Mon Sep 15, 2014 8:01 pm

This one for example, this is a modified slider.
https://svn.scolring.org/trunk/dependen ... Slider.cpp

but I must have the problem on other joints too.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Mon Sep 15, 2014 10:26 pm

when I click on those links I get these errors.

There is a problem with this website’s security certificate.
The security certificate presented by this website was not issued by a trusted certificate authority.
The security certificate presented by this website was issued for a different website's address.
Security certificate problems may indicate an attempt to fool you or intercept any data you send to the server.
We recommend that you close this webpage and do not continue to this website.
Recommended iconClick here to close this webpage.
Not recommended iconContinue to this website (not recommended).


It does not really matter, like I said you are using a version of Ogre Newton that was made for Newton 1.5 and later converted to 2.xx

I will say this again, instead of wrestling with such all version which no just give a try to the newer Ogre newton.
I just update to Newton 3.13 and fix the build error and is work fine.

the svn link to download OgreNewt 3.13 is this
http://newtondynamics.com/forum/viewtopic.php?f=2&t=7662
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Tue Sep 16, 2014 3:26 am

Yes the https certificate is not signed, and since the last version chrome claims it's insecure. you can just clic on continue to this website.

Thanks I'll take a look into this, but I will reach the same problems when I'll try to update the joints.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Next

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 9 guests

cron