cartographer icon indicating copy to clipboard operation
cartographer copied to clipboard

question about imu tracker's gravity vector

Open weidezhang opened this issue 5 years ago • 4 comments

Hi, I'm still confused about how gravity vector was updated in IMU tracker's AddIMULinearAccelerationObservation function.

gravity_vector_ = (1. - alpha) * gravity_vector_ + alpha * imu_linear_acceleration;

As far as I understand, gravity_vector represents the gravitational direction in tracking frame. confused about why imu_linear_acceleration can add with gravity_vector ? what does the result mean ?

weidezhang avatar Nov 14 '19 15:11 weidezhang

This is a simple first-order exponential smoothing filter which slowly pulls the value of gravity_vector_ towards the value of imu_linear_acceleration. It is usually used when your measurements are noisy (like imu_linear_acceleration are), but you want to follow the moving average of those measurements.

See https://en.wikipedia.org/wiki/Exponential_smoothing

ojura avatar Nov 14 '19 19:11 ojura

thanks. i guess it also assumes the imu_linear_acceleration is mostly due to gravity instead of motion ? // Change the orientation_ so that it agrees with the current // gravity_vector_. const Eigen::Quaterniond rotation = Eigen::Quaterniond::FromTwoVectors( gravity_vector_, orientation_.conjugate() * Eigen::Vector3d::UnitZ()); orientation_ = (orientation_ * rotation).normalized();

@ojura do you know why we need to adjust the orientation to the gravity vector ? isn't those the same thing or different ?

weidezhang avatar Nov 14 '19 19:11 weidezhang

ments are noisy (like imu_linear_ac void ImuTracker::Advance(const common::Time time) { CHECK_LE(time_, time); const double delta_t = common::ToSeconds(time - time_); const Eigen::Quaterniond rotation = transform::AngleAxisVectorToRotationQuaternion( Eigen::Vector3d(imu_angular_velocity_ * delta_t)); orientation_ = (orientation_ * rotation).normalized(); gravity_vector_ = rotation.conjugate() * gravity_vector_; time_ = time; }

Every imu measure step,the gravity vector is converted its frame,is it right? If there is a filter for imu acc data,it should be filtered in robot imu frame or in earth frame.But the frame in this is always transformed between robot imu body frame and earth frame.

garlinplus avatar Dec 02 '19 03:12 garlinplus

ments are noisy (like imu_linear_ac void ImuTracker::Advance(const common::Time time) { CHECK_LE(time_, time); const double delta_t = common::ToSeconds(time - time_); const Eigen::Quaterniond rotation = transform::AngleAxisVectorToRotationQuaternion( Eigen::Vector3d(imu_angular_velocity_ * delta_t)); orientation_ = (orientation_ * rotation).normalized(); gravity_vector_ = rotation.conjugate() * gravity_vector_; time_ = time; }

Every imu measure step,the gravity vector is converted its frame,is it right? If there is a filter for imu acc data,it should be filtered in robot imu frame or in earth frame.But the frame in this is always transformed between robot imu body frame and earth frame.

I just want to konw why alhpa equals exp(-delta_t/im_gravity_time_constant_) ???

kyo055 avatar Apr 22 '21 08:04 kyo055