Skip to main content

NavigateThroughPosesAction Class

Calls an action server that uses nav2_msgs::action::NavigateThroughPoses and outputs feedback The ROS 2 Jazzy action result contains error_code and error_msg; this Behavior does not expose it. More...

Declaration​

class moveit_pro::behaviors::NavigateThroughPosesAction { ... }

Included Headers​

#include <navigate_through_poses_action.hpp>

Base class​

classActionClientBehaviorBase<ActionT>

A base class for behaviors which need to send a goal to a ROS action client and wait for a result. If the behavior is halted before the action result is received, the action goal will be canceled. More...

Public Constructors Index​

NavigateThroughPosesAction (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)

Constructor for NavigateThroughPosesAction behavior. More...

NavigateThroughPosesAction (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase > client_interface)

Overload for constructor which allows providing an alternate action client interface – useful for unit testing, but not a requirement. More...

Public Member Functions Index​

tl::expected< std::string, std::string >getActionName () override

Gets the name of the action to use when initializing the action client. More...

Private Member Functions Index​

tl::expected< NavigateThroughPoses::Goal, std::string >createGoal () override

Creates the action goal. More...

voidprocessFeedback (const std::shared_ptr< const NavigateThroughPoses::Feedback > feedback) override

Writes current_pose, navigation_time, estimated_time_remaining, number_of_recoveries, and distance_remaining to blackboard. More...

tl::expected< std::chrono::duration< double >, std::string >getResultTimeout () override

Gets the timeout from the blackboard. More...

tl::expected< void, std::string >checkWhileGoalActive () override

Fails if the robot pose Nav2 drives on is older than max_pose_age_sec. More...

std::shared_future< tl::expected< bool, std::string > > &getFuture () override

Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member. More...

Private Member Attributes Index​

std::shared_future< tl::expected< bool, std::string > >future_

Classes derived from AsyncBehaviorBase must have this shared_future as a class member. More...

RobotPoseAgeLimitrobot_pose_age_limit_

Read when the goal is created. More...

Public Static Functions Index​

static BT::PortsListprovidedPorts ()

Custom tree nodes that have input and/or output ports must define them in this static function. More...

static BT::KeyValueVectormetadata ()

Description​

Calls an action server that uses nav2_msgs::action::NavigateThroughPoses and outputs feedback The ROS 2 Jazzy action result contains error_code and error_msg; this Behavior does not expose it.

Data Port NamePort TypeObject Type
action_nameInputstd::string
behavior_tree_pathInputstd::string
posesInputstd::vector<geometry_msgs::msg::PoseStamped>
timeout_secInputdouble
max_pose_age_secInputdouble
current_poseOutputgeometry_msgs::msg::PoseStamped
navigation_timeOutputbuiltin_interfaces::msg::Duration
estimated_time_remainingOutputbuiltin_interfaces::msg::Duration
number_of_recoveriesOutputint16_t
distance_remainingOutputfloat
number_of_poses_remainingOutputint16

Definition at line 38 of file navigate_through_poses_action.hpp.

Public Constructors​

NavigateThroughPosesAction()​

moveit_pro::behaviors::NavigateThroughPosesAction::NavigateThroughPosesAction (const std::string & name, const BT::NodeConfiguration & config, const std::shared_ptr< BehaviorContext > & shared_resources)

Constructor for NavigateThroughPosesAction behavior.

Parameters
name

Name of the node. Must match the name used for this node in the behavior tree definition file (the .xml file).

config

Node configuration. Only used here because the BehaviorTree.CPP expects constructor signature with name and config first before custom constructor parameters.

shared_resources

Provides access to common resources such as the node handle and failure logger that are shared between all the behaviors that inherit from moveit_pro::behaviors::SharedResourcesNode.

Declaration at line 50 of file navigate_through_poses_action.hpp, definition at line 44 of file navigate_through_poses_action.cpp.

NavigateThroughPosesAction()​

