div / 0 in BuildJacobianMatrix

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Fri Sep 19, 2014 7:41 pm

can you show me a screen shot of how the scene is suppose to look like?
when I run it I get asserts, but if can not see anything.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Fri Sep 19, 2014 7:58 pm

Oh I see, I am the player,
I see in the scene three objects, the floor, the Camera and a small box that fall on the floor.

what is the small box for? does the problem still happen if you remove it?
if so, can you remove that small box it and post the demo again?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Fri Sep 19, 2014 8:04 pm

This is the small box hitting the camera body that make the error.
If I remove it all is fine.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Fri Sep 19, 2014 8:21 pm

there is some that look very wrong,
you say there are three bodies in the scene but I see 4.

there the for which is static
you have the player body with mass 60
then there is another small body, which I assume is the Box of mass 0.05
and there the is another object of Mass 1.0 (what is that)

the player is has a joint that is connected to NULL.
but then there is a joint that connects the player to the object of Mass 1.0 (what is that?)
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Fri Sep 19, 2014 8:26 pm

The player have 2 bodies :
- a main scaled sphere with an up joint
- a camera collision sphere with a slider joint linked to the main player body

I use this to be able to crouch by changing the slider joint position.
the object with mass 0.05 is the box that fall.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Fri Sep 19, 2014 8:37 pm

does the player main body has a mass of 60, and the attached to it has a mass of 1.0?

and the free falling box 0.05?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Fri Sep 19, 2014 8:37 pm

yes that's it
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Fri Sep 19, 2014 8:49 pm

I think I see now what is going on, you are not using the dJointLibrary, instead you are making you own copy.

But lie I told you before Newton 3.00 solve resolve collision separate form forces.
in newton 2.0 the joint library did no have the problem because eth solve kept the update step,
In Newton 3 and Up the CalculateConstraion callback most know how to calculate the joint acceleration or velocity for and impulse call back.

If you do not know how to do that then you must use the dJointLibrary.
Basically you are using Newton 3 as if it was newton 2.
and because of the CCD step the joint is reporting an infinitte joint acceleration for a time step of 0.0

Please integrate the JointLibrary and the dContainersLibrary. Otherwise it will never work.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Fri Sep 19, 2014 9:05 pm

Yes I use the dcustomjoint library.
I have change the code a bit to add some more control, but I corrected last time the timestep to manage the 0 case the same way you did in other joints by using the inverse time step.
like :
invTimeStep = (timeStep == 0.0f) ? 1.0f : 1.0f / timeStep;

maybe I miss something else :/
can you check the modified joint code here and explain me what's wrong ? : https://www.arkeon.be/svn-scol/trunk/de ... Slider.cpp

but yes I did that a long time ago and don't really remember what I did ^^

(need to sleep 3am here :/)
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Fri Sep 19, 2014 9:07 pm

use dJointLibrary.dll and the DContainers.dll or I will not going to be able to debug the problem
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Fri Sep 19, 2014 9:35 pm

I cant compile with the default newton djoint library or the behavior wont be the same and I'll have to make a lot of changes.

after more dichotomy tests this happen when I call NewtonUserJointSetRowSpringDamperAcceleration
in the submitConstraint user callback of a CustomSlider

without this I don't have the problem.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Fri Sep 19, 2014 10:05 pm

you do have a problem, the joints you are using are for for newton 3.00 they were for newton 2.0
your callback are doing divides by zero which is what is producing the huge accelerations.

the only thong you have to do is set the project to link to the dJointLibrary.dll and the dConatners.dll

the after you have that working as it was meant to, you are free to make the change you want.
but you have a fallback or a point to compare.

Many people make the own joint, but you start learning the engine, until you know the basics of how it work, mu suggestion of to start with what is in
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Sat Sep 20, 2014 5:11 am

ho just understood my mistake the djointlibrary is not in the package projects ^^

...
ha no this is only the name that change to dCustomJoint with the cmake setup.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Sat Sep 20, 2014 6:26 am

you mean the library is the same? and only the name is different in the CMake file?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Sat Sep 20, 2014 6:30 am

yes the name is different in cmake.
but ht library is not exactly the same since I added some stuff in slider joint and add an old raycast car I made (this one works fine)
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 3 guests

cron