17 #ifndef CARTOGRAPHER_MAPPING_3D_IMU_INTEGRATION_H_ 18 #define CARTOGRAPHER_MAPPING_3D_IMU_INTEGRATION_H_ 24 #include "Eigen/Geometry" 27 #include "glog/logging.h" 30 namespace mapping_3d {
46 const std::deque<ImuData>& imu_data,
const common::Time start_time,
47 const common::Time end_time, std::deque<ImuData>::const_iterator* it);
51 const std::deque<ImuData>& imu_data,
52 const Eigen::Transform<T, 3, Eigen::Affine>&
53 linear_acceleration_calibration,
54 const Eigen::Transform<T, 3, Eigen::Affine>& angular_velocity_calibration,
56 std::deque<ImuData>::const_iterator* it) {
57 CHECK_LE(start_time, end_time);
58 CHECK(*it != imu_data.cend());
59 CHECK_LE((*it)->time, start_time);
60 if ((*it) + 1 != imu_data.cend()) {
61 CHECK_GT(((*it) + 1)->
time, start_time);
67 Eigen::Quaterniond::Identity().cast<T>()};
68 while (current_time < end_time) {
70 if ((*it) + 1 != imu_data.cend()) {
71 next_imu_data = ((*it) + 1)->
time;
73 common::Time next_time = std::min(next_imu_data, end_time);
76 const Eigen::Matrix<T, 3, 1> delta_angle =
77 (angular_velocity_calibration * (*it)->angular_velocity.cast<T>()) *
83 (*it)->linear_acceleration.cast<T>()) *
85 current_time = next_time;
86 if (current_time == next_imu_data) {
96 #endif // CARTOGRAPHER_MAPPING_3D_IMU_INTEGRATION_H_
Eigen::Vector3d angular_velocity
Eigen::Vector3d linear_acceleration
UniversalTimeScaleClock::time_point Time
Eigen::Matrix< T, 3, 1 > delta_velocity
double ToSeconds(const Duration duration)
Eigen::Quaternion< T > delta_rotation
IntegrateImuResult< double > IntegrateImu(const std::deque< ImuData > &imu_data, const common::Time start_time, const common::Time end_time, std::deque< ImuData >::const_iterator *it)