EditWaypoint Class
Use the /edit_waypoints service to save the robot's current state as a new named waypoint or erase an existing waypoint. The name of the waypoint to save or delete is set through the "waypoint_name" behavior parameter. The operation to perform on the waypoint is set through the "waypoint_operation" behavior parameter, which must be set to either "save" or "erase". If set to "save", then the "joint_group_names" parameter must also be set to specify which joint groups to include in the saved waypoint. 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
| EditWaypoint (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::chrono::duration< double > timeout=std::chrono::seconds(3)) | |
| EditWaypoint (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< moveit_pro::behaviors::BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< EditWaypoints > > client_interface, std::chrono::duration< double > timeout=std::chrono::seconds(3)) | |
|
Constructor for EditWaypoint behavior that allows for mocking of the rclcpp service client. More... | |
Private Member Functions Index
| tl::expected< std::string, std::string > | getServiceName () override |
|
Get the name of the service. More... | |
| tl::expected< std::chrono::duration< double >, std::string > | getResponseTimeout () override |
|
Sets the timeout used when waiting for the service response. More... | |
| tl::expected< EditWaypoints::Request, std::string > | createRequest () override |
|
Create the service request message for the "/edit_waypoints" service. More... | |
| tl::expected< bool, std::string > | processResponse (const EditWaypoints::Response &response) override |
|
Handles the service response message once the service finishes. 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 > > | response_future_ |
|
Holds the result of calling the service asynchronously. More... | |
| std::chrono::duration< double > | response_timeout_ |
Public Static Functions Index
| static BT::PortsList | providedPorts () |
| static BT::KeyValueVector | metadata () |
Description
Use the /edit_waypoints service to save the robot's current state as a new named waypoint or erase an existing waypoint. The name of the waypoint to save or delete is set through the "waypoint_name" behavior parameter. The operation to perform on the waypoint is set through the "waypoint_operation" behavior parameter, which must be set to either "save" or "erase". If set to "save", then the "joint_group_names" parameter must also be set to specify which joint groups to include in the saved waypoint.
| Data Port Name | Port Type | Object Type |
|---|---|---|
| waypoint_name | input | std::string |
| waypoint_operation | input | std::string |
| joint_group_names | input | std::vector<std::string> |
Definition at line 36 of file edit_waypoint.hpp.
Public Constructors
EditWaypoint()
|
Declaration at line 39 of file edit_waypoint.hpp, definition at line 53 of file edit_waypoint.cpp.
EditWaypoint()
|
Constructor for EditWaypoint behavior that allows for mocking of the rclcpp service client.
Declaration at line 46 of file edit_waypoint.hpp, definition at line 59 of file edit_waypoint.cpp.
Private Member Functions
createRequest()
| virtual |
Create the service request message for the "/edit_waypoints" service.
This generates the request from this behavior's ports.
- Returns
EditWaypoints request.
Declaration at line 76 of file edit_waypoint.hpp, definition at line 88 of file edit_waypoint.cpp.
getFuture()
| inline virtual |
Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member.
Definition at line 86 of file edit_waypoint.hpp.
getResponseTimeout()
| inline virtual |
Sets the timeout used when waiting for the service response.
Definition at line 66 of file edit_waypoint.hpp.
getServiceName()
| virtual |
Get the name of the service.
For this behavior the service name is always "/edit_waypoints".
- Returns
Returns the service name. Since the service name is set to a constant value, this always succeeds.
Declaration at line 61 of file edit_waypoint.hpp, definition at line 83 of file edit_waypoint.cpp.
processResponse()
|
Handles the service response message once the service finishes.
- Returns
Returns an error result if the service finished but did not succeed, since this is treated as an unexpected error state. Otherwise, returns true.
Declaration at line 83 of file edit_waypoint.hpp, definition at line 125 of file edit_waypoint.cpp.
Private Member Attributes
response_future_
|
Holds the result of calling the service asynchronously.
Definition at line 92 of file edit_waypoint.hpp.
response_timeout_
|
Definition at line 93 of file edit_waypoint.hpp.
Public Static Functions
metadata()
| static |
Declaration at line 53 of file edit_waypoint.hpp, definition at line 78 of file edit_waypoint.cpp.
providedPorts()
| static |
Declaration at line 51 of file edit_waypoint.hpp, definition at line 68 of file edit_waypoint.cpp.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.