mapping_2d/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 
19 namespace cartographer {
20 namespace mapping_2d {
21 
23  const proto::LocalTrajectoryBuilderOptions& options,
24  const int trajectory_id, SparsePoseGraph* sparse_pose_graph)
25  : trajectory_id_(trajectory_id),
26  sparse_pose_graph_(sparse_pose_graph),
27  local_trajectory_builder_(options) {}
28 
30 
33 }
34 
36  const int submap_index) {
37  return {local_trajectory_builder_.submaps()->Get(submap_index),
39  mapping::SubmapId{trajectory_id_, submap_index})};
40 }
41 
43  const common::Time time, const Eigen::Vector3f& origin,
44  const sensor::PointCloud& ranges) {
45  std::unique_ptr<LocalTrajectoryBuilder::InsertionResult> insertion_result =
47  time, sensor::RangeData{origin, ranges, {}});
48  if (insertion_result != nullptr) {
50  insertion_result->time, insertion_result->tracking_to_tracking_2d,
51  insertion_result->range_data_in_tracking_2d,
52  insertion_result->pose_estimate_2d, trajectory_id_,
53  insertion_result->matching_submap, insertion_result->insertion_submaps);
54  }
55 }
56 
58  const common::Time time, const Eigen::Vector3d& linear_acceleration,
59  const Eigen::Vector3d& angular_velocity) {
60  local_trajectory_builder_.AddImuData(time, linear_acceleration,
61  angular_velocity);
62  sparse_pose_graph_->AddImuData(trajectory_id_, time, linear_acceleration,
63  angular_velocity);
64 }
65 
67  const transform::Rigid3d& pose) {
69 }
70 
74 }
75 
76 } // namespace mapping_2d
77 } // namespace cartographer
GlobalTrajectoryBuilder(const proto::LocalTrajectoryBuilderOptions &options, int trajectory_id, SparsePoseGraph *sparse_pose_graph)
const mapping::GlobalTrajectoryBuilderInterface::PoseEstimate & pose_estimate() const
transform::Rigid3d GetSubmapTransform(const mapping::SubmapId &submap_id) EXCLUDES(mutex_) override
std::unique_ptr< SparsePoseGraph > sparse_pose_graph_
const Submap * Get(int index) const override
Definition: 2d/submaps.cc:175
UniversalTimeScaleClock::time_point Time
Definition: time.h:44
transform::Rigid3d pose
std::unique_ptr< InsertionResult > AddHorizontalRangeData(common::Time, const sensor::RangeData &range_data)
void AddImuData(int trajectory_id, common::Time time, const Eigen::Vector3d &linear_acceleration, const Eigen::Vector3d &angular_velocity)
void AddOdometerData(common::Time time, const transform::Rigid3d &pose) override
void AddOdometerData(common::Time time, const transform::Rigid3d &pose)
void AddScan(common::Time time, const transform::Rigid3d &tracking_to_pose, const sensor::RangeData &range_data_in_pose, const transform::Rigid2d &pose, int trajectory_id, const mapping::Submap *matching_submap, const std::vector< const mapping::Submap * > &insertion_submaps) EXCLUDES(mutex_)
std::vector< Eigen::Vector3f > PointCloud
Definition: point_cloud.h:30
void AddImuData(common::Time time, const Eigen::Vector3d &linear_acceleration, const Eigen::Vector3d &angular_velocity)
void AddRangefinderData(common::Time time, const Eigen::Vector3f &origin, const sensor::PointCloud &ranges) override
const mapping::GlobalTrajectoryBuilderInterface::PoseEstimate & pose_estimate() const override
std::unique_ptr< KalmanLocalTrajectoryBuilder > local_trajectory_builder_
int num_submaps(int trajectory_id) EXCLUDES(mutex_) override
void AddImuData(common::Time time, const Eigen::Vector3d &linear_acceleration, const Eigen::Vector3d &angular_velocity) override


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