PlanToJointGoal Class
Given a joint-space goal, plan a joint-space trajectory to reach the goal. More...
Declaration
Included Headers
Base class
| class | ServiceClientBehaviorBase<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
| PlanToJointGoal (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) | |
|
Constructor for PlanToJointGoal behavior. More... | |
| PlanToJointGoal (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 PlanToJointGoal behavior that allows for mocking of the rclcpp service client. More... | |
Public Destructor Index
| ~PlanToJointGoal () override | |
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 |
|
User-provided function to create the service request. More... | |
| tl::expected< bool, std::string > | processResponse (const GetPlanningScene::Response &response) override |
| std::shared_future< tl::expected< bool, std::string > > & | getFuture () override |
|
Gets the shared future which is used to monitor the progress of the async process. More... | |
Private Member Attributes Index
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | contacts_publisher_ |
| std::set< std::string > | contact_namespaces_ |
|
Where the previous attempt drew contact spheres, so this one can retract them. More... | |
| std::unique_ptr< scenario_logging::ScenarioWriter > | scenario_writer_ |
| std::shared_future< tl::expected< bool, std::string > > | future_ |
| bool | warned_scenario_tolerance_collapse_ = false |
Public Static Functions Index
| static BT::PortsList | providedPorts () |
| static BT::KeyValueVector | metadata () |
Description
Given a joint-space goal, plan a joint-space trajectory to reach the goal.
| Data Port Name | Port Type | Object Type |
|---|---|---|
| joint_goal | Input | moveit_msgs::msg::RobotState |
| planning_group_name | Input | std::string |
| velocity_scale_factor | Input | double |
| acceleration_scale_factor | Input | double |
| max_iterations | Input | unsigned int |
| trajectory_sampling_rate | Input | unsigned int |
| link_padding | Input | double |
| seed | Input | int |
| orientation_constraint | Input | moveit_studio_msgs::msg::OrientationConstraint |
| joint_range_constraint | Input | moveit_studio_msgs::msg::JointRangeConstraint |
| optimization_params | Input | moveit_studio_msgs::msg::ProRRTOptimizationParams |
| joint_costs | Input | std::vector<double> |
| capture_scenario | Input | bool |
| joint_trajectory_msg | Output | trajectory_msgs::msg::JointTrajectory |
Definition at line 53 of file plan_to_joint_goal.hpp.
Public Constructors
PlanToJointGoal()
|
Constructor for PlanToJointGoal behavior.
Declaration at line 59 of file plan_to_joint_goal.hpp, definition at line 258 of file plan_to_joint_goal.cpp.
PlanToJointGoal()
|
Constructor for PlanToJointGoal behavior that allows for mocking of the rclcpp service client.
Declaration at line 65 of file plan_to_joint_goal.hpp, definition at line 265 of file plan_to_joint_goal.cpp.
Public Destructor
~PlanToJointGoal()
|
Definition at line 72 of file plan_to_joint_goal.hpp.
Private Member Functions
createRequest()
| virtual |
User-provided function to create the service request.
- Returns
Returns a service request message. 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 83 of file plan_to_joint_goal.hpp, definition at line 341 of file plan_to_joint_goal.cpp.
getFuture()
| inline virtual |
Gets the shared future which is used to monitor the progress of the async process.
Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member.
This exists to prevent destruction of the derived class while the async process is still in-progress. If the derived class is destroyed, the definitions of the functions used within doWork() will be destroyed too, which will result in the virtual functions in the base class being called instead and cause a fault.
This function will force derived classes to add an instance of this type and return a reference to it. The base class can then use this virtual function to access the shared future in functions like onStart.
By adding this virtual function we're properly demonstrating how this future depends on things from the derived class and the natural flow of object lifetimes will do the hard work for us. The std::shared_future destructor will get the value of the future before the derived class is destructed assuming it's the last reference to the shared state. Doing it this way means neither the base nor derived class should need to implement a destructor which is a nice property to have.
- Returns
Returns the shared_future, which should be owned by the child class.
Definition at line 90 of file plan_to_joint_goal.hpp.
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 80 of file plan_to_joint_goal.hpp, definition at line 336 of file plan_to_joint_goal.cpp.
processResponse()
|
Declaration at line 87 of file plan_to_joint_goal.hpp, definition at line 346 of file plan_to_joint_goal.cpp.
Private Member Attributes
contact_namespaces_
|
Where the previous attempt drew contact spheres, so this one can retract them.
Definition at line 102 of file plan_to_joint_goal.hpp.
contacts_publisher_
|
Definition at line 99 of file plan_to_joint_goal.hpp.
future_
|
Definition at line 109 of file plan_to_joint_goal.hpp.
scenario_writer_
|
Definition at line 107 of file plan_to_joint_goal.hpp.
warned_scenario_tolerance_collapse_
|
Definition at line 114 of file plan_to_joint_goal.hpp.
Public Static Functions
metadata()
| static |
Declaration at line 76 of file plan_to_joint_goal.hpp, definition at line 331 of file plan_to_joint_goal.cpp.
providedPorts()
| static |
Declaration at line 74 of file plan_to_joint_goal.hpp, definition at line 276 of file plan_to_joint_goal.cpp.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.