MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_pro::behaviors::PlanCartesianPath Class Referencefinal

Given a Cartesian-space path, plan a joint-space trajectory to move the robot tip along the path. More...

#include <plan_cartesian_path.hpp>

Inheritance diagram for moveit_pro::behaviors::PlanCartesianPath:
Collaboration diagram for moveit_pro::behaviors::PlanCartesianPath:

Public Member Functions

 PlanCartesianPath (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 Constructor for PlanCartesianPath behavior.
 
 PlanCartesianPath (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< moveit_pro::behaviors::BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< GetPlanningScene > > client_interface)
 Constructor for PlanCartesianPath behavior that allows for mocking of the rclcpp service client.
 
- Public Member Functions inherited from moveit_pro::behaviors::ServiceClientBehaviorBase< GetPlanningScene >
 ServiceClientBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 Constructs ServiceClientBehaviorBase using the RclcppClientInterface.
 
 ServiceClientBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< GetPlanningScene > > client_interface)
 Constructs ServiceClientBehaviorBase using a user-provided implementation of ClientInterfaceBase.
 
 ~ServiceClientBehaviorBase () override=default
 
virtual tl::expected< std::chrono::duration< double >, std::string > getResponseTimeout ()
 Optional user-provided function to set the timeout used when waiting for the service response.
 
virtual tl::expected< std::chrono::duration< double >, std::string > getWaitForServerAvailableTimeout ()
 Optional user-provided function to set the timeout used when waiting for the service server to be available.
 
virtual tl::expected< bool, std::string > processResponse (const typename ServiceT::Response &)
 Optional user-provided function to process the service response after the service has finished.
 
tl::expected< void, std::string > doHalt () override
 Handles halting logic which is specific to the service client behavior implementation.
 
- Public Member Functions inherited from moveit_pro::behaviors::AsyncBehaviorBase
 AsyncBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 
 ~AsyncBehaviorBase () override=default
 
BT::NodeStatus onStart () override
 Required implementation of BT::StatefulActionNode::onStart().
 
BT::NodeStatus onRunning () override
 Required implementation of BT::StatefulActionNode::onRunning().
 
void onHalted () override
 Required implementation of BT::StatefulActionNode::onHalted().
 
void resetStatus ()
 Resets the internal status of this node.
 
void notifyCanHalt ()
 Called when runAsync() finishes to notify onHalted() that the async process has finished.
 
- Public Member Functions inherited from moveit_pro::behaviors::SharedResourcesNode< BT::StatefulActionNode >
 SharedResourcesNode (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &behavior_context)
 Constructor for SharedResourcesNode. Called by BT::BehaviorTreeFactory when creating a new behavior tree containing this node.
 
const std::shared_ptr< BehaviorContext > & getBehaviorContext () const
 

Static Public Member Functions

static BT::PortsList providedPorts ()
 
static BT::KeyValueVector metadata ()
 

Additional Inherited Members

- Static Public Attributes inherited from moveit_pro::behaviors::ServiceClientBehaviorBase< GetPlanningScene >
static constexpr std::chrono::seconds kTimeoutWaitForServiceServer
 

Detailed Description

Given a Cartesian-space path, plan a joint-space trajectory to move the robot tip along the path.

The path to follow is given by path, which can contain waypoints in different frames. The CreatePoseStamped, ResetVector, and PushBackVector Behaviors can be used to create the Cartesian path. The kinematics are solved for the given tip_links of the given planning group (planning_group_name), optionally offset by tip_offset.

The optional cartesian_constraint port selects whether the tip is constrained in position only or in both position and orientation while following the path. It is mutually exclusive with the deprecated position_only port: setting both is an error, and if neither is set the historical position_only default applies. Use blending_radius to control the amount of rounding at the path corners.

The output joint_trajectory_msg is a timed joint-space trajectory that can be checked for self and environment collisions with the ValidateTrajectory Behavior, and executed with ExecuteTrajectory.

The optional trajectory_timing port selects how the trajectory is timed: a time-optimal time parameterization, or a constant-speed Cartesian trapezoidal velocity profile that holds the tip's Cartesian speed constant between acceleration and deceleration ramps. With the time-optimal timing, the Behavior fills joint_trajectory_msg with the portion of the path that could be solved even on failure. The Cartesian trapezoidal timing supports a single tip link and likewise fills joint_trajectory_msg with the solvable portion of the path on failure, as long as that portion can be timed at the requested Cartesian speed. When trajectory_timing is not set, the deprecated velocity_scale_factor, acceleration_scale_factor, and trajectory_sampling_rate ports drive the time-optimal timing.

The Behavior succeeds if the entire path could be resolved, or fails otherwise. The debug_solution output port will contain an MTCSolution message that can be used with the WaitForMTCSolutionApproval Behavior for visualization.

In the case multiple tip_links are specified, the first waypoint of the path will be used as the reference frame for all the tips, i.e. the tips will move relative to the given reference path, based on their current relative pose to that first waypoint, with tip_offset applied.

Data Port Name Port Type Object Type
path Input std::vector<geometry_msgs::msg::PoseStamped>
planning_group_name Input std::string
tip_links Input std::vector<std::string>
tip_offset Input std::vector<double>
position_only Input bool (deprecated)
cartesian_constraint Input moveit_studio_msgs::msg::CartesianConstraint
blending_radius Input double
ik_cartesian_space_density Input double
ik_joint_space_density Input double
max_optimizer_iterations Input int
velocity_scale_factor Input double (deprecated)
acceleration_scale_factor Input double (deprecated)
trajectory_sampling_rate Input unsigned int (deprecated)
trajectory_timing Input moveit_studio_msgs::msg::TrajectoryTiming
joint_trajectory_msg Output trajectory_msgs::msg::JointTrajectory
debug_solution Output moveit_task_constructor_msgs::msg::Solution

Constructor & Destructor Documentation

◆ PlanCartesianPath() [1/2]

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

Constructor for PlanCartesianPath behavior.

◆ PlanCartesianPath() [2/2]

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

Constructor for PlanCartesianPath behavior that allows for mocking of the rclcpp service client.

Member Function Documentation

◆ metadata()

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

◆ providedPorts()

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

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