Robotics StackExchange | Archived questions

how to correct imu gravity

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

...
}

Asked by 942951641@qq.com on 2020-03-04 04:44:06 UTC

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.

Asked by Weasfas on 2020-03-04 05:21:44 UTC

yes, thanks;

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

Asked by 942951641@qq.com on 2020-03-08 03:07:03 UTC

Answers