how to correct imu gravity [closed]

asked 2020-03-04 03:44:06 -0600

942951641@qq.com gravatar image

updated 2020-03-04 03:53:06 -0600

gvdhoorn gravatar image

there is a code use odometry transform * tf::Vector(0,0, gravity) to correct imu gravity, how can i understand it ?

for example code:

void ImuOdom::updateOdom(const sensor_msgs::ImuConstPtr& data)
{

  // update time values
  last_time_ = current_time_;

  current_time_ = data->header.stamp;

  double dt = (current_time_ - last_time_).toSec();

  // update velocity in body-fixed frame
  tf::Vector3 lin_acc;

  tf::vector3MsgToTF(data->linear_acceleration, lin_acc);

  lin_acc -= odom_tf_*tf::Vector3(0,0,G_STD_); // correct gravity

...
}
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by 942951641@qq.com
close date 2020-03-23 21:52:28.999149

Comments

Hi @942951641@qq.com,

I think it is only subtracting the standard gravity acceleration: 9.8 m/s² with the component Z of the vector.

Weasfas gravatar image Weasfas  ( 2020-03-04 04:21:44 -0600 )edit

yes, thanks;

odom_tf_ only include rotation info, translation info excluded, so it really extract gravity acceleration

942951641@qq.com gravatar image 942951641@qq.com  ( 2020-03-08 03:07:03 -0600 )edit