collated_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_COLLATED_TRAJECTORY_BUILDER_H_
18 #define CARTOGRAPHER_MAPPING_COLLATED_TRAJECTORY_BUILDER_H_
19 
20 #include <chrono>
21 #include <map>
22 #include <memory>
23 #include <string>
24 #include <unordered_set>
25 
33 
34 namespace cartographer {
35 namespace mapping {
36 
37 // Handles collating sensor data using a sensor::Collator, then passing it on to
38 // a mapping::GlobalTrajectoryBuilderInterface which is common for 2D and 3D.
40  public:
42  sensor::Collator* sensor_collator, int trajectory_id,
43  const std::unordered_set<string>& expected_sensor_ids,
44  std::unique_ptr<GlobalTrajectoryBuilderInterface>
45  wrapped_trajectory_builder);
46  ~CollatedTrajectoryBuilder() override;
47 
50  delete;
51 
52  int num_submaps() override;
53  SubmapData GetSubmapData(int submap_index) override;
54  const PoseEstimate& pose_estimate() const override;
55 
56  void AddSensorData(const string& sensor_id,
57  std::unique_ptr<sensor::Data> data) override;
58 
59  private:
60  void HandleCollatedSensorData(const string& sensor_id,
61  std::unique_ptr<sensor::Data> data);
62 
64  const int trajectory_id_;
65  std::unique_ptr<GlobalTrajectoryBuilderInterface> wrapped_trajectory_builder_;
66 
67  // Time at which we last logged the rates of incoming sensor data.
68  std::chrono::steady_clock::time_point last_logging_time_;
69  std::map<string, common::RateTimer<>> rate_timers_;
70 };
71 
72 } // namespace mapping
73 } // namespace cartographer
74 
75 #endif // CARTOGRAPHER_MAPPING_COLLATED_TRAJECTORY_BUILDER_H_
CollatedTrajectoryBuilder & operator=(const CollatedTrajectoryBuilder &)=delete
std::unique_ptr< GlobalTrajectoryBuilderInterface > wrapped_trajectory_builder_
std::map< string, common::RateTimer<> > rate_timers_
CollatedTrajectoryBuilder(sensor::Collator *sensor_collator, int trajectory_id, const std::unordered_set< string > &expected_sensor_ids, std::unique_ptr< GlobalTrajectoryBuilderInterface > wrapped_trajectory_builder)
void AddSensorData(const string &sensor_id, std::unique_ptr< sensor::Data > data) override
void HandleCollatedSensorData(const string &sensor_id, std::unique_ptr< sensor::Data > data)
std::chrono::steady_clock::time_point last_logging_time_


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