15 #ifndef NAV2_WAYPOINT_FOLLOWER__PLUGINS__PHOTO_AT_WAYPOINT_HPP_
16 #define NAV2_WAYPOINT_FOLLOWER__PLUGINS__PHOTO_AT_WAYPOINT_HPP_
22 #define _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM
30 #include "rclcpp/rclcpp.hpp"
31 #include "rclcpp_components/register_node_macro.hpp"
33 #include "sensor_msgs/msg/image.hpp"
34 #include "nav2_core/waypoint_task_executor.hpp"
35 #include "opencv2/core.hpp"
36 #include "opencv2/opencv.hpp"
37 #include "cv_bridge/cv_bridge.hpp"
38 #include "image_transport/image_transport.hpp"
41 namespace nav2_waypoint_follower
66 const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent,
67 const std::string & plugin_name);
79 const geometry_msgs::msg::PoseStamped & curr_pose,
const int & curr_waypoint_index);
86 void imageCallback(
const sensor_msgs::msg::Image::SharedPtr msg);
94 static void deepCopyMsg2Mat(
const sensor_msgs::msg::Image::SharedPtr & msg, cv::Mat & mat);
98 std::mutex global_mutex_;
100 std::filesystem::path save_dir_;
102 std::string image_format_;
104 std::string image_topic_;
108 sensor_msgs::msg::Image::SharedPtr curr_frame_msg_;
110 rclcpp::Logger logger_{rclcpp::get_logger(
"nav2_waypoint_follower")};
112 rclcpp::Subscription<sensor_msgs::msg::Image>::SharedPtr camera_image_subscriber_;
Base class for creating a plugin in order to perform a specific task at waypoint arrivals.
bool processAtWaypoint(const geometry_msgs::msg::PoseStamped &curr_pose, const int &curr_waypoint_index)
Override this to define the body of your task that you would like to execute once the robot arrived t...
static void deepCopyMsg2Mat(const sensor_msgs::msg::Image::SharedPtr &msg, cv::Mat &mat)
given a shared pointer to sensor::msg::Image type, make a deep copy to inputted cv Mat
void initialize(const rclcpp_lifecycle::LifecycleNode::WeakPtr &parent, const std::string &plugin_name)
declares and loads parameters used
void imageCallback(const sensor_msgs::msg::Image::SharedPtr msg)
PhotoAtWaypoint()
Construct a new Photo At Waypoint object.
~PhotoAtWaypoint()
Destroy the Photo At Waypoint object.