|
12 | 12 | // See the License for the specific language governing permissions and
|
13 | 13 | // limitations under the License.
|
14 | 14 |
|
15 |
| -#ifndef MISSION_PLANNER__MISSION_PLANNER_HPP_ |
16 |
| -#define MISSION_PLANNER__MISSION_PLANNER_HPP_ |
| 15 | +#ifndef MISSION_PLANNER__MISSION_PLANNER_INTERFACE_HPP_ |
| 16 | +#define MISSION_PLANNER__MISSION_PLANNER_INTERFACE_HPP_ |
| 17 | + |
| 18 | +#include <boost/optional.hpp> |
17 | 19 |
|
18 | 20 | #include <string>
|
19 | 21 | #include <vector>
|
|
30 | 32 | #include <autoware_auto_planning_msgs/msg/had_map_route.hpp>
|
31 | 33 | #include <geometry_msgs/msg/pose_stamped.hpp>
|
32 | 34 | #include <geometry_msgs/msg/pose_with_covariance_stamped.hpp>
|
| 35 | +#include <nav_msgs/msg/odometry.hpp> |
33 | 36 |
|
34 | 37 | namespace mission_planner
|
35 | 38 | {
|
36 |
| -class MissionPlanner : public rclcpp::Node |
| 39 | +class MissionPlannerInterface : public rclcpp::Node |
37 | 40 | {
|
38 | 41 | protected:
|
39 |
| - MissionPlanner(const std::string & node_name, const rclcpp::NodeOptions & node_options); |
| 42 | + MissionPlannerInterface(const std::string & node_name, const rclcpp::NodeOptions & node_options); |
40 | 43 |
|
41 |
| - geometry_msgs::msg::PoseStamped goal_pose_; |
42 |
| - geometry_msgs::msg::PoseStamped start_pose_; |
43 |
| - std::vector<geometry_msgs::msg::PoseStamped> checkpoints_; |
| 44 | + geometry_msgs::msg::Pose::ConstSharedPtr ego_pose_; |
| 45 | + std::vector<geometry_msgs::msg::Pose> check_points_; |
44 | 46 |
|
45 |
| - std::string base_link_frame_; |
46 | 47 | std::string map_frame_;
|
47 | 48 |
|
48 | 49 | rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr marker_publisher_;
|
49 | 50 |
|
50 | 51 | virtual bool is_routing_graph_ready() const = 0;
|
51 |
| - virtual autoware_auto_planning_msgs::msg::HADMapRoute plan_route() = 0; |
| 52 | + virtual autoware_auto_planning_msgs::msg::HADMapRoute plan_route( |
| 53 | + const std::vector<geometry_msgs::msg::Pose> & check_points) = 0; |
52 | 54 | virtual void visualize_route(
|
53 | 55 | const autoware_auto_planning_msgs::msg::HADMapRoute & route) const = 0;
|
54 | 56 | virtual void publish_route(const autoware_auto_planning_msgs::msg::HADMapRoute & route) const;
|
55 | 57 |
|
56 | 58 | private:
|
57 | 59 | rclcpp::Publisher<autoware_auto_planning_msgs::msg::HADMapRoute>::SharedPtr route_publisher_;
|
58 | 60 | rclcpp::Subscription<geometry_msgs::msg::PoseStamped>::SharedPtr goal_subscriber_;
|
59 |
| - rclcpp::Subscription<geometry_msgs::msg::PoseStamped>::SharedPtr checkpoint_subscriber_; |
| 61 | + rclcpp::Subscription<geometry_msgs::msg::PoseStamped>::SharedPtr check_point_subscriber_; |
| 62 | + rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr odometry_subscriber_; |
60 | 63 |
|
61 | 64 | tf2_ros::Buffer tf_buffer_;
|
62 | 65 | tf2_ros::TransformListener tf_listener_;
|
63 | 66 |
|
64 |
| - bool get_ego_vehicle_pose(geometry_msgs::msg::PoseStamped * ego_vehicle_pose); |
| 67 | + void odometry_callback(const nav_msgs::msg::Odometry::ConstSharedPtr msg); |
65 | 68 | void goal_pose_callback(const geometry_msgs::msg::PoseStamped::ConstSharedPtr goal_msg_ptr);
|
66 |
| - void checkpoint_callback( |
67 |
| - const geometry_msgs::msg::PoseStamped::ConstSharedPtr checkpoint_msg_ptr); |
68 |
| - bool transform_pose( |
69 |
| - const geometry_msgs::msg::PoseStamped & input_pose, |
70 |
| - geometry_msgs::msg::PoseStamped * output_pose, const std::string & target_frame); |
| 69 | + void check_point_callback( |
| 70 | + const geometry_msgs::msg::PoseStamped::ConstSharedPtr check_point_msg_ptr); |
| 71 | + boost::optional<geometry_msgs::msg::PoseStamped> transform_pose( |
| 72 | + const geometry_msgs::msg::PoseStamped & input_pose, const std::string & target_frame); |
71 | 73 | };
|
72 | 74 |
|
73 | 75 | } // namespace mission_planner
|
74 |
| -#endif // MISSION_PLANNER__MISSION_PLANNER_HPP_ |
| 76 | +#endif // MISSION_PLANNER__MISSION_PLANNER_INTERFACE_HPP_ |
0 commit comments