Autoware.Auto
convert.hpp
Go to the documentation of this file.
1 // Copyright 2020-2021 Apex.AI, Inc., Arm Limited
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 
17 
18 #ifndef COVARIANCE_INSERTION_NODES__CONVERT_HPP_
19 #define COVARIANCE_INSERTION_NODES__CONVERT_HPP_
20 
22 
23 namespace autoware
24 {
25 namespace covariance_insertion_nodes
26 {
27 
28 template<typename InputT>
29 constexpr typename output<InputT>::type convert(const InputT & input_msg) noexcept
30 {
31  static_assert(
33  "The default implementation is only good when the types are the same. "
34  "Otherwise this function has to be specialized.");
35  return input_msg;
36 }
37 
38 template<>
39 typename geometry_msgs::msg::PoseWithCovariance convert(
40  const geometry_msgs::msg::Pose & input_msg) noexcept;
41 
42 template<>
43 typename geometry_msgs::msg::TwistWithCovariance convert(
44  const geometry_msgs::msg::Twist & input_msg) noexcept;
45 
46 template<>
47 typename geometry_msgs::msg::PoseWithCovarianceStamped convert(
48  const geometry_msgs::msg::PoseStamped & input_msg) noexcept;
49 
50 template<>
51 typename geometry_msgs::msg::TwistWithCovarianceStamped convert(
52  const geometry_msgs::msg::TwistStamped & input_msg) noexcept;
53 
54 } // namespace covariance_insertion_nodes
55 } // namespace autoware
56 
57 #endif // COVARIANCE_INSERTION_NODES__CONVERT_HPP_
needs_conversion
Definition: output_type_trait.hpp:36
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
output::type
InputT type
Definition: output_type_trait.hpp:32
autoware::covariance_insertion_nodes::convert
constexpr output< InputT >::type convert(const InputT &input_msg) noexcept
Definition: convert.hpp:29
output_type_trait.hpp