Nav2 Navigation Stack - jazzy  jazzy
ROS 2 Navigation Stack
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
nav2_bt_navigator::NavigateThroughPosesNavigator Class Reference

A navigator for navigating to a a bunch of intermediary poses. More...

#include <nav2_bt_navigator/include/nav2_bt_navigator/navigators/navigate_through_poses.hpp>

Inheritance diagram for nav2_bt_navigator::NavigateThroughPosesNavigator:
Inheritance graph
[legend]
Collaboration diagram for nav2_bt_navigator::NavigateThroughPosesNavigator:
Collaboration graph
[legend]

Public Types

using ActionT = nav2_msgs::action::NavigateThroughPoses
 
typedef std::vector< geometry_msgs::msg::PoseStamped > Goals
 
- Public Types inherited from nav2_core::BehaviorTreeNavigator< nav2_msgs::action::NavigateThroughPoses >
using Ptr = std::shared_ptr< nav2_core::BehaviorTreeNavigator< nav2_msgs::action::NavigateThroughPoses > >
 

Public Member Functions

 NavigateThroughPosesNavigator ()
 A constructor for NavigateThroughPosesNavigator.
 
bool configure (rclcpp_lifecycle::LifecycleNode::WeakPtr node, std::shared_ptr< nav2_util::OdomSmoother > odom_smoother) override
 A configure state transition to configure navigator's state. More...
 
std::string getName () override
 Get action name for this navigator. More...
 
std::string getDefaultBTFilepath (rclcpp_lifecycle::LifecycleNode::WeakPtr node) override
 Get navigator's default BT. More...
 
- Public Member Functions inherited from nav2_core::BehaviorTreeNavigator< nav2_msgs::action::NavigateThroughPoses >
 BehaviorTreeNavigator ()
 A Navigator constructor.
 
virtual ~BehaviorTreeNavigator ()=default
 Virtual destructor.
 
bool on_configure (rclcpp_lifecycle::LifecycleNode::WeakPtr parent_node, const std::vector< std::string > &plugin_lib_names, const FeedbackUtils &feedback_utils, nav2_core::NavigatorMuxer *plugin_muxer, std::shared_ptr< nav2_util::OdomSmoother > odom_smoother) final
 Configuration to setup the navigator's backend BT and actions. More...
 
bool on_activate () final
 Activation of the navigator's backend BT and actions. More...
 
bool on_deactivate () final
 Deactivation of the navigator's backend BT and actions. More...
 
bool on_cleanup () final
 Cleanup a navigator. More...
 

Protected Member Functions

bool goalReceived (ActionT::Goal::ConstSharedPtr goal) override
 A callback to be called when a new goal is received by the BT action server Can be used to check if goal is valid and put values on the blackboard which depend on the received goal. More...
 
void onLoop () override
 A callback that defines execution that happens on one iteration through the BT Can be used to publish action feedback.
 
void onPreempt (ActionT::Goal::ConstSharedPtr goal) override
 A callback that is called when a preempt is requested.
 
void goalCompleted (typename ActionT::Result::SharedPtr result, const nav2_behavior_tree::BtStatus final_bt_status) override
 A callback that is called when a the action is completed, can fill in action result message or indicate that this action is done. More...
 
bool initializeGoalPoses (ActionT::Goal::ConstSharedPtr goal)
 Goal pose initialization on the blackboard. More...
 
- Protected Member Functions inherited from nav2_core::BehaviorTreeNavigator< nav2_msgs::action::NavigateThroughPoses >
bool onGoalReceived (typename ActionT::Goal::ConstSharedPtr goal)
 An intermediate goal reception function to mux navigators.
 
void onCompletion (typename ActionT::Result::SharedPtr result, const nav2_behavior_tree::BtStatus final_bt_status)
 An intermediate completion function to mux navigators.
 
virtual bool cleanup ()
 Method to cleanup resources.
 
virtual bool activate ()
 Method to activate any threads involved in execution.
 
virtual bool deactivate ()
 Method to deactivate and any threads involved in execution.
 

Protected Attributes