moveit_pro::behaviors::NavigateThroughPosesAction::NavigateThroughPosesAction (const std::string & name, const BT::NodeConfiguration & config, const std::shared_ptr< BehaviorContext > & shared_resources, std::unique_ptr< ClientInterfaceBase > client_interface)

Overload for constructor which allows providing an alternate action client interface – useful for unit testing, but not a requirement.

Declaration at line 57 of file navigate_through_poses_action.hpp, definition at line 50 of file navigate_through_poses_action.cpp.

Public Member Functions​

getActionName()​

tl::expected< std::string, std::string > moveit_pro::behaviors::NavigateThroughPosesAction::getActionName ()
virtual

Gets the name of the action to use when initializing the action client.

Returns

The name of the action for the NavigateThroughPosesAction action client.

Declaration at line 74 of file navigate_through_poses_action.hpp, definition at line 101 of file navigate_through_poses_action.cpp.

Private Member Functions​

checkWhileGoalActive()​

tl::expected< void, std::string > moveit_pro::behaviors::NavigateThroughPosesAction::checkWhileGoalActive ()
virtual

Fails if the robot pose Nav2 drives on is older than max_pose_age_sec.

Declaration at line 98 of file navigate_through_poses_action.hpp, definition at line 176 of file navigate_through_poses_action.cpp.

createGoal()​

tl::expected< NavigateThroughPoses::Goal, std::string > moveit_pro::behaviors::NavigateThroughPosesAction::createGoal ()
virtual

Creates the action goal.

Returns

The action goal message if successful, or an error message otherwise.

Declaration at line 81 of file navigate_through_poses_action.hpp, definition at line 113 of file navigate_through_poses_action.cpp.

getFuture()​

std::shared_future< tl::expected< bool, std::string > > & moveit_pro::behaviors::NavigateThroughPosesAction::getFuture ()
inline virtual

Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member.

Definition at line 102 of file navigate_through_poses_action.hpp.

getResultTimeout()​

tl::expected< std::chrono::duration< double >, std::string > moveit_pro::behaviors::NavigateThroughPosesAction::getResultTimeout ()
virtual

Gets the timeout from the blackboard.

Returns

The timeout as a chrono duration if successful, or an error message otherwise.

Declaration at line 95 of file navigate_through_poses_action.hpp, definition at line 165 of file navigate_through_poses_action.cpp.

processFeedback()​

void moveit_pro::behaviors::NavigateThroughPosesAction::processFeedback (const std::shared_ptr< const NavigateThroughPoses::Feedback > feedback)

Writes current_pose, navigation_time, estimated_time_remaining, number_of_recoveries, and distance_remaining to blackboard.

Parameters
result

Action result message to process.

Returns

True if successful, or an error message otherwise.

Declaration at line 89 of file navigate_through_poses_action.hpp, definition at line 155 of file navigate_through_poses_action.cpp.

Private Member Attributes​

future_​

std::shared_future<tl::expected<bool, std::string> > moveit_pro::behaviors::NavigateThroughPosesAction::future_

Classes derived from AsyncBehaviorBase must have this shared_future as a class member.

Definition at line 108 of file navigate_through_poses_action.hpp.

robot_pose_age_limit_​

RobotPoseAgeLimit moveit_pro::behaviors::NavigateThroughPosesAction::robot_pose_age_limit_

Read when the goal is created.

Definition at line 111 of file navigate_through_poses_action.hpp.

Public Static Functions​

metadata()​

BT::KeyValueVector moveit_pro::behaviors::NavigateThroughPosesAction::metadata ()
static

Declaration at line 68 of file navigate_through_poses_action.hpp, definition at line 95 of file navigate_through_poses_action.cpp.

providedPorts()​

BT::PortsList moveit_pro::behaviors::NavigateThroughPosesAction::providedPorts ()
static

Custom tree nodes that have input and/or output ports must define them in this static function.

This function must be static. It is a requirement set by the BehaviorTree.CPP library.

Returns

List of ports with the names and port info. The return value is for the internal use of the behavior tree.

Declaration at line 66 of file navigate_through_poses_action.hpp, definition at line 57 of file navigate_through_poses_action.cpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.