Custom6DOF linear limits not working

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Custom6DOF linear limits not working

Postby ronj » Mon Apr 15, 2013 4:17 am

hi,
linear limits are not working for Custom6DOF joint.it works as expected after i commented these lines out.
(in /packages/dCustomJoints/Custom6DOF.cpp)

------> // if (dist > m_maxMaxLinearErrorRamp[i]) {
------> // dist = m_maxMaxLinearErrorRamp[i];
------> // }

------> // if (dist < -m_maxMaxLinearErrorRamp[i]) {
------> // dist = -m_maxMaxLinearErrorRamp[i];
------> // }

i am using Newton 2.36.
ronj
 
Posts: 3
Joined: Sat Apr 13, 2013 8:47 am

Re: Custom6DOF linear limits not working

Postby Julio Jerez » Mon Apr 15, 2013 6:51 am

why don't you use newton 300?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Custom6DOF linear limits not working

Postby ronj » Wed Apr 17, 2013 4:03 am

the Custom6DOF implementation is same in 3.00 and 2.36,so i just assumed 3.00 wouldnt work either.

maybe i am wrong,but i just wanna point out that you are clamping the distance value in
http://code.google.com/p/newton-dynamic ... OF.cpp#176
which means the linear limit will break and wont work as expected.
ronj
 
Posts: 3
Joined: Sat Apr 13, 2013 8:47 am

Re: Custom6DOF linear limits not working

Postby Julio Jerez » Wed Apr 17, 2013 10:52 am

There are some minor differences in the joint implementations. but there are some big internal differences
For example core 300 now handle resting contact and impulsive steps correctly
impulsive steps are used in continues collision steps.

Plus, I am not working on core 200 anymore, it would be too much work for me.
In any case core 300 now is more stable that core 200, plus I has more functionality.
I is no too difficult to migrate to core 300 and stay up to day, it make it simpler for every one.

In a few day I will make a newer 3DOF joint that will work with small angular approximation. depend on the results, if feel equal or better that the current 6DOF, I will replaces it, or keep the two


[quote="ronj"i just wanna point out that you are clamping the distance value in
http://code.google.com/p/newton-dynamic ... OF.cpp#176
which means the linear limit will break and wont work as expected.[/quote]
can you tell me what line is this happening in the code?

Oh I see here

Code: Select all
 
                     dFloat dist = dp % matrix1[i];
                         if (dist > m_maxLinearLimits[i]) {
                                 // clamp the error, so the not too much energy is added when constraint violation occurs
                                 if (dist > m_maxMaxLinearErrorRamp[i]) {
                                         dist = m_maxMaxLinearErrorRamp[i];
                                 }
                                 dVector q1 (p1 + matrix1[i].Scale (m_maxLinearLimits[i] - dist));
                                 NewtonUserJointAddLinearRow (m_joint, &p0[0], &q1[0], &matrix0[i][0]);
 
                                NewtonUserJointSetRowStiffness (m_joint, 1.0f);
                                 // allow the object to return but not to kick going forward
                                 NewtonUserJointSetRowMaximumFriction (m_joint, 0.0f);
                         } else if (dist < m_minLinearLimits[i]) {
                                 // clamp the error, so the not too much energy is added when constraint violation occurs
                                 if (dist < -m_maxMaxLinearErrorRamp[i]) {
                                         dist = -m_maxMaxLinearErrorRamp[i];
                                 }
                                 dVector q1 (p1 + matrix1[i].Scale (m_minLinearLimits[i] - dist));
                                 NewtonUserJointAddLinearRow (m_joint, &p0[0], &q1[0], &matrix0[i][0]);
                                 NewtonUserJointSetRowStiffness (m_joint, 1.0f);
                                 // allow the object to return but not to kick going forward
                                 NewtonUserJointSetRowMinimumFriction (m_joint, 0.0f);
                        }


m_maxLinearLimits[i] is an array of switches that tell the joint witch of the three limit is linear degree of freedom is allow to move
m_maxMaxLinearErrorRamp[i] save the limit of that degree of freedom.
where is the error?

you say you commented that out, does that joint stops after you do that?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Custom6DOF linear limits not working

Postby ronj » Thu Apr 18, 2013 8:06 am

hi,
i cant get the limits to work on 3.00 either (from svn).

i have attached a test file,its adapted from 'PrimitiveCollision.cpp'.
i created a sphere object at origin and attached a DOF joint with limits min: (0,-8,0),max:(0,+8,0).
it should fall down under gravity,hit the min limit and stop there,but for me it keeps falling.
Attachments
PrimitiveCollision.zip
(6.81 KiB) Downloaded 317 times
ronj
 
Posts: 3
Joined: Sat Apr 13, 2013 8:47 am

Re: Custom6DOF linear limits not working

Postby Julio Jerez » Thu Apr 18, 2013 10:57 am

Oh thank you for the test. I pasted on the sandbox and I see what you mean.
I fixed already, think to SVN and it should be good now.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 8 guests

cron