# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 1 post ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Featherstone Algorithm in BulletPosted: Thu Jul 12, 2012 6:13 pm

Joined: Sat Nov 20, 2010 5:14 pm
Posts: 6
I'm having trouble with my implementation of Featherstone's Articulated Body Algorithm. The trouble is not necessarily with the algorithm itself, but how I put it's results into Bullet (I believe).

It's a 2 link chain "connected" with a revolute joint (no actual constraint on the parts), where 1 link is immobile, and the other swings freely under gravity. Collisions are off. Mass and inertia values are 1 to simplify calculations whilst I'm debugging.

I've attached a modified RagdollDemo.cpp file which demonstrates the problem.

During a timestep, I do the following:
- Calculate linear (v) and angular velocity (w) from joint velocity (qd).
- Use these to determine joint accelerations (qdd)
- Use the joint acceleration to calculate linear (a) and angular acceleration (alpha).
- v = v + a*timeStep, w = w + alpha*timeStep, qd = qd + qdd * step
- Set the body to have these velocities
- Step the simulation

The problem I have is that it will drift, in no time at all the bodies have separated.

To try and get a better grasp of what's going on, I did velocity integration myself, and setting rotations and positions, pretty much taking bullet out of the equation. This also left me explicit control over the substepping. I find the drift reduces with more substeps. The demo initially has 20 substeps on the featherstone algorithm (in clientMoveAndDisplay()).

In the demo you can toggle Bullet on (b) or use my integration (n) with key presses to see the difference in drift that I'm talking about (it also resets to the original position).

How can I increase the accuracy in the case of Bullet? I have tried substepping, but I am either not using it correctly, or there aren't enough substeps to reduce the drift, because I can't see an improvement. It's bad enough with a single link, it's going to be a mess within just a few seconds of simulation with a full character.

Any ideas?

Tom

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities