Custom joint drift

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Custom joint drift

Postby vectrex » Thu Sep 11, 2008 3:54 pm

Hi, I'm trying to make a rigid custom joint to make a joint chassis for a vehicle. I've previously just used the old 1.53 hinge joint which worked well for a placeholder. Oddly enough in 1.53 a 40 joint chassis using just hinges worked great and stable and tight. I can't get the same tightness in v2 yet.

Here is the code from OgreNewt's v2 rigid joint. The chassis kind of.. sags and squirms like a spider that's been sprayed :)

The builtin hinge joint in newton v2 doesn't work the same as 1.53 because the calculateStopAlpha seems to blow up on me.
In the end I'm trying to make a joint that can have bend limits and forces which I can use for permanent chassis damage. I'm guessing I'll need a full joint like the 6dof joint?
Thanks!

edit: I've tried so many things now, I've just got zero idea how these work. Just when I think I understand it it turns out I don't. Is there any documentation at all for these explaining concepts aswell?

Code: Select all
void Chassis::Beam::submitConstraint( Ogre::Real timeStep, int threadIndex )
{
   // get globals.
   Ogre::Vector3 globalPos0, globalPos1;
   Ogre::Quaternion globalOrient0, globalOrient1;

   localToGlobal( mLocalOrient0, mLocalPos0, globalOrient0, globalPos0, 0 );
   localToGlobal( mLocalOrient1, mLocalPos1, globalOrient1, globalPos1, 1 );

   setStiffness(1.0f);

   // apply the constraints!
   addLinearRow( globalPos0, globalPos1, globalOrient0 * Ogre::Vector3::UNIT_X );
   addLinearRow( globalPos0, globalPos1, globalOrient0 * Ogre::Vector3::UNIT_Y );
   addLinearRow( globalPos0, globalPos1, globalOrient0 * Ogre::Vector3::UNIT_Z );


   // now find a point off 10 units away.
   globalPos0 = globalPos0 + (globalOrient0 * (Ogre::Vector3::UNIT_X * 10.0f));
   globalPos1 = globalPos1 + (globalOrient1 * (Ogre::Vector3::UNIT_X * 10.0f));

   // apply the constraints!
   addLinearRow( globalPos0, globalPos1, globalOrient0 * Ogre::Vector3::UNIT_Y );
   addLinearRow( globalPos0, globalPos1, globalOrient0 * Ogre::Vector3::UNIT_Z );

   Ogre::Vector3 xdir0 = globalOrient0 * Ogre::Vector3::UNIT_X;
   Ogre::Vector3 xdir1 = globalOrient1 * Ogre::Vector3::UNIT_X;

   //Ogre::Radian angle = Ogre::Math::ACos( xdir0.dotProduct( xdir1 ) );
   Ogre::Radian angle = 0;
   addAngularRow( angle, globalOrient0 * Ogre::Vector3::UNIT_X );
}
vectrex
 
Posts: 21
Joined: Sat Oct 01, 2005 10:15 am
Location: Australia

Re: Custom joint drift

Postby Zach Griffin » Fri Sep 12, 2008 11:05 pm

I'm also working on the same project with Vectrex. We've been trying some other stuff but with the same results. Can anyone help?
Zach Griffin
 
Posts: 13
Joined: Tue Oct 04, 2005 7:52 am

Re: Custom joint drift

Postby vectrex » Mon Sep 15, 2008 10:23 am

actually, I remembered an important point. When I was using the built in hinge in 1.53 it did the same sagging/drift but only when I set the limits to less than 1 degree. At 1 degree it was good and never drifted.
vectrex
 
Posts: 21
Joined: Sat Oct 01, 2005 10:15 am
Location: Australia

Re: Custom joint drift

Postby Zach Griffin » Mon Oct 20, 2008 10:44 pm

bump
Zach Griffin
 
Posts: 13
Joined: Tue Oct 04, 2005 7:52 am

Re: Custom joint drift

Postby Julio Jerez » Wed Oct 22, 2008 10:15 am

can you post a small video of the problem?

are you open to a custom solution for the problem?
Julio Jerez
Moderator
Moderator
 
Posts: 11155
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests