markdown文件可在https://github.com/learnmoreonce/SLAM 下载
文件:imu_tracker.h
#ifndef CARTOGRAPHER_MAPPING_IMU_TRACKER_H_
#define CARTOGRAPHER_MAPPING_IMU_TRACKER_H_
#include "Eigen/Geometry"
#include "cartographer/common/time.h"
namespace cartographer {
namespace mapping {
/*
ImuTracker
作用:使用来自imu的角速度+加速度用于跟踪pose的orientation
构造函数指定重力加速度g和最新测量时间。
数据成员包含
1,加速度g
2,测量时间
3,方向,四元数
4,三个加速度3d
5,imu角速度
*/
// Keeps track of the orientation using angular velocities and linear
// accelerations from an IMU. Because averaged linear acceleration (assuming
// slow movement) is a direct measurement of gravity,
// roll/pitch does not drift,though yaw does.
//x,y轴不会drift漂移。z轴可能会产生漂移。(有累计误差)
class ImuTracker {
public:
ImuTracker(double imu_gravity_time_constant, common::Time time);
// Advances to the given 'time' and updates the orientation to reflect this.
// 系统时间增加t,更新方向角
void Advance(common::Time time);
// Updates from an IMU reading (in the IMU frame).
void AddImuLinearAccelerationObservation( //加速度
const Eigen::Vector3d& imu_linear_acceleration);
void AddImuAngularVelocityObservation( //角速度
const Eigen::Vector3d& imu_angular_velocity);
// Quer