Easy Navigation
|
Handles navigation goals, their lifecycle, and command interface. More...
#include <GoalManager.hpp>
Public Types | |
enum class | State { IDLE , ACTIVE } |
Current internal goal state. More... | |
Public Member Functions | |
void | check_goals (const geometry_msgs::msg::Pose ¤t_pose, double position_tolerance, double angle_tolerance) |
Check if the robot is currently at the first goal. | |
nav_msgs::msg::Goals | get_goals () const |
Get current goals. | |
State | get_state () const |
Get current internal goal state. | |
GoalManager (NavState &nav_state, rclcpp_lifecycle::LifecycleNode::SharedPtr parent_node) | |
Constructor. | |
void | set_error (const std::string &reason) |
Mark the system as in error state. | |
void | set_failed (const std::string &reason) |
Mark the current goal as failed. | |
void | set_finished () |
Mark the current goal as successfully completed. | |
void | update (NavState &nav_state) |
Update internal logic, including preemption and timeout checks. | |
Handles navigation goals, their lifecycle, and command interface.
Manages goal state, handles external control messages, and interacts with navigation components.
|
strong |
GoalManager | ( | NavState & | nav_state, |
rclcpp_lifecycle::LifecycleNode::SharedPtr | parent_node ) |
Constructor.
nav_state | Shared pointer to navigation state. |
parent_node | Lifecycle node for parameter and interface management. |
void check_goals | ( | const geometry_msgs::msg::Pose & | current_pose, |
double | position_tolerance, | ||
double | angle_tolerance ) |
Check if the robot is currently at the first goal.
Compares the current pose against the first target in the list using positional and angular tolerances.
current_pose | Current pose of the robot. |
position_tolerance | Maximum allowed positional error (meters). |
angle_tolerance | Maximum allowed angular error (radians). |
|
nodiscard |
Get current goals.
|
nodiscard |
Get current internal goal state.
void set_error | ( | const std::string & | reason | ) |
Mark the system as in error state.
reason | Textual explanation. |
void set_failed | ( | const std::string & | reason | ) |
Mark the current goal as failed.
reason | Textual explanation. |
void set_finished | ( | ) |
Mark the current goal as successfully completed.
void update | ( | NavState & | nav_state | ) |
Update internal logic, including preemption and timeout checks.