Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
nav2_controller::AxisGoalChecker Class Reference

Goal Checker plugin that checks progress along the axis defined by the last segment of the path to the goal. More...

#include <nav2_controller/include/nav2_controller/plugins/axis_goal_checker.hpp>

Inheritance diagram for nav2_controller::AxisGoalChecker:
Inheritance graph
[legend]
Collaboration diagram for nav2_controller::AxisGoalChecker:
Collaboration graph
[legend]

Public Member Functions

 AxisGoalChecker ()
 Construct a new Axis Goal Checker object.
 
 ~AxisGoalChecker ()
 Destroy the Axis Goal Checker object.
 
void initialize (const nav2::LifecycleNode::WeakPtr &parent, const std::string &plugin_name, const std::shared_ptr< nav2_costmap_2d::Costmap2DROS > costmap_ros) override
 Initialize the goal checker. More...
 
void reset () override
 Reset the goal checker state.
 
bool isGoalReached (const geometry_msgs::msg::Pose &query_pose, const geometry_msgs::msg::Pose &goal_pose, const geometry_msgs::msg::Twist &velocity, const nav_msgs::msg::Path &transformed_global_plan) override
 Check if the goal is reached. More...
 
bool getTolerances (geometry_msgs::msg::Pose &pose_tolerance, geometry_msgs::msg::Twist &vel_tolerance, double &path_length_tolerance) override
 Get the position and velocity tolerances. More...
 
bool isGoalXYReached (const geometry_msgs::msg::Pose &query_pose, const geometry_msgs::msg::Pose &goal_pose, const geometry_msgs::msg::Twist &velocity, const nav_msgs::msg::Path &transformed_global_plan) override
 Check if XY goal position has been reached (without considering yaw) More...
 

Protected Member Functions

rcl_interfaces::msg::SetParametersResult validateParameterUpdatesCallback (const std::vector< rclcpp::Parameter > &parameters)
 Validate incoming parameter updates before applying them. This callback is triggered when one or more parameters are about to be updated. It checks the validity of parameter values and rejects updates that would lead to invalid or inconsistent configurations. More...
 
void updateParametersCallback (const std::vector< rclcpp::Parameter > &parameters)
 Apply parameter updates after validation This callback is executed when parameters have been successfully updated. It updates the internal configuration of the node with the new parameter values. More...
 

Protected Attributes

double along_path_tolerance_
 
double cross_track_tolerance_
 
double path_length_tolerance_
 
bool is_overshoot_valid_
 
std::mutex mutex_
 
rclcpp::node_interfaces::PostSetParametersCallbackHandle::SharedPtr post_set_params_handler_
 
rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr on_set_params_handler_
 
std::string plugin_name_
 
nav2::LifecycleNode::WeakPtr node_
 
rclcpp::Logger logger_ {rclcpp::get_logger("AxisGoalChecker")}
 

Additional Inherited Members

- Public Types inherited from nav2_core::GoalChecker
typedef std::shared_ptr< nav2_core::GoalCheckerPtr
 

Detailed Description

Goal Checker plugin that checks progress along the axis defined by the last segment of the path to the goal.

This class can be configured to allow overshoot past the goal if the is_overshoot_valid parameter is set to true (which is false by default).

Definition at line 38 of file axis_goal_checker.hpp.

Member Function Documentation

◆ getTolerances()

bool nav2_controller::AxisGoalChecker::getTolerances ( geometry_msgs::msg::Pose &  pose_tolerance,
geometry_msgs::msg::Twist &  vel_tolerance,
double &  path_length_tolerance 
)
overridevirtual

Get the position and velocity tolerances.

Parameters
pose_toleranceOutput parameter for pose tolerance
vel_toleranceOutput parameter for velocity tolerance
path_length_toleranceOutput parameter for path length tolerance
Returns
true if tolerances are available, false otherwise

Implements nav2_core::GoalChecker.

Definition at line 178 of file axis_goal_checker.cpp.

◆ initialize()

void nav2_controller::AxisGoalChecker::initialize ( const nav2::LifecycleNode::WeakPtr &  parent,
const std::string &  plugin_name,
const std::shared_ptr< nav2_costmap_2d::Costmap2DROS costmap_ros 
)
overridevirtual

Initialize the goal checker.

Parameters
parentWeak pointer to the lifecycle node
plugin_nameName of the plugin
costmap_rosShared pointer to the costmap

Implements nav2_core::GoalChecker.

Definition at line 51 of file axis_goal_checker.cpp.

References updateParametersCallback(), and validateParameterUpdatesCallback().

Here is the call graph for this function:

◆ isGoalReached()

bool nav2_controller::AxisGoalChecker::isGoalReached ( const geometry_msgs::msg::Pose &  query_pose,
const geometry_msgs::msg::Pose &  goal_pose,
const geometry_msgs::msg::Twist &  velocity,
const nav_msgs::msg::Path &  transformed_global_plan 
)
overridevirtual

Check if the goal is reached.

Parameters
query_poseCurrent pose of the robot
goal_poseTarget goal pose
velocityCurrent velocity of the robot
transformed_global_planThe transformed global plan
Returns
true if goal is reached, false otherwise

Implements nav2_core::GoalChecker.

Definition at line 85 of file axis_goal_checker.cpp.

References isGoalXYReached().

Here is the call graph for this function:

◆ isGoalXYReached()

bool nav2_controller::AxisGoalChecker::isGoalXYReached ( const geometry_msgs::msg::Pose &  query_pose,
const geometry_msgs::msg::Pose &  goal_pose,
const geometry_msgs::msg::Twist &  velocity,
const nav_msgs::msg::Path &  transformed_global_plan 
)
overridevirtual

Check if XY goal position has been reached (without considering yaw)

Parameters
query_poseThe pose to check
goal_poseThe pose to check against
velocityThe robot's current velocity
transformed_global_planThe global plan after being processed by the path handler
Returns
True if XY goal is reached (position within tolerance, yaw ignored)

Implements nav2_core::GoalChecker.

Definition at line 95 of file axis_goal_checker.cpp.

Referenced by isGoalReached().

Here is the caller graph for this function:

◆ updateParametersCallback()

void nav2_controller::AxisGoalChecker::updateParametersCallback ( const std::vector< rclcpp::Parameter > &  parameters)
protected

Apply parameter updates after validation This callback is executed when parameters have been successfully updated. It updates the internal configuration of the node with the new parameter values.

Parameters
parametersList of parameters that have been updated.

Definition at line 231 of file axis_goal_checker.cpp.

Referenced by initialize().

Here is the caller graph for this function:

◆ validateParameterUpdatesCallback()

rcl_interfaces::msg::SetParametersResult nav2_controller::AxisGoalChecker::validateParameterUpdatesCallback ( const std::vector< rclcpp::Parameter > &  parameters)
protected

Validate incoming parameter updates before applying them. This callback is triggered when one or more parameters are about to be updated. It checks the validity of parameter values and rejects updates that would lead to invalid or inconsistent configurations.

Parameters
parametersList of parameters that are being updated.
Returns
rcl_interfaces::msg::SetParametersResult Result indicating whether the update is accepted.

Definition at line 206 of file axis_goal_checker.cpp.

Referenced by initialize().

Here is the caller graph for this function:

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