Skip to main content

PlanCartesianPath Class

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

Declaration

class moveit_pro::behaviors::PlanCartesianPath { ... }

Included Headers

#include <plan_cartesian_path.hpp>

Base class

classServiceClientBehaviorBase<ServiceT>

A base class for behaviors which need to send a request to a ROS service client and wait for a result. More...

Public Constructors Index

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

Constructor for PlanCartesianPath behavior. More...

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. More...

Private Member Functions Index

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

User-provided function to get the name of the service when initializing the service client. More...

tl::expected< GetPlanningScene::Request, std::string >createRequest () override

Creates a service request message. More...

tl::expected< bool, std::string >processResponse (const GetPlanningScene::Response &response) override

Given the planning scene, extract the robot's current joint state and then plan a cartesian path. 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_

Holds the result of calling the service asynchronously. More...

Public Static Functions Index

static BT::PortsListprovidedPorts ()
static BT::KeyValueVectormetadata ()

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 NamePort TypeObject Type
pathInputstd::vector<geometry_msgs::msg::PoseStamped>
planning_group_nameInputstd::string
tip_linksInputstd::vector<std::string>
tip_offsetInputstd::vector<double>
position_onlyInputbool (deprecated)
cartesian_constraintInputmoveit_studio_msgs::msg::CartesianConstraint
blending_radiusInputdouble
ik_cartesian_space_densityInputdouble
ik_joint_space_densityInputdouble
max_optimizer_iterationsInputint
velocity_scale_factorInputdouble (deprecated)
acceleration_scale_factorInputdouble (deprecated)
trajectory_sampling_rateInputunsigned int (deprecated)
trajectory_timingInputmoveit_studio_msgs::msg::TrajectoryTiming
joint_trajectory_msgOutputtrajectory_msgs::msg::JointTrajectory
debug_solutionOutputmoveit_task_constructor_msgs::msg::Solution

Definition at line 82 of file plan_cartesian_path.hpp.

Public Constructors

PlanCartesianPath()

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

Constructor for PlanCartesianPath behavior.

Declaration at line 88 of file plan_cartesian_path.hpp, definition at line 197 of file plan_cartesian_path.cpp.

PlanCartesianPath()

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.

Declaration at line 94 of file plan_cartesian_path.hpp, definition at line 204 of file plan_cartesian_path.cpp.

Private Member Functions

createRequest()

tl::expected< GetPlanningScene::Request, std::string > moveit_pro::behaviors::PlanCartesianPath::createRequest ()
virtual

Creates a service request message.

Returns

Returns an instance of GetPlanningScene::Request.

Declaration at line 109 of file plan_cartesian_path.hpp, definition at line 268 of file plan_cartesian_path.cpp.

getFuture()

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

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

Definition at line 118 of file plan_cartesian_path.hpp.

getServiceName()

tl::expected< std::string, std::string > moveit_pro::behaviors::PlanCartesianPath::getServiceName ()
virtual

User-provided function to get the name of the service when initializing the service client.

Returns

Returns the name of the service. If not successful, returns an error message. Note that the criteria for success or failure is defined by the user's implementation of this function.

Declaration at line 103 of file plan_cartesian_path.hpp, definition at line 263 of file plan_cartesian_path.cpp.

processResponse()

tl::expected< bool, std::string > moveit_pro::behaviors::PlanCartesianPath::processResponse (const GetPlanningScene::Response & response)

Given the planning scene, extract the robot's current joint state and then plan a cartesian path.

Parameters
response

The response from a service call that contains the planning scene msg.

Declaration at line 115 of file plan_cartesian_path.hpp, definition at line 275 of file plan_cartesian_path.cpp.

Private Member Attributes

future_

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

Holds the result of calling the service asynchronously.

Definition at line 126 of file plan_cartesian_path.hpp.

Public Static Functions

metadata()

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

Declaration at line 100 of file plan_cartesian_path.hpp, definition at line 257 of file plan_cartesian_path.cpp.

providedPorts()

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

Declaration at line 98 of file plan_cartesian_path.hpp, definition at line 211 of file plan_cartesian_path.cpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.