range_data_collator.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 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_INTERNAL_RANGE_DATA_COLLATOR_H_
18 #define CARTOGRAPHER_MAPPING_INTERNAL_RANGE_DATA_COLLATOR_H_
19 
20 #include <memory>
21 
24 
25 namespace cartographer {
26 namespace mapping {
27 
28 // Synchronizes TimedPointCloudData from different sensors. Input needs only be
29 // monotonous in 'TimedPointCloudData::time', output is monotonous in per-point
30 // timing. Up to one message per sensor is buffered, so a delay of the period of
31 // the slowest sensor may be introduced, which can be alleviated by passing
32 // subdivisions.
34  public:
36  const std::vector<std::string>& expected_range_sensor_ids)
37  : expected_sensor_ids_(expected_range_sensor_ids.begin(),
38  expected_range_sensor_ids.end()) {}
39 
41  const std::string& sensor_id,
42  const sensor::TimedPointCloudData& timed_point_cloud_data);
43 
44  private:
46 
47  const std::set<std::string> expected_sensor_ids_;
48  // Store at most one message for each sensor.
49  std::map<std::string, sensor::TimedPointCloudData> id_to_pending_data_;
50  common::Time current_start_ = common::Time::min();
51  common::Time current_end_ = common::Time::min();
52 };
53 
54 } // namespace mapping
55 } // namespace cartographer
56 
57 #endif // CARTOGRAPHER_MAPPING_INTERNAL_RANGE_DATA_COLLATOR_H_
const std::set< std::string > expected_sensor_ids_
RangeDataCollator(const std::vector< std::string > &expected_range_sensor_ids)
std::map< std::string, sensor::TimedPointCloudData > id_to_pending_data_
UniversalTimeScaleClock::time_point Time
Definition: time.h:44
sensor::TimedPointCloudOriginData CropAndMerge()
sensor::TimedPointCloudOriginData AddRangeData(const std::string &sensor_id, const sensor::TimedPointCloudData &timed_point_cloud_data)


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:58