mapping_2d/local_trajectory_builder.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_2D_LOCAL_TRAJECTORY_BUILDER_H_
18 #define CARTOGRAPHER_MAPPING_2D_LOCAL_TRAJECTORY_BUILDER_H_
19 
20 #include <memory>
21 
26 #include "cartographer/mapping_2d/proto/local_trajectory_builder_options.pb.h"
34 
35 namespace cartographer {
36 namespace mapping_2d {
37 
38 // Wires up the local SLAM stack (i.e. UKF, scan matching, etc.) without loop
39 // closure.
41  public:
42  struct InsertionResult {
45  std::vector<const mapping::Submap*> insertion_submaps;
49  };
50 
51  explicit LocalTrajectoryBuilder(
52  const proto::LocalTrajectoryBuilderOptions& options);
54 
57 
59  const;
60  std::unique_ptr<InsertionResult> AddHorizontalRangeData(
61  common::Time, const sensor::RangeData& range_data);
62  void AddImuData(common::Time time, const Eigen::Vector3d& linear_acceleration,
63  const Eigen::Vector3d& angular_velocity);
65 
66  Submaps* submaps();
67 
68  private:
71  const sensor::RangeData& range_data) const;
72 
73  // Scan matches 'range_data_in_tracking_2d' and fill in the 'pose_observation'
74  // with the result.
75  void ScanMatch(common::Time time, const transform::Rigid3d& pose_prediction,
78  transform::Rigid3d* pose_observation);
79 
80  // Lazily constructs an ImuTracker.
82 
83  // Updates the current estimate to reflect the given 'time'.
85 
86  const proto::LocalTrajectoryBuilderOptions options_;
89 
90  // Current 'pose_estimate_' and 'velocity_estimate_' at 'time_'.
91  common::Time time_ = common::Time::min();
93  Eigen::Vector2d velocity_estimate_ = Eigen::Vector2d::Zero();
94  common::Time last_scan_match_time_ = common::Time::min();
95  // This is the difference between the model (constant velocity, IMU)
96  // prediction 'pose_estimate_' and the odometry prediction. To get the
97  // odometry prediction, right-multiply this to 'pose_estimate_'.
99 
104 
105  std::unique_ptr<mapping::ImuTracker> imu_tracker_;
107 };
108 
109 } // namespace mapping_2d
110 } // namespace cartographer
111 
112 #endif // CARTOGRAPHER_MAPPING_2D_LOCAL_TRAJECTORY_BUILDER_H_
sensor::RangeData TransformAndFilterRangeData(const transform::Rigid3f &tracking_to_tracking_2d, const sensor::RangeData &range_data) const
const mapping::GlobalTrajectoryBuilderInterface::PoseEstimate & pose_estimate() const
void ScanMatch(common::Time time, const transform::Rigid3d &pose_prediction, const transform::Rigid3d &tracking_to_tracking_2d, const sensor::RangeData &range_data_in_tracking_2d, transform::Rigid3d *pose_observation)
UniversalTimeScaleClock::time_point Time
Definition: time.h:44
mapping::GlobalTrajectoryBuilderInterface::PoseEstimate last_pose_estimate_
transform::Rigid3d pose
std::unique_ptr< InsertionResult > AddHorizontalRangeData(common::Time, const sensor::RangeData &range_data)
void AddOdometerData(common::Time time, const transform::Rigid3d &pose)
scan_matching::RealTimeCorrelativeScanMatcher real_time_correlative_scan_matcher_
void AddImuData(common::Time time, const Eigen::Vector3d &linear_acceleration, const Eigen::Vector3d &angular_velocity)
LocalTrajectoryBuilder(const proto::LocalTrajectoryBuilderOptions &options)
LocalTrajectoryBuilder & operator=(const LocalTrajectoryBuilder &)=delete


cartographer
Author(s):
autogenerated on Mon Jun 10 2019 12:51:38