Custom joints vehicle and weak joints

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Custom joints vehicle and weak joints

Postby kallaspriit » Wed Nov 11, 2009 4:25 pm

Hey,

I have once touched the topic before but I'll try again. I am trying to develop a as-realistic-as-possible vehicle using custom joints. The target is to simulate the suspension with real geometry using a multitude of joints. I've got the basic setup, but the problem is that my joints are too weak and wobbly. I understand the problem is too big weight differences between connected objects - the frame of the vehicle is 800KG and the suspension elements 5-15KG:
Image.

If i multiply the weight of the suspension elements by 10, so they are around 50KG, the effect is much less visible, but this defeats my purpose of trying to simulate the car as realistically as possible. For information, I am using the latest beta with the accurate solver and running physics at 120FPS.

Here's a video of the problem in action:


Is there any way to simulate a vehicle with realistic suspension geometry and weights?
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Custom joints vehicle and weak joints

Postby kallaspriit » Mon Nov 16, 2009 9:53 am

Any ideas? Is it really absolutely impossible to create a vehicle with joints, bodies and realistic properties? :cry:
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Custom joints vehicle and weak joints

Postby Julio Jerez » Tue Nov 17, 2009 8:17 am

I saw the video and i am suprice it work at all.

teh problems is the a real tiem physics solver is not caplable of solver is no capable of solvin gyeh king of system of equation teh result from such configuration of bodies.
it has all teh thong tha can be bad.
large mass ratios, thing bodies like the suspation bard, high mobing objects lie eth tires, and teh hold system move at high speed.
this is why physic sengine resul to use a ray cats car.

There is a mathematical methd tha can be use to solve susch system, an dis is call reduces corrdinated sysrem, or Fetherstone algorithm.

I said in teh pass tah I will goin to add it si Newton but there had no being any interest by anyone.
It is only when people fface the problems they they show interest for a momenet and the it vanish leaving me with somethong incomplete that no one will ever used.

in the Netwon thes is a way to implemnet suh system win the Unilateral joints.
I can help you to do that, by thurning the mutibpody rigin car into a Fetherstone solver,

whe can do it in the joint itself. teh jopint contain all teh information we need, and in can be and open source project.
Fetherstone have some limitation but is is good for impelemnetion stuff liek car and rag dool stuff.

also Fethreton is very, very fast, and have zery drifting,
but it has othe problems the if can nor handle kenematic physics loops, it capable handleing small mumber of joint type, like primatic, and revolution
so things tehr are tree like joint constrations like cars, and rag doll when you have one body, follwe but oteh bodies connnecet to their immediante parent but no to any of the sibling
can be solve very eassly.
you will need to deal wo the contacts, but since car a handle contat with the grond by penealy I do not think is is a problme.

if you are up to it I can help you, but only if you are commited, I once offered to help two people woking on two differnet project,
and then the decided to swith to other engine thinking they will find a solution.

This problem have no eassy solution using lagragian dynamics, becaus ethe mathematics equation resulting from such systm brake many rules of numerical analisys,
I beleive I mention that to you a while back when you were starting.
there is not such a thing as a physic equations that will solve all problem,
only snake oil selsman promise miracle cure but those are propaganda to attract consumer.
The solution for that wil cope with the typo of problems will fail to solve other type of problems like of stackings and viseversa.

so if you want we can wok togethe in makin the joint and solve teh preblem as they show.
you have the framework in place, maintly the graphcs and the way to put stuff together.
I can helpe you with the other part.
Julio Jerez
Moderator
Moderator
 
Posts: 12425
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Custom joints vehicle and weak joints

Postby kallaspriit » Thu Nov 19, 2009 7:25 am

I have been thinking of making this hobby project into a bachelor's degree work at my university and while raycast cars are great for basic vehicles and they can be tuned to have good-feeling behaviour, it's still mostly arcade-style. My target has been to put together a car out of parts it would normally consist of and get the realistic feeling and effects depending on suspension geometry and such. It really makes a difference in real world whether you are for example using live axle or double fishbone. If I could combine this with a good tire model, it could make for a pretty good vehicle simulator, I have always wanted to do that :P

