Skip to main content

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

class moveit_pro::behaviors::EditWaypoint { ... }

Included Headers

#include <edit_waypoint.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

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::PortsListprovidedPorts ()
static BT::KeyValueVectormetadata ()

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 NamePort TypeObject Type
waypoint_nameinputstd::string
waypoint_operationinputstd::string
joint_group_namesinputstd::vector<std::string>

Definition at line 36 of file edit_waypoint.hpp.

Public Constructors

EditWaypoint()

moveit_pro::behaviors::EditWaypoint::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))

Declaration at line 39 of file edit_waypoint.hpp, definition at line 53 of file edit_waypoint.cpp.

EditWaypoint()

moveit_pro::behaviors::EditWaypoint::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.

Declaration at line 46 of file edit_waypoint.hpp, definition at line 59 of file edit_waypoint.cpp.

Private Member Functions

createRequest()

tl::expected< EditWaypoints::Request, std::string > moveit_pro::behaviors::EditWaypoint::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()

std::shared_future< tl::expected< bool, std::string > > & moveit_pro::behaviors::EditWaypoint::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()

tl::expected< std::chrono::duration< double >, std::string > moveit_pro::behaviors::EditWaypoint::getResponseTimeout ()
inline virtual

Sets the timeout used when waiting for the service response.

Definition at line 66 of file edit_waypoint.hpp.

getServiceName()

tl::expected< std::string, std::string > moveit_pro::behaviors::EditWaypoint::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()

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

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_

std::shared_future<tl::expected<bool, std::string> > moveit_pro::behaviors::EditWaypoint::response_future_

Holds the result of calling the service asynchronously.

Definition at line 92 of file edit_waypoint.hpp.

response_timeout_

std::chrono::duration<double> moveit_pro::behaviors::EditWaypoint::response_timeout_

Definition at line 93 of file edit_waypoint.hpp.

Public Static Functions

metadata()

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

Declaration at line 53 of file edit_waypoint.hpp, definition at line 78 of file edit_waypoint.cpp.

providedPorts()

BT::PortsList moveit_pro::behaviors::EditWaypoint::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.