Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
elchtest mod :)
03-16-2010, 12:50 PM,
#61
 
I haven't noticed(visually) any floating so far. But I touched/rewrote a number of functions/classes in my branch(like the wheel forces calculation).

I have had heavy oscillations on some cars (lowrider style jumping :lolSmile. There must be something wrong with their suspension setup. As they trigger the overtravel workaround in CARDYNAMICS::ApplySuspensionForceToBody(). Commented it out for now. It should be solved using a constraint anyway.

The cylinder shape wheels are on my todo list. Will use your code as reference.
Reply
03-16-2010, 01:15 PM,
#62
 
Then I'll have to take a look at it.
What was wrong with the wheel forces?
Did you sync the same way, I do?
Reply
03-16-2010, 01:30 PM,
#63
 
Code:
void CAR::updateAction(btCollisionWorld* collisionWorld, btScalar dt)
{
    // cardynamics run then times faster then bullet
    const float num_repeats = 10;
    const float internal_dt = dt / num_repeats;
    
    // overwrite vdrift pose/velocities with bullet calculation
    UpdateDynamics();
    
    // init deltaAngularVelocity (contains sum over all delta Velocities in substeps)
    MATHVECTOR<float, 3> newAngularVelocity = dynamics.GetBody().GetAngularVelocity();
    MATHVECTOR<float, 3> oldPosition = dynamics.GetBody().GetPosition();

    //double old_force = force_feedback;
    //force_feedback = 0;

    UpdateWheelContacts();

    // apply several vdrift steps (cause frequency must be very high for a vehicle)
    for(int i = 0; i < num_repeats; ++i)
    {
        // get the new engine and so on sounds
        //UpdateSounds(internal_dt);

        //force_feedback += GetFeedback();

        // set forward the vdrift physics
        InterpolateWheelContacts();
        TickPhysics(internal_dt);
        
        // accumulate delta velocity
        newAngularVelocity = newAngularVelocity + dynamics.GetBody().GetAngularVelocity();
    }
    newAngularVelocity = dynamics.GetBody().GetAngularVelocity();//deltaAngularVelocity / (num_repeats + 1);
    //force_feedback /= num_repeats;

    MATHVECTOR<float, 3> newPosition = dynamics.GetBody().GetPosition();
    MATHVECTOR<float, 3> newVelocity = dynamics.GetBody().GetVelocity();//(newPosition - oldPosition) / dt;

    // update the Bullet angular and linear Velocities: This is the only connection from Vdrift to bullet
    UpdateChassis(newVelocity, newAngularVelocity);
}

Oh, I am interpolating wheel contacts(plane approximation) in the inner loop.
And the simulation dt depends on the framerate atm.

The original wheel forces code contains some bugs I tried to fix in my "elchtest" modification.
Reply
03-20-2010, 07:38 AM,
#64
 
OK, I am late, but here are some videos of the prototype of our simulation.
(Wheel collision detection is done by the cylinder.)
Again thanks! Vdrift spared us a lot of time and the results are better than I could ever imagine!


http://wwwiaim.ira.uka.de/users/brechtel..._passt.avi
http://wwwiaim.ira.uka.de/users/brechtel...tNicht.avi
http://wwwiaim.ira.uka.de/users/brechtel...nalcut.avi
http://wwwiaim.ira.uka.de/users/brechtel...an_cut.avi
http://wwwiaim.ira.uka.de/users/brechtel...beitet.avi
http://wwwiaim.ira.uka.de/users/brechtel...ut_cut.m4v
http://wwwiaim.ira.uka.de/users/brechtel/stadtNeu.avi
http://wwwiaim.ira.uka.de/users/brechtel/untitled.mp4
Reply
03-20-2010, 12:10 PM,
#65
 
Hey, that's really cool! Thanks for sharing. :-)
Reply
03-22-2010, 12:19 PM,
#66
 
This is the project website? Smile
http://www.kognimobil.org/index.php
Reply
03-30-2010, 10:37 AM,
#67
 
Yes indeed.
I think a pretty interesting topic!
Perhaps you will get a super bot for vdrift as a spinoff Smile
(Although it will stop at every crossing and wait for others who arrived first to pass Big Grin)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)