NGD has been really great at simulating realistic setups - just put objects together and they will work without having to know the underlying physics involved. I am learning IT not physics, so that's great. Really great work on this library Julio :D

Anyway, I would love to try if you are willing to help me and I'm sure this could benefit other users in the future :)
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Custom joints vehicle and weak joints

Postby Julio Jerez » Thu Nov 19, 2009 8:54 am

It is not a ray cast car, the Featherstone (also knwo as reduced coordinate system formulation) algorithm is a sound mathematical correct algorism.
But the same way lagragian dynamics have limitation, Featherstone also has limitation.

A car is one of those contractions that break both Methods, but since cars handle tire contact by penalty methods, then it Featherstone is more useful for car simulation than Lagrange formulation.

I also have to make it clear that Featherstone do no handle kinetic look, so suspensions where pieces are connected to a parent piece and to a sibling part in cannot be formulated easily.
There are implementation variation that can handle that cases, and we can dealt with the after we get the first implementation.

Basically the implementation will work like this:

we have a main cat body which is the root of the car contraption.
we will make a rigid body for each suspension part and each tire.
We will attack a Unilateral Joint to the Main body part, and we will add

we will create a data structure similar to a Skeleton of a charter animation and wee established the relation form the car body to all of eth pieces,
at each level will well specified the type of joint they will use (there are only two type (slider and revolution).

the in the call back will solve the entire set of reduce joints using Fethretone method.

we will use the collision point and impulsive force of the tire.

Featherstone algorithm is very simple,

basically it is a two pass method,
in the first pass goes for the top of the tree down to each child calculation the Velocity of each body relative to the Parent,
Because each child body part is constrained according to eth joint rule, it is easy to know that the body part can only move alone the free degree of freedom when seen for the parent body.

in the second pass if start form the bottom and move to the top, for each body part it calculate the body acceleration relative to the parent, it is in the phase that the forces are applied (suspension forces, contact forces, engine etc)
Then for at the force and acceleration of the child body alone the free DOF is calculate,
the body is integrated and move in the parent space.
after is doing the same for all other children, it goes to the parent and it calculate very quickly the apparent inertia of the parent body which is affected by the children motion and acceleration.

Now we get a body with a new modified inertia created from the motion of the moving parts, (yes Featherstone simulate weight transfer correctly)
we set the new inertia, and the total next acceleration into the main body part and we let the engine solve the integration and the and handle the collision.
as you can see conceptually is very simple and it is very robust and fast.

the first part you have it, I can do the body car joint as a user joint.
I will need to have the framework that you already have so the I can see how you place the suspension.
the project should not take more than a week or two to set it up.

Just remember, the method have limit as to what kind of contraption can be formulated, Kinematics look are no possible, although it is possible to use an iterative formulation that break the loops
and calculate the force in few passes.

To explain the more clearly a kinematic look is fo example when you have the skeleton of a soldier, and you want to attach a two hand weapon,
the attachment points of the hand to the weapon form a kinematic loop, because the weapon can not have two parents.

this is something we can cope after we have teh first implementation, for the first pass we can make a simple car model that does no brake the rule, keeping the code open to handle the more general formulation.
who knows this could be a very good project, and other people are welcome to participate.

How much time do you have for this?
Julio Jerez
Moderator
Moderator
 
Posts: 12425
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Custom joints vehicle and weak joints

Postby kallaspriit » Thu Nov 19, 2009 5:23 pm

Sounds very interesting and promising, this could indeed turn into something very useful for other users of NGD who could participate in this project. I am not so great with the maths, I hope you can do the heavy lifting on that part :P

What do you need on my side? What I currently have is basically an OgreNewt application. I have implemented methods that enable you to model and define all about the scene and car (including joints) in 3ds Max using OgreMax exporter and while that's convenient, perhaps there is too much going on and we would be better off creating a new and simpler OgreNewt project as base? This would also be easier for others to follow. I know you had problems getting Ogre and OgreNewt to compile, but I could definitely help you with that - there's really nothing too complicated and you don't even have to compile Ogre yourself.

My time is limited as is anyone's but I still have the evening and weekends and I would like to try. What do we need to get started and how can I help :)
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Custom joints vehicle and weak joints

Postby Julio Jerez » Thu Nov 19, 2009 7:36 pm

to get started I will need to get Oger and OgreNewt.
I have tried to get that several time, and each time it wear me out setting path and downlading dependecy packge.
I think I am the only person in the world that can no build Ogre. I had done it in Linux but Linux has teh sinaptic thing tha find depedencies autmatically.

This week end I will try again to get Ogert and also I woul liek to make soem chnged in teh Joint Implemnetation in ogreNewt.
No the they are bad, but teh fact that they are reimplemented from the ground make the update prosses to a new version to comples and error prone.
Ther are C++ but it is no object oriented sicne it os no really re using the code.

Then after that I will implemenet the joint in the Newton Join Library and have it converted to the OgreNewt joint.
from there you will do the graphic part. and maybe try to put int teh Ogre Newt thing if they like to have it.
Julio Jerez
Moderator
Moderator
 
Posts: 12425
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Custom joints vehicle and weak joints

Postby kallaspriit » Fri Nov 20, 2009 2:51 am

Are you using VS9 on Windows? Let us know if you have any problems getting OgreNewt to compile :wink:
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Custom joints vehicle and weak joints

Postby Julio Jerez » Fri Nov 20, 2009 11:22 am

wow you are not going to beleive this after 6 year trying to complie Ogre, some how today I downloade 1.6.4 and I dwoaloded teh precompiled demepndeceyn and for teh first time it compiled.
now I will see if I can run soem of teh demos, then I will try to hook OgreNewt.

I am sussecfull I will try to do soem clean up in OgreNewt, at least bring to a point whe no som much reqreien nee to ne made to get new updates.
I my opinion it sould be such teh New update reuqieds a drop in DLL, and at most soem system error correction.

But the way it si nwo teh joint requres too much work and are undebugable becaus eteh are re implement for scratch, that need to be fixed first.

I hope I can use Ogre and OgreNewt for making some show case demos. I am sick and tired of the GLUI and GLUT wirdness
Julio Jerez
Moderator
Moderator
 
Posts: 12425
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Custom joints vehicle and weak joints

Postby Julio Jerez » Fri Nov 20, 2009 11:55 am

what is thsi error I keep getting
Error 1144 fatal error LNK1212: error opening program database; file is in use c:\ogre\Samples\Instancing\bin\Debug\Demo_Instancing.pdb 1 Demo_Crowd


what are some file the first demo I try to run fail

where are these files: quake3setting.cfg, resurce.cfg, ....
In fact non of the demo run, they miss data.

Now I can no see where it is fail bacase the exeption take the code to the main loop,
to me is really bad programming style using exepction.
it find out you have to step in debug lien by line and that just not good prgramming.

I will edit out that Exeption nonse sence and see what happens.
Julio Jerez
Moderator
Moderator
 
Posts: 12425
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Custom joints vehicle and weak joints

Postby kallaspriit » Fri Nov 20, 2009 8:01 pm

You are getting those errors from Ogre samples? Make sure you are executing the samples from OGRE\Samples\Common\bin\Release and not OGRE\Samples\BSP\bin\Release etc.

I am currently putting together a minimal application using OgreNewt and without using any of the Ogre example framework so all the code is in single place and not spread around many files and folders. I'll post it some time tomorrow and hope you can use that as base.
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Custom joints vehicle and weak joints

Postby kallaspriit » Sat Nov 21, 2009 10:45 am

I have completed the first version of the minimal OgreNewt application project, please try whether you can compile it and let me know of any problems and improvement suggestions.

The topic in OgreNewt forum: http://www.ogre3d.org/addonforums/viewt ... =4&t=11671
Wiki entry: http://www.ogre3d.org/wiki/index.php/Og ... on_Project
Project hosting home: http://code.google.com/p/minimal-ogrenewt/

Others are of-course also welcome to try and comment it, lets make it easier for people to get started with OgreNewt :)
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Custom joints vehicle and weak joints

