Nav2 Navigation Stack - lyrical  lyrical
ROS 2 Navigation Stack
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
nav2_controller::SimpleProgressChecker Class Reference

This plugin is used to check the position of the robot to make sure that it is actually progressing towards a goal. More...

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

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

Public Member Functions

 SimpleProgressChecker ()=default
 Construct a new Simple Progress Checker object.
 
 ~SimpleProgressChecker ()
 Destroy the Simple Progress Checker object.
 
void initialize (const nav2::LifecycleNode::WeakPtr &parent, const std::string &plugin_name) override
 Initialize the goal checker. More...
 
bool check (geometry_msgs::msg::PoseStamped &current_pose) override
 Checks if the robot has moved compare to previous. More...
 
void reset () override
 Reset the progress checker state.
 

Protected Member Functions

bool isRobotMovedEnough (const geometry_msgs::msg::Pose &pose)
 Calculates robots movement from baseline pose. More...
 
void resetBaselinePose (const geometry_msgs::msg::Pose &pose)
 Resets baseline pose with the current pose of the robot. More...
 
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...
 

Static Protected Member Functions

static double pose_distance (const geometry_msgs::msg::Pose &, const geometry_msgs::msg::Pose &)
 Calculates distance between two poses. More...
 

Protected Attributes

nav2::LifecycleNode::WeakPtr node_
 
rclcpp::Clock::SharedPtr clock_
 
rclcpp::Logger logger_ {rclcpp::get_logger("simple_progress_checker")}
 
double radius_
 
rclcpp::Duration time_allowance_ {0, 0}
 
geometry_msgs::msg::Pose baseline_pose_
 
rclcpp::Time baseline_time_
 
bool baseline_pose_set_ {false}
 
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_
 

Additional Inherited Members

- Public Types inherited from nav2_core::ProgressChecker
typedef std::shared_ptr< nav2_core::ProgressCheckerPtr
 

Detailed Description

This plugin is used to check the position of the robot to make sure that it is actually progressing towards a goal.

Definition at line 34 of file simple_progress_checker.hpp.

Member Function Documentation

◆ check()

bool nav2_controller::SimpleProgressChecker::check ( geometry_msgs::msg::PoseStamped &  current_pose)
overridevirtual

Checks if the robot has moved compare to previous.

Parameters
current_poseCurrent pose of the robot
Returns
true, if the robot has moved enough, false otherwise

Implements nav2_core::ProgressChecker.

Definition at line 70 of file simple_progress_checker.cpp.

References isRobotMovedEnough(), and resetBaselinePose().

Here is the call graph for this function:

◆ initialize()

void nav2_controller::SimpleProgressChecker::initialize ( const nav2::LifecycleNode::WeakPtr &  parent,
const std::string &  plugin_name 
)
overridevirtual

Initialize the goal checker.

Parameters
parentWeak pointer to the lifecycle node
plugin_nameName of the plugin

Implements nav2_core::ProgressChecker.

Definition at line 43 of file simple_progress_checker.cpp.

References updateParametersCallback(), and validateParameterUpdatesCallback().

Referenced by nav2_controller::PoseProgressChecker::initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isRobotMovedEnough()

bool nav2_controller::SimpleProgressChecker::isRobotMovedEnough ( const geometry_msgs::msg::Pose &  pose)
protected

Calculates robots movement from baseline pose.

Parameters
poseCurrent pose of the robot
Returns
true, if movement is greater than radius_, or false

Definition at line 94 of file simple_progress_checker.cpp.

References pose_distance().

Referenced by check().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pose_distance()

double nav2_controller::SimpleProgressChecker::pose_distance ( const geometry_msgs::msg::Pose &  pose1,
const geometry_msgs::msg::Pose &  pose2 
)
staticprotected

Calculates distance between two poses.

Parameters
pose1First pose
pose2Second pose
Returns
Distance between the two poses

Definition at line 99 of file simple_progress_checker.cpp.

Referenced by nav2_controller::PoseProgressChecker::isRobotMovedEnough(), and isRobotMovedEnough().

Here is the caller graph for this function:

◆ resetBaselinePose()

void nav2_controller::SimpleProgressChecker::resetBaselinePose ( const geometry_msgs::msg::Pose &  pose)
protected

Resets baseline pose with the current pose of the robot.

Parameters
poseCurrent pose of the robot

Definition at line 87 of file simple_progress_checker.cpp.

Referenced by nav2_controller::PoseProgressChecker::check(), and check().

Here is the caller graph for this function:

◆ updateParametersCallback()

void nav2_controller::SimpleProgressChecker::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 135 of file simple_progress_checker.cpp.

Referenced by initialize().

Here is the caller graph for this function:

◆ validateParameterUpdatesCallback()

rcl_interfaces::msg::SetParametersResult nav2_controller::SimpleProgressChecker::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 110 of file simple_progress_checker.cpp.

Referenced by initialize().

Here is the caller graph for this function:

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