Accelerometer

9 views
Skip to first unread message

jojosim1

unread,
Mar 26, 2008, 7:39:55 AM3/26/08
to ode-users
Hi

i need to implement the behaviour of an accelerometer but i'm not sure
how to get this task done.
where do i get the accelerations from a box ? is there a way to it ?

cbianchi

unread,
Mar 26, 2008, 9:05:07 AM3/26/08
to ode-users
You could probably start thinking at the acceleration as "the change
in velocity in time".
ODE doesn't give you the acceleration directly, but you can compute it
from the velocity change from a step to previous one.
You can use use: dBodyGetLinearVel / dBodyGetAngularVel to retrieve
linear velocity and angular velocity.
Cristian.

Jon Watte

unread,
Mar 26, 2008, 2:01:22 PM3/26/08
to ode-...@googlegroups.com

You have to keep some state. Remember the velocity the box (or the point
of the box where the meter is mounted) for the previous frame, and
compare to the velocity this frame. The delta is the acceleration;
divide by the time step size to normalize to per-second units.

Sincerely,

jw

Bill Sellers

unread,
Mar 26, 2008, 4:14:00 PM3/26/08
to ode-...@googlegroups.com
Also if you are really trying to emulate a real accelerometer
remember that they always record 1g _upwards_ due to gravity. You'll
need to add this to your calculated acceleration. If you want to be
really clever you could also fiddle with frequency response - some
accelerometers record down to 0 Hz, some don't and have a minimum
frequency. They all have a maximum frequency too.

Cheers
Bill

Reply all
Reply to author
Forward
0 new messages