Postby Julio Jerez » Mon Nov 23, 2009 1:20 pm

I will try your set up but I like to see the Ogre demo running fisrt.

is there a way to run any of the Ogre demos that come with source?
I change the path from mResourcePath = "";
to mResourcePath = "C:/ogre/ReferenceApplication/Common/bin/Debug/";

but it still keep making those funny name.
This is redicule for tree days I have to step in debug mode to find out where Ogre does not Crash, quite franfly guys this is totally redicules.

now I do not these files
pluginName "..\..\..\..\Samples\Common\bin\Debug\RenderSystem_Direct3D7" const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &


Code: Select all
   void Root::loadPlugin(const String& pluginName)
   {
      // Load plugin library
        DynLib* lib = DynLibManager::getSingleton().load( pluginName );
      // Store for later unload
      // Check for existence, because if called 2+ times DynLibManager returns existing entry
      if (std::find(mPluginLibs.begin(), mPluginLibs.end(), lib) == mPluginLibs.end())
      {
         mPluginLibs.push_back(lib);

         // Call startup function
         DLL_START_PLUGIN pFunc = (DLL_START_PLUGIN)lib->getSymbol("dllStartPlugin");

         if (!pFunc)
            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot find symbol dllStartPlugin in library " + pluginName,




where is this file RenderSystem_Direct3D7?
Julio Jerez
Moderator
Moderator
 
Posts: 12425
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Custom joints vehicle and weak joints

Postby Julio Jerez » Mon Nov 23, 2009 1:29 pm

I edit the plug in file to no load Direct7

    # Defines plugins to load

    # Define plugin folder
    PluginFolder=..\..\..\..\Samples\Common\bin\Debug

    # Define D3D rendering implementation plugin
    #Plugin=RenderSystem_Direct3D7
    #Plugin=RenderSystem_Direct3D8
    Plugin=RenderSystem_Direct3D9
    Plugin=RenderSystem_GL
    Plugin=Plugin_FileSystem
    Plugin=Plugin_ParticleFX
    Plugin=Plugin_BSPSceneManager
    #Plugin=Plugin_OctreeSceneManager
    Plugin=Plugin_NatureSceneManager


but the it fail to load RenderSystem_Direct3D9
how can I fix this? and hwo thsi does not runs out of the Box?
Julio Jerez
Moderator
Moderator
 
Posts: 12425
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Custom joints vehicle and weak joints

Postby Julio Jerez » Mon Nov 23, 2009 11:44 pm

After trying and trying I can not really get Ogre to run theirs own demos.
With lot of frustration and agravations I keep modifing the config file, just to enter a new wave and more path
Code: Select all
# Defines plugins to load

# Define plugin folder
PluginFolder=..\..\..\..\Samples\Common\bin\Debug

# Define D3D rendering implementation plugin
#Plugin=RenderSystem_Direct3D7_d
#Plugin=RenderSystem_Direct3D8_d
Plugin=RenderSystem_Direct3D9_d
Plugin=RenderSystem_GL_d
#Plugin=Plugin_FileSystem
Plugin=Plugin_ParticleFX_d
Plugin=Plugin_BSPSceneManager_d
#Plugin=Plugin_OctreeSceneManager_d
#Plugin=Plugin_NatureSceneManager_d

I am sorry by this is just too much for me, I am too old to get a rush from compiling code.
I do not have patient to unwrable things that should just be trivial but instead are gratuitously complicated for not reward, I do not know what it the point of that.
I do not know why an Image of the Ogre directory is zipped as the archive, instead of this moronic set of futile series of steps that in the end makes one tire just from figuring out a pile of junk.
or if they are going to make it so much complicated then with not make an installer that set up everything the way it is suppose to be?
Julio Jerez
Moderator
Moderator
 
Posts: 12425
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron