18#ifndef EASYNAV_SYSTEM__GOALMANAGERCLIENT_HPP_
19#define EASYNAV_SYSTEM__GOALMANAGERCLIENT_HPP_
23#include "rclcpp/rclcpp.hpp"
24#include "easynav_interfaces/msg/navigation_control.hpp"
25#include "geometry_msgs/msg/pose_stamped.hpp"
26#include "nav_msgs/msg/goals.hpp"
51 ACCEPTED_AND_NAVIGATING,
69 void send_goal(
const geometry_msgs::msg::PoseStamped & goal);
75 void send_goals(
const nav_msgs::msg::Goals & goals);
119 return control_pub_->get_subscription_count() > 1;
126 [[nodiscard]]
const easynav_interfaces::msg::NavigationControl &
get_last_control()
const;
132 [[nodiscard]]
const easynav_interfaces::msg::NavigationControl &
get_feedback()
const;
138 [[nodiscard]]
const easynav_interfaces::msg::NavigationControl &
get_result()
const;
142 rclcpp::Node::SharedPtr node_;
145 rclcpp::Publisher<easynav_interfaces::msg::NavigationControl>::SharedPtr control_pub_;
148 rclcpp::Subscription<easynav_interfaces::msg::NavigationControl>::SharedPtr control_sub_;
151 easynav_interfaces::msg::NavigationControl::UniquePtr last_control_;
154 easynav_interfaces::msg::NavigationControl last_feedback_;
157 easynav_interfaces::msg::NavigationControl last_result_;
166 bool paused_ {
false};
169 void control_callback(easynav_interfaces::msg::NavigationControl::UniquePtr msg);
void cancel()
Cancel the current goal.
Definition GoalManagerClient.cpp:241
const easynav_interfaces::msg::NavigationControl & get_feedback() const
Get the most recent feedback received.
Definition GoalManagerClient.cpp:179
const easynav_interfaces::msg::NavigationControl & get_result() const
Get the last result message received.
Definition GoalManagerClient.cpp:185
void resume()
Resume a previously paused goal.
Definition GoalManagerClient.cpp:288
void send_goals(const nav_msgs::msg::Goals &goals)
Send a list of goals to the GoalManager.
Definition GoalManagerClient.cpp:203
void send_goal(const geometry_msgs::msg::PoseStamped &goal)
Send a single goal to the GoalManager.
Definition GoalManagerClient.cpp:191
State
Internal state of the client-side goal manager.
Definition GoalManagerClient.hpp:47
const easynav_interfaces::msg::NavigationControl & get_last_control() const
Get the last control message sent or received.
Definition GoalManagerClient.cpp:173
void pause()
Pause the currently active EasyNav navigation.
Definition GoalManagerClient.cpp:265
GoalManagerClient(rclcpp::Node::SharedPtr node)
Constructor.
Definition GoalManagerClient.cpp:31
bool is_paused() const
Whether the currently navigating goal is paused.
Definition GoalManagerClient.hpp:100
State get_state() const
Get the current internal state.
Definition GoalManagerClient.hpp:111
bool is_connected() const
Check whether another subscriber besides the client is present on the control topic.
Definition GoalManagerClient.hpp:117
void reset()
Reset internal client state.
Definition GoalManagerClient.cpp:307
Definition CircularBuffer.hpp:24