rclcpp::Time start_time_
 
std::string goals_blackboard_id_
 
std::string path_blackboard_id_
 
std::shared_ptr< nav2_util::OdomSmootherodom_smoother_
 
- Protected Attributes inherited from nav2_core::BehaviorTreeNavigator< nav2_msgs::action::NavigateThroughPoses >
std::unique_ptr< nav2_behavior_tree::BtActionServer< nav2_msgs::action::NavigateThroughPoses > > bt_action_server_
 
rclcpp::Logger logger_
 
rclcpp::Clock::SharedPtr clock_
 
FeedbackUtils feedback_utils_
 
NavigatorMuxerplugin_muxer_
 

Detailed Description

A navigator for navigating to a a bunch of intermediary poses.

Definition at line 38 of file navigate_through_poses.hpp.

Member Function Documentation

◆ configure()

bool nav2_bt_navigator::NavigateThroughPosesNavigator::configure ( rclcpp_lifecycle::LifecycleNode::WeakPtr  node,
std::shared_ptr< nav2_util::OdomSmoother odom_smoother 
)
overridevirtual

A configure state transition to configure navigator's state.

Parameters
nodeWeakptr to the lifecycle node
odom_smootherObject to get current smoothed robot's speed

Reimplemented from nav2_core::BehaviorTreeNavigator< nav2_msgs::action::NavigateThroughPoses >.

Definition at line 26 of file navigate_through_poses.cpp.

◆ getDefaultBTFilepath()

std::string nav2_bt_navigator::NavigateThroughPosesNavigator::getDefaultBTFilepath ( rclcpp_lifecycle::LifecycleNode::WeakPtr  node)
overridevirtual

Get navigator's default BT.

Parameters
nodeWeakPtr to the lifecycle node
Returns
string Filepath to default XML

Implements nav2_core::BehaviorTreeNavigator< nav2_msgs::action::NavigateThroughPoses >.

Definition at line 52 of file navigate_through_poses.cpp.

◆ getName()

std::string nav2_bt_navigator::NavigateThroughPosesNavigator::getName ( )
inlineoverridevirtual

Get action name for this navigator.

Returns
string Name of action server

Implements nav2_core::BehaviorTreeNavigator< nav2_msgs::action::NavigateThroughPoses >.

Definition at line 64 of file navigate_through_poses.hpp.

◆ goalCompleted()

void nav2_bt_navigator::NavigateThroughPosesNavigator::goalCompleted ( typename ActionT::Result::SharedPtr  result,
const nav2_behavior_tree::BtStatus  final_bt_status 
)
overrideprotectedvirtual

A callback that is called when a the action is completed, can fill in action result message or indicate that this action is done.

Parameters
resultAction template result message to populate
final_bt_statusResulting status of the behavior tree execution that may be referenced while populating the result.

Implements nav2_core::BehaviorTreeNavigator< nav2_msgs::action::NavigateThroughPoses >.

Definition at line 88 of file navigate_through_poses.cpp.

◆ goalReceived()

bool nav2_bt_navigator::NavigateThroughPosesNavigator::goalReceived ( ActionT::Goal::ConstSharedPtr  goal)
overrideprotectedvirtual

A callback to be called when a new goal is received by the BT action server Can be used to check if goal is valid and put values on the blackboard which depend on the received goal.

Parameters
goalAction template's goal message
Returns
bool if goal was received successfully to be processed

Implements nav2_core::BehaviorTreeNavigator< nav2_msgs::action::NavigateThroughPoses >.

Definition at line 73 of file navigate_through_poses.cpp.

References initializeGoalPoses().

Here is the call graph for this function:

◆ initializeGoalPoses()

bool nav2_bt_navigator::NavigateThroughPosesNavigator::initializeGoalPoses ( ActionT::Goal::ConstSharedPtr  goal)
protected

Goal pose initialization on the blackboard.

Returns
bool if goal was initialized successfully to be processed

Definition at line 213 of file navigate_through_poses.cpp.

Referenced by goalReceived(), and onPreempt().

Here is the caller graph for this function:

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