Autoware.Auto
gnss_conversion_node.hpp
Go to the documentation of this file.
1 // Copyright 2021 Apex.AI, Inc.
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 
16 #ifndef GNSS_CONVERSION_NODES__GNSS_CONVERSION_NODE_HPP_
17 #define GNSS_CONVERSION_NODES__GNSS_CONVERSION_NODE_HPP_
18 
19 #include <autoware_auto_msgs/msg/relative_position_with_covariance_stamped.hpp>
20 #include <common/types.hpp>
22 #include <rclcpp/clock.hpp>
23 #include <rclcpp/node.hpp>
24 #include <rclcpp/publisher.hpp>
25 #include <rclcpp/subscription.hpp>
26 #include <sensor_msgs/msg/nav_sat_fix.hpp>
27 
28 #include <GeographicLib/Geocentric.hpp>
29 
30 #include <string>
31 #include <memory>
32 #include <vector>
33 
34 namespace autoware
35 {
36 namespace gnss_conversion_nodes
37 {
38 
42 class GNSS_CONVERSION_NODE_PUBLIC GnssConversionNode : public rclcpp::Node
43 {
44 public:
50  explicit GnssConversionNode(const rclcpp::NodeOptions & options);
51 
52 private:
54  void GNSS_CONVERSION_NODE_LOCAL nav_sat_fix_callback(
55  const sensor_msgs::msg::NavSatFix::ConstSharedPtr msg) const;
56 
58  std::string m_frame_id{};
60  std::string m_child_frame_id{};
62  rclcpp::Publisher<
63  autoware_auto_msgs::msg::RelativePositionWithCovarianceStamped>::SharedPtr m_publisher{};
65  rclcpp::Subscription<sensor_msgs::msg::NavSatFix>::SharedPtr m_gnss_nav_fix_subscription{};
67  std::vector<common::types::float64_t> m_override_variances_diagonal{};
68 
70  GeographicLib::Geocentric m_wgs84_to_ecef_convertor{};
71 
73  mutable rclcpp::Clock m_steady_clock{RCL_STEADY_TIME};
74 };
75 
76 } // namespace gnss_conversion_nodes
77 } // namespace autoware
78 
79 #endif // GNSS_CONVERSION_NODES__GNSS_CONVERSION_NODE_HPP_
autoware::gnss_conversion_nodes::GnssConversionNode
A node used for conversion between GNSS messages and ECEF coordinates.
Definition: gnss_conversion_node.hpp:42
types.hpp
This file includes common type definition.
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
visibility_control.hpp