Autoware.Auto
covariance_insertion.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 
19 
20 #ifndef COVARIANCE_INSERTION__COVARIANCE_INSERTION_HPP_
21 #define COVARIANCE_INSERTION__COVARIANCE_INSERTION_HPP_
22 
23 #include <common/types.hpp>
26 
27 #include <map>
28 #include <string>
29 #include <vector>
30 
31 namespace autoware
32 {
33 namespace covariance_insertion
34 {
36 class COVARIANCE_INSERTION_PUBLIC CovarianceInsertion
37 {
38 public:
41 
44  template<typename MsgT>
45  void set_all_covariances(MsgT * msg)
46  {
47  if (!msg) {return;}
48  for (const auto & kv : m_covariances) {
49  const auto & field = kv.first;
50  const auto & covariance = kv.second;
51  add_covariance(msg, covariance, field);
52  }
53  }
54 
56  bool covariances_empty();
57 
61  void insert_covariance(
62  const std::string & field,
63  const std::vector<common::types::float64_t> & covariance);
64 
65 private:
67  std::map<std::string, std::vector<common::types::float64_t>> m_covariances;
68 };
69 } // namespace covariance_insertion
70 } // namespace autoware
71 
72 #endif // COVARIANCE_INSERTION__COVARIANCE_INSERTION_HPP_
types.hpp
This file includes common type definition.
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
add_covariance.hpp
autoware::covariance_insertion::CovarianceInsertion
Class for performing covariance insertion.
Definition: covariance_insertion.hpp:36
visibility_control.hpp
autoware::covariance_insertion::CovarianceInsertion::set_all_covariances
void set_all_covariances(MsgT *msg)
populate msg from the covarianes
Definition: covariance_insertion.hpp:45
autoware::covariance_insertion::add_covariance
void add_covariance(MsgT *msg, const std::vector< ScalarT > &covariance, const std::enable_if_t< has_covariance_member< MsgT >::value, std::string > &field)
Definition: add_covariance.hpp:42