Easy Navigation
Loading...
Searching...
No Matches
GoalManager Class Reference

Handles navigation goals, their lifecycle, and command interface. More...

#include <GoalManager.hpp>

Classes

struct  GoalTolerance
 A structure to represent the goal tolerances. More...

Public Types

enum class  State { IDLE , ACTIVE }
 Current internal goal state. More...

Public Member Functions

void check_goals (const geometry_msgs::msg::Pose &current_pose, const GoalTolerance &goal_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.
bool is_paused () const
 Whether the current navigation (if any) is currently paused.
bool is_progress_held () const
 Whether the mission's progress is held (see set_progress_held()).
void read_parameters (NavState &nav_state)
 (Re)reads the parameters (on every configure: the GoalManager outlives cleanup).
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 set_progress_held (bool held)
 Holds or releases the mission's progress.
void update (NavState &nav_state)
 Update internal logic, including preemption and timeout checks.

Detailed Description

Handles navigation goals, their lifecycle, and command interface.

Manages goal state, handles external control messages, and interacts with navigation components.

Member Enumeration Documentation

◆ State

enum class State
strong

Current internal goal state.

Enumerator
IDLE 

No active goal.

ACTIVE 

A goal is currently being pursued.

Constructor & Destructor Documentation

◆ GoalManager()

GoalManager ( NavState & nav_state,
rclcpp_lifecycle::LifecycleNode::SharedPtr parent_node )

Constructor.

Parameters
nav_stateShared pointer to navigation state.
parent_nodeLifecycle node for parameter and interface management.

Member Function Documentation

◆ check_goals()

void check_goals ( const geometry_msgs::msg::Pose & current_pose,
const GoalTolerance & goal_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.

Parameters
current_poseCurrent pose of the robot.
goal_toleranceMaximum allowed error for the goal position and orientation.

◆ get_goals()

nav_msgs::msg::Goals get_goals ( ) const
nodiscard

Get current goals.

Returns
Goals message.

◆ get_state()

State get_state ( ) const
nodiscard

Get current internal goal state.

Returns
GoalManager::State value.

◆ is_paused()

bool is_paused ( ) const
nodiscard

Whether the current navigation (if any) is currently paused.

Returns
True if paused.

◆ is_progress_held()

bool is_progress_held ( ) const
nodiscard

Whether the mission's progress is held (see set_progress_held()).

◆ read_parameters()

void read_parameters ( NavState & nav_state)

(Re)reads the parameters (on every configure: the GoalManager outlives cleanup).

◆ set_error()

void set_error ( const std::string & reason)

Mark the system as in error state.

Parameters
reasonTextual explanation.

◆ set_failed()

void set_failed ( const std::string & reason)

Mark the current goal as failed.

Parameters
reasonTextual explanation.

◆ set_finished()

void set_finished ( )

Mark the current goal as successfully completed.

◆ set_progress_held()

void set_progress_held ( bool held)

Holds or releases the mission's progress.

While held, update() keeps publishing feedback but takes no goal as reached: the robot pose cannot be trusted (see SystemActions::hold_mission_progress()).

◆ update()

void update ( NavState & nav_state)

Update internal logic, including preemption and timeout checks.


The documentation for this class was generated from the following files: