div / 0 in BuildJacobianMatrix

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Wed Sep 17, 2014 8:19 am

strange what do you mean an older version ? I've update it yesterday from the git master ?

Just updated it again and only got the changes since yesterday ^^
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Wed Sep 17, 2014 8:38 am

it can't be. as an example take a look at file
../coreLibrary_300\source\core\dgIntersections.h
there a new function that was added at least three week ago or more

Code: Select all
DG_INLINE dgFloat32 dgBoxDistanceToOrigin2 (const dgVector& minBox, const dgVector& maxBox)
{
   dgVector mask ((minBox.CompProduct4(maxBox)) > dgVector (dgFloat32 (0.0f)));
   dgVector dist (maxBox.Abs().GetMin (minBox.Abs()) & mask);
   return dist.DotProduct4(dist).GetScalar();
}


there are lot of different in many other files. you have an older version.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Wed Sep 17, 2014 8:43 am

yes i have dgBoxDistanceToOrigin2 in dgIntersections.h

https://svn.scolring.org/trunk/dependen ... sections.h

how did you get the repository ?
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Wed Sep 17, 2014 9:08 am

I just pasted the link into torstoiSVN
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Wed Sep 17, 2014 10:06 am

Ok I understood the dgVector Floor () crash.
this is just than I send a very bad force or velocity vector whit a really enormous number.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Wed Sep 17, 2014 10:14 am

but why? what are you doing that generate those force.
the information you are giving me is too Vague, I do no really know what it is that is wrong or you are seeing,
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Wed Sep 17, 2014 10:20 am

on some functions of the software I convert the velocity to forces and apply them each frame.
To control a hand with the leap motion for example.
but my calculation must be false here.

the same problem can happen on high speed collision but it seems also related how the joints are made.
for example initialize the world with a physic body in the air with a mass.
then create 2 spheres collision with a joint, at the same place of previous body.

when starting the simulation the intersected body add a huge acceleration to the spheres and the velocity can increase to much. so why the joint is also exploding.

I'm not sure to be clear, and I know this is not really common but it can happen and since I make an editor I have to avoid possible crashs.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Wed Sep 17, 2014 10:25 am

I didn't had this issues with newton 2, maybe it was a managed case.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Wed Sep 17, 2014 10:34 am

Because you are trying to use newton like you use other libraries. you can not take a large penetration and convert it into a force, I do not know where you got that idea from but it will certainly lead to an explosion and that has been the case on all versions of Newton.

if two or more bodies are interpenetration you can simply let the simulation resolve the penetrations and it will be fine.

if you wan to avoid interpenetration when placing a body you can use convex cast or collision checks, to test If it is colliding with some other bodies
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Wed Sep 17, 2014 10:38 am

yes it seems to be ^^

I don't know where I get this idea :) but it was working pretty well.
I'll recheck all of that.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Wed Sep 17, 2014 10:51 am

can you just compile a running demo that link to the newton DLLs.?
Make a simple one that expose these problems and I can see what is wrong.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Wed Sep 17, 2014 10:56 am

ok, it will take time I'll tell you when it's done.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Wed Sep 17, 2014 2:55 pm

it's all in debug so it can be slow ^^

so you can download the rar file here : http://arkeon.dyndns.org/scol/physic_demo.rar
just unrar and launch the exe

I put the pdb files.

you can change the scenes with F5 F6 F7 F8

F5 : (slow in debug) you can grab closes objects with mouse click
the right glass door have continuous collision enable
when you rush into it the bad thing happen ^^

F6 : (slow in debug) heavy joints test on a character you can grab it with right mouse

F7 : playground with different joints, you can control the arm with qwes rf .. keys
has you can see the scaled sphere act very strange (issue on scale discussed in another post)
also the elevator have continuous collision and goes far away when you drag it up and let it coming down when it touch the ground. About the scaled sphere since newton3 we can't make an ellipsoid collision anymore, so the scale is obligatory. I hope you will have time to look at this.

F8 : this one only show an issue on NewtonCreateCompoundCollisionFromMesh
the hands collision are prety bad even with the tolerance correction, here it is set to 0.0
The hull was really better in Newton 2.35 using the same function.

all the asserts I get seems related to the joints. maybe I made mistake in them, I don't know :/
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Wed Sep 17, 2014 3:11 pm

Ok I have it. I will check it tonight.

what is wrong with make the ellipsoid by apply a non uniform scale?

also convex decomposition is suppose to be better in newton 3.0
has you tried changing parameters, the function is for using on and iterative environment where try different settings.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Wed Sep 17, 2014 3:15 pm

about the uniform scale it's just like the collision for where badly scaled depending of the scale applied on the body (remember the video with a scale factor of 0.01)

Do you mean different tolerance as different parameter ?
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