imu_tracker.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CARTOGRAPHER_MAPPING_IMU_TRACKER_H_
18 #define CARTOGRAPHER_MAPPING_IMU_TRACKER_H_
19 
20 #include "Eigen/Geometry"
22 
23 namespace cartographer {
24 namespace mapping {
25 
26 // Keeps track of the orientation using angular velocities and linear
27 // accelerations from an IMU. Because averaged linear acceleration (assuming
28 // slow movement) is a direct measurement of gravity, roll/pitch does not drift,
29 // though yaw does.
30 class ImuTracker {
31  public:
32  ImuTracker(double imu_gravity_time_constant, common::Time time);
33 
34  // Advances to the given 'time' and updates the orientation to reflect this.
35  void Advance(common::Time time);
36 
37  // Updates from an IMU reading (in the IMU frame).
39  const Eigen::Vector3d& imu_linear_acceleration);
41  const Eigen::Vector3d& imu_angular_velocity);
42 
43  // Query the current orientation estimate.
44  Eigen::Quaterniond orientation() const { return orientation_; }
45 
46  private:
50  Eigen::Quaterniond orientation_;
51  Eigen::Vector3d gravity_vector_;
52  Eigen::Vector3d imu_angular_velocity_;
53 };
54 
55 } // namespace mapping
56 } // namespace cartographer
57 
58 #endif // CARTOGRAPHER_MAPPING_IMU_TRACKER_H_
Eigen::Vector3d imu_angular_velocity_
Definition: imu_tracker.h:52
UniversalTimeScaleClock::time_point Time
Definition: time.h:44
common::Time last_linear_acceleration_time_
Definition: imu_tracker.h:49
Eigen::Quaterniond orientation() const
Definition: imu_tracker.h:44
ImuTracker(double imu_gravity_time_constant, common::Time time)
Definition: imu_tracker.cc:29
void AddImuLinearAccelerationObservation(const Eigen::Vector3d &imu_linear_acceleration)
Definition: imu_tracker.cc:49
void AddImuAngularVelocityObservation(const Eigen::Vector3d &imu_angular_velocity)
Definition: imu_tracker.cc:70
Eigen::Quaterniond orientation_
Definition: imu_tracker.h:50
void Advance(common::Time time)
Definition: imu_tracker.cc:38


cartographer
Author(s):
autogenerated on Wed Jun 5 2019 21:57:58