Autoware.Auto
policies.hpp
Go to the documentation of this file.
1 // Copyright 2020 the Autoware Foundation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // Co-developed by Tier IV, Inc. and Apex.AI, Inc.
16 
17 #ifndef POINT_CLOUD_MAPPING__POLICIES_HPP_
18 #define POINT_CLOUD_MAPPING__POLICIES_HPP_
19 
22 #include <sensor_msgs/msg/point_cloud2.hpp>
24 #include <tf2_sensor_msgs/tf2_sensor_msgs.h>
25 #include <memory>
26 #include <string>
27 #include <utility>
28 
29 namespace autoware
30 {
31 namespace mapping
32 {
33 namespace point_cloud_mapping
34 {
37 template<typename Derived>
39 {
40 public:
45  template<typename MapRepresentationT>
46  bool ready(const MapRepresentationT & map) const noexcept
47  {
48  return this->impl().ready_(map);
49  }
50 };
51 
53 class POINT_CLOUD_MAPPING_PUBLIC CapacityTrigger : public TriggerPolicyBase<CapacityTrigger>
54 {
55 public:
56  template<typename MapRepresentationT>
57  bool ready_(const MapRepresentationT & map) const noexcept
58  {
59  return map.size() >= map.capacity();
60  }
61 };
62 
65 template<typename Derived>
67 {
68 public:
69  // TODO(yunus.caliskan): return const ref instead?
70 
74  std::string get(const std::string & base_prefix) const noexcept
75  {
76  return this->impl().get_(base_prefix);
77  }
78 };
79 
81 class POINT_CLOUD_MAPPING_PUBLIC TimeStampPrefixGenerator
82  : public PrefixGeneratorBase<TimeStampPrefixGenerator>
83 {
84 public:
85  std::string get_(const std::string & base_prefix) const noexcept;
86 };
87 } // namespace point_cloud_mapping
88 } // namespace mapping
89 } // namespace autoware
90 
91 #endif // POINT_CLOUD_MAPPING__POLICIES_HPP_
autoware::mapping::point_cloud_mapping::PrefixGeneratorBase::get
std::string get(const std::string &base_prefix) const noexcept
Definition: policies.hpp:74
autoware::mapping::point_cloud_mapping::CapacityTrigger
Trigger map writing when map reaches its capacity.
Definition: policies.hpp:53
visibility_control.hpp
autoware::mapping::point_cloud_mapping::TriggerPolicyBase
Definition: policies.hpp:38
autoware::mapping::point_cloud_mapping::TriggerPolicyBase::ready
bool ready(const MapRepresentationT &map) const noexcept
Definition: policies.hpp:46
autoware::mapping::point_cloud_mapping::CapacityTrigger::ready_
bool ready_(const MapRepresentationT &map) const noexcept
Definition: policies.hpp:57
autoware::mapping::point_cloud_mapping::PrefixGeneratorBase
Definition: policies.hpp:66
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
autoware::common::helper_functions::crtp::impl
const Derived & impl() const
Definition: crtp.hpp:32
autoware::common::helper_functions::crtp
Definition: crtp.hpp:29
autoware::mapping::point_cloud_mapping::TimeStampPrefixGenerator
Prefix generator that adds the current time stamp to the end of the base prefix.
Definition: policies.hpp:81
point_cloud_map.hpp
optimized_registration_summary.hpp