Autoware.Auto
lanelet2_global_planner_node.hpp
Go to the documentation of this file.
1 // Copyright 2019 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 LANELET2_GLOBAL_PLANNER_NODES__LANELET2_GLOBAL_PLANNER_NODE_HPP_
18 #define LANELET2_GLOBAL_PLANNER_NODES__LANELET2_GLOBAL_PLANNER_NODE_HPP_
19 // ros2
20 #include <rclcpp/rclcpp.hpp>
21 #include <rclcpp_action/rclcpp_action.hpp>
22 #include <std_msgs/msg/string.hpp>
23 #include <geometry_msgs/msg/pose_stamped.hpp>
24 #include <tf2/buffer_core.h>
25 #include <tf2_ros/transform_listener.h>
27 
28 // autoware
31 #include <lanelet2_core/LaneletMap.h>
32 #include <common/types.hpp>
33 #include <autoware_auto_mapping_msgs/srv/had_map_service.hpp>
34 #include <autoware_auto_mapping_msgs/msg/had_map_bin.hpp>
35 #include <autoware_auto_planning_msgs/msg/had_map_route.hpp>
36 #include <autoware_auto_vehicle_msgs/msg/vehicle_kinematic_state.hpp>
38 #include <common/types.hpp>
39 
40 // c++
41 #include <chrono>
42 #include <string>
43 #include <memory>
44 #include <vector>
45 #include <cmath>
46 
47 using namespace std::chrono_literals;
51 
52 namespace autoware
53 {
54 namespace planning
55 {
56 namespace lanelet2_global_planner_nodes
57 {
58 class LANELET2_GLOBAL_PLANNER_NODES_PUBLIC Lanelet2GlobalPlannerNode : public rclcpp::Node
59 {
60 public:
61  explicit Lanelet2GlobalPlannerNode(const rclcpp::NodeOptions & node_options);
62 
63  void request_osm_binary_map();
64  void goal_pose_cb(const geometry_msgs::msg::PoseStamped::SharedPtr msg);
65  void current_pose_cb(const autoware_auto_vehicle_msgs::msg::VehicleKinematicState::SharedPtr msg);
66  void send_global_path(
67  const std::vector<lanelet::Id> & had_map_route,
70  const std_msgs::msg::Header & header);
71  bool8_t transform_pose_to_map(
72  const geometry_msgs::msg::PoseStamped & pose_in, geometry_msgs::msg::PoseStamped & pose_out);
73 
74 private:
75  std::shared_ptr<Lanelet2GlobalPlanner> lanelet2_global_planner;
76  rclcpp::Client<autoware_auto_mapping_msgs::srv::HADMapService>::SharedPtr map_client;
77  rclcpp::Subscription<geometry_msgs::msg::PoseStamped>::SharedPtr goal_pose_sub_ptr;
78  rclcpp::Subscription<autoware_auto_vehicle_msgs::msg::VehicleKinematicState>::SharedPtr
79  current_pose_sub_ptr;
80  rclcpp::Publisher<autoware_auto_planning_msgs::msg::HADMapRoute>::SharedPtr global_path_pub_ptr;
81  geometry_msgs::msg::PoseStamped start_pose;
82  geometry_msgs::msg::PoseStamped goal_pose;
83  bool8_t start_pose_init;
84  tf2::BufferCore tf_buffer;
85  tf2_ros::TransformListener tf_listener;
86 };
87 } // namespace lanelet2_global_planner_nodes
88 } // namespace planning
89 } // namespace autoware
90 
91 #endif // LANELET2_GLOBAL_PLANNER_NODES__LANELET2_GLOBAL_PLANNER_NODE_HPP_
lanelet2_global_planner
Definition: lanelet2_global_planner.launch.py:1
motion::motion_testing_nodes::TrajectoryPoint
autoware_auto_planning_msgs::msg::TrajectoryPoint TrajectoryPoint
Definition: motion_testing_publisher.hpp:36
types.hpp
This file includes common type definition.
visibility_control.hpp
autoware::common::types::bool8_t
bool bool8_t
Definition: types.hpp:39
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
lanelet2_global_planner.hpp
time_utils.hpp
autoware::planning::lanelet2_global_planner::Lanelet2GlobalPlanner
Definition: lanelet2_global_planner.hpp:54
had_map_conversion.hpp
autoware::planning::lanelet2_global_planner_nodes::Lanelet2GlobalPlannerNode
Definition: lanelet2_global_planner_node.hpp:58
autoware::common::types::float64_t
double float64_t
Definition: types.hpp:47