mapping_3d/global_trajectory_builder.cc
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 
18 
20 
21 namespace cartographer {
22 namespace mapping_3d {
23 
25  const proto::LocalTrajectoryBuilderOptions& options,
26  const int trajectory_id, SparsePoseGraph* sparse_pose_graph)
27  : trajectory_id_(trajectory_id),
28  sparse_pose_graph_(sparse_pose_graph),
30 
32 
35 }
36 
38  const int submap_index) {
39  return {local_trajectory_builder_->submaps()->Get(submap_index),
41  mapping::SubmapId{trajectory_id_, submap_index})};
42 }
43 
45  const common::Time time, const Eigen::Vector3d& linear_acceleration,
46  const Eigen::Vector3d& angular_velocity) {
47  local_trajectory_builder_->AddImuData(time, linear_acceleration,
48  angular_velocity);
49  sparse_pose_graph_->AddImuData(trajectory_id_, time, linear_acceleration,
50  angular_velocity);
51 }
52 
54  const common::Time time, const Eigen::Vector3f& origin,
55  const sensor::PointCloud& ranges) {
56  auto insertion_result =
57  local_trajectory_builder_->AddRangefinderData(time, origin, ranges);
58 
59  if (insertion_result == nullptr) {
60  return;
61  }
62 
64  insertion_result->time, insertion_result->range_data_in_tracking,
65  insertion_result->pose_observation, trajectory_id_,
66  insertion_result->matching_submap, insertion_result->insertion_submaps);
67 }
68 
70  const transform::Rigid3d& pose) {
71  local_trajectory_builder_->AddOdometerData(time, pose);
72 }
73 
76  return local_trajectory_builder_->pose_estimate();
77 }
78 
79 } // namespace mapping_3d
80 } // namespace cartographer
void AddImuData(common::Time time, const Eigen::Vector3d &linear_acceleration, const Eigen::Vector3d &angular_velocity) override
GlobalTrajectoryBuilder(const proto::LocalTrajectoryBuilderOptions &options, int trajectory_id, mapping_3d::SparsePoseGraph *sparse_pose_graph)
std::unique_ptr< SparsePoseGraph > sparse_pose_graph_
void AddRangefinderData(common::Time time, const Eigen::Vector3f &origin, const sensor::PointCloud &ranges) override
UniversalTimeScaleClock::time_point Time
Definition: time.h:44
transform::Rigid3d pose
void AddImuData(int trajectory_id, common::Time time, const Eigen::Vector3d &linear_acceleration, const Eigen::Vector3d &angular_velocity)
std::unique_ptr< LocalTrajectoryBuilderInterface > local_trajectory_builder_
std::unique_ptr< LocalTrajectoryBuilderInterface > CreateLocalTrajectoryBuilder(const proto::LocalTrajectoryBuilderOptions &local_trajectory_builder_options)
std::vector< Eigen::Vector3f > PointCloud
Definition: point_cloud.h:30
transform::Rigid3d GetSubmapTransform(const mapping::SubmapId &submap_id) EXCLUDES(mutex_) override
int num_submaps(int trajectory_id) EXCLUDES(mutex_) override
std::unique_ptr< KalmanLocalTrajectoryBuilder > local_trajectory_builder_
void AddScan(common::Time time, const sensor::RangeData &range_data_in_tracking, const transform::Rigid3d &pose, int trajectory_id, const Submap *matching_submap, const std::vector< const Submap * > &insertion_submaps) EXCLUDES(mutex_)
void AddOdometerData(common::Time time, const transform::Rigid3d &pose) override


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