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.
 
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.
 

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.

◆ 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.

◆ 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: