Nav2 Navigation Stack - jazzy
jazzy
ROS 2 Navigation Stack
|
Navigator interface that acts as a base class for all BT-based Navigator action's plugins All methods from NavigatorBase are marked as final so they may not be overrided by derived methods - instead, users should use the appropriate APIs provided after BT Action handling. More...
#include <nav2_core/include/nav2_core/behavior_tree_navigator.hpp>
Public Types | |
using | Ptr = std::shared_ptr< nav2_core::BehaviorTreeNavigator< ActionT > > |
Public Member Functions | |
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... | |
virtual std::string | getDefaultBTFilepath (rclcpp_lifecycle::LifecycleNode::WeakPtr node)=0 |
virtual std::string | getName ()=0 |
Get the action name of this navigator to expose. More... | |
Protected Member Functions | |
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 | goalReceived (typename ActionT::Goal::ConstSharedPtr goal)=0 |
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. | |
virtual void | onLoop ()=0 |
A callback that defines execution that happens on one iteration through the BT Can be used to publish action feedback. | |
virtual void | onPreempt (typename ActionT::Goal::ConstSharedPtr goal)=0 |
A callback that is called when a preempt is requested. | |
virtual void | goalCompleted (typename ActionT::Result::SharedPtr result, const nav2_behavior_tree::BtStatus final_bt_status)=0 |
A callback that is called when a the action is completed; Can fill in action result message or indicate that this action is done. | |
virtual bool | configure (rclcpp_lifecycle::LifecycleNode::WeakPtr, std::shared_ptr< nav2_util::OdomSmoother >) |
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 | |
std::unique_ptr< nav2_behavior_tree::BtActionServer< ActionT > > | bt_action_server_ |
rclcpp::Logger | logger_ {rclcpp::get_logger("Navigator")} |
rclcpp::Clock::SharedPtr | clock_ |
FeedbackUtils | feedback_utils_ |
NavigatorMuxer * | plugin_muxer_ |
Navigator interface that acts as a base class for all BT-based Navigator action's plugins All methods from NavigatorBase are marked as final so they may not be overrided by derived methods - instead, users should use the appropriate APIs provided after BT Action handling.
Definition at line 159 of file behavior_tree_navigator.hpp.
|
inlineprotectedvirtual |
Method | to configure resources. |
Reimplemented in nav2_bt_navigator::NavigateToPoseNavigator, and nav2_bt_navigator::NavigateThroughPosesNavigator.
Definition at line 347 of file behavior_tree_navigator.hpp.
Referenced by nav2_core::BehaviorTreeNavigator< ActionT >::on_configure().
|
pure virtual |
Get the action name of this navigator to expose.
Implemented in nav2_bt_navigator::NavigateToPoseNavigator, and nav2_bt_navigator::NavigateThroughPosesNavigator.
Referenced by nav2_core::BehaviorTreeNavigator< ActionT >::on_configure(), nav2_core::BehaviorTreeNavigator< ActionT >::onCompletion(), and nav2_core::BehaviorTreeNavigator< ActionT >::onGoalReceived().
|
inlinefinalvirtual |
Activation of the navigator's backend BT and actions.
Implements nav2_core::NavigatorBase.
Definition at line 235 of file behavior_tree_navigator.hpp.
References nav2_core::BehaviorTreeNavigator< ActionT >::activate().
|
inlinefinalvirtual |
Cleanup a navigator.
Implements nav2_core::NavigatorBase.
Definition at line 264 of file behavior_tree_navigator.hpp.
References nav2_core::BehaviorTreeNavigator< ActionT >::cleanup().
|
inlinefinalvirtual |
Configuration to setup the navigator's backend BT and actions.
parent_node | The ROS parent node to utilize |
plugin_lib_names | a vector of plugin shared libraries to load |
feedback_utils | Some utilities useful for navigators to have |
plugin_muxer | The muxing object to ensure only one navigator can be active at a time |
odom_smoother | Object to get current smoothed robot's speed |
Implements nav2_core::NavigatorBase.
Definition at line 188 of file behavior_tree_navigator.hpp.
References nav2_core::BehaviorTreeNavigator< ActionT >::configure(), nav2_core::BehaviorTreeNavigator< ActionT >::getName(), nav2_core::BehaviorTreeNavigator< ActionT >::onCompletion(), nav2_core::BehaviorTreeNavigator< ActionT >::onGoalReceived(), nav2_core::BehaviorTreeNavigator< ActionT >::onLoop(), and nav2_core::BehaviorTreeNavigator< ActionT >::onPreempt().
|
inlinefinalvirtual |
Deactivation of the navigator's backend BT and actions.
Implements nav2_core::NavigatorBase.
Definition at line 250 of file behavior_tree_navigator.hpp.
References nav2_core::BehaviorTreeNavigator< ActionT >::deactivate().