by 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?