Ask Your Question
0

IMU linear acceleration to position

asked 2015-06-19 09:57:41 -0600

ozo gravatar image

updated 2015-06-19 10:31:30 -0600

Hey guys,

I have IMU 3dm_GX2 and I want to get position from it. I know that there will be accumulated error and will not be accurate but I need to get the best out of it. I excluded the gravity effect from linear acceleration

     acceleration_x = (msg->linear_acceleration.x + 9.81 * sin(pitch)) * cos(pitch);
     acceleration_y = (msg->linear_acceleration.y - 9.81 * sin(roll))  * cos(roll);

so whats is the best way for integrating linear acceleration twice because the ordinary integration is very bad.

     Velocity_x= Velocity_old_x+acceleration_x*dt;
     x_pos += Velocity_x*dt;

Thanks in advance

edit retag flag offensive close merge delete

Comments

You should implement an Inertial Navigation Stabilized (or Strapdown) Platform algorithm to get a sort of reliability.

alextoind gravatar imagealextoind ( 2015-06-19 12:28:36 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2015-06-19 12:47:39 -0600

ahendrix gravatar image

Integrating acceleration twice to get position is terrible. I think you're discovering just how bad it actually is.

additionally, your current approach integrates the acceleration without taking into account any possible rotation of the sensor, which means that your results will probably be terrible if the sensor rotates at all.

If you have gyro or compass data from the 3dm_GX2, you may be able to feed all of your data into something like a kalman filter to get better results.

edit flag offensive delete link more

Comments

Hi. I have almost the same problem. And checking your inputs, you are taking a velocity value, where is it coming from? And how do you exclude the gravity effect ???

jafecasu gravatar imagejafecasu ( 2016-05-26 08:40:24 -0600 )edit
0

answered 2015-06-22 07:24:12 -0600

ozo gravatar image

I will try using Kalman filter also I think it will be complicated. I considered the yaw because my model is for a car with yaw

    Velocity_x= Velocity_old_x+acceleration_x*dt;
    Displacement_x += Velocity_x*dt;


    x_pos = (Displacement_x * cos(yaw));
    y_pos =  (Displacement_x * sin(yaw));
edit flag offensive delete link more

Comments

This is not the movement model for a car. You need to incorporate the yaw when you compute displacement, to get dx and dy, and then integrate x and y separately.

ahendrix gravatar imageahendrix ( 2015-06-22 08:39:14 -0600 )edit

is this right ?

     Displacement_x +=Velocity_x*cos(yaw)*dt;

     x_pos += Velocity_x*Displacement_x;
ozo gravatar imageozo ( 2015-06-22 09:01:55 -0600 )edit

No. Why are you multiplying displacement and velocity?

ahendrix gravatar imageahendrix ( 2015-06-22 09:05:24 -0600 )edit

its not displacment its dx ?

ozo gravatar imageozo ( 2015-06-22 09:24:04 -0600 )edit
1

.

dx = velocity * dt * cos(yaw);
dy = velocity * dt * sin(yaw);
x_pos += dx;
y_pos += dy;
ahendrix gravatar imageahendrix ( 2015-06-22 09:33:55 -0600 )edit

Thank You I will try it.

ozo gravatar imageozo ( 2015-06-22 09:57:58 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-06-19 09:57:41 -0600

Seen: 2,590 times

Last updated: Jun 22 '15