Skip to main content

DetachOrRemoveURDF Class

Base class for behaviors that detach URDF objects from a robot or remove them from the planning scene. More...

Declaration​

class moveit_pro::behaviors::DetachOrRemoveURDF { ... }

Included Headers​

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

Derived Classes​

classDetachURDF

This Behavior detaches a URDF object from the robot. More...

classRemoveURDFFromScene

This Behavior removes a URDF object from the planning scene. More...

Public Member Typedefs Index​

usingDetachOrRemoveURDFSrv = moveit_studio_agent_msgs::srv::DetachOrRemoveURDF

Public Constructors Index​

DetachOrRemoveURDF (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
DetachOrRemoveURDF (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< DetachOrRemoveURDFSrv > > client_interface)

Public Member Functions Index​

voidsetServiceName (std::string service_name)

Set the service name this Behavior targets. Derived classes call this from their constructor. 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< std::chrono::duration< double >, std::string >getResponseTimeout () override

Optional user-provided function to set the timeout used when waiting for the service response. More...

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

User-provided function to create the service request. More...

tl::expected< bool, std::string >processResponse (const DetachOrRemoveURDFSrv::Response &response) override
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_
std::stringservice_name_

Public Static Functions Index​

static BT::PortsListprovidedPorts ()

Public Static Attributes Index​

static constexpr autokDefaultUrdfNamePort = "urdf_name"
static constexpr autokDetachURDFBehaviorName = "DetachURDF"
static constexpr autokRemoveURDFFromSceneBehaviorName = "RemoveURDFFromScene"
static constexpr autokDetachURDFServiceName = "detach_urdf"
static constexpr autokRemoveURDFFromSceneServiceName = "remove_urdf_from_scene"

Description​

Base class for behaviors that detach URDF objects from a robot or remove them from the planning scene.

This is a base class used by DetachURDF and RemoveURDFFromScene behaviors. Derived classes call setServiceName() in their constructors to select the appropriate service.

Data Port NamePort TypeObject Type
urdf_nameinputstd::string

Definition at line 25 of file detach_or_remove_urdf.hpp.

Public Member Typedefs​

DetachOrRemoveURDFSrv​

using moveit_pro::behaviors::DetachOrRemoveURDF::DetachOrRemoveURDFSrv = moveit_studio_agent_msgs::srv::DetachOrRemoveURDF

Definition at line 28 of file detach_or_remove_urdf.hpp.

Public Constructors​

DetachOrRemoveURDF()​

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

Declaration at line 38 of file detach_or_remove_urdf.hpp, definition at line 23 of file detach_or_remove_urdf.cpp.

DetachOrRemoveURDF()​

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

Declaration at line 41 of file detach_or_remove_urdf.hpp, definition at line 30 of file detach_or_remove_urdf.cpp.

Public Member Functions​

setServiceName()​

void moveit_pro::behaviors::DetachOrRemoveURDF::setServiceName (std::string service_name)
inline

Set the service name this Behavior targets. Derived classes call this from their constructor.

Definition at line 48 of file detach_or_remove_urdf.hpp.

Private Member Functions​

createRequest()​

tl::expected< DetachOrRemoveURDFSrv::Request, std::string > moveit_pro::behaviors::DetachOrRemoveURDF::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 58 of file detach_or_remove_urdf.hpp, definition at line 53 of file detach_or_remove_urdf.cpp.

getFuture()​

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

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

Definition at line 64 of file detach_or_remove_urdf.hpp.

getResponseTimeout()​

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

Optional user-provided function to set the timeout used when waiting for the service response.

If no user-defined implementation is provided, the default implementation returns a negative duration, which will cause the service client to wait for the response without timing out.

Returns

Returns the service response timeout duration. 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 56 of file detach_or_remove_urdf.hpp, definition at line 48 of file detach_or_remove_urdf.cpp.

getServiceName()​

tl::expected< std::string, std::string > moveit_pro::behaviors::DetachOrRemoveURDF::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 54 of file detach_or_remove_urdf.hpp, definition at line 43 of file detach_or_remove_urdf.cpp.

processResponse()​

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

Declaration at line 60 of file detach_or_remove_urdf.hpp, definition at line 65 of file detach_or_remove_urdf.cpp.

Private Member Attributes​

future_​

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

Definition at line 68 of file detach_or_remove_urdf.hpp.

service_name_​

std::string moveit_pro::behaviors::DetachOrRemoveURDF::service_name_

Definition at line 69 of file detach_or_remove_urdf.hpp.

Public Static Functions​

providedPorts()​

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

Declaration at line 45 of file detach_or_remove_urdf.hpp, definition at line 38 of file detach_or_remove_urdf.cpp.

Public Static Attributes​

kDefaultUrdfNamePort​

constexpr auto moveit_pro::behaviors::DetachOrRemoveURDF::kDefaultUrdfNamePort = "urdf_name"
constexpr static

Definition at line 30 of file detach_or_remove_urdf.hpp.

kDetachURDFBehaviorName​

constexpr auto moveit_pro::behaviors::DetachOrRemoveURDF::kDetachURDFBehaviorName = "DetachURDF"
constexpr static

Definition at line 32 of file detach_or_remove_urdf.hpp.

kDetachURDFServiceName​

constexpr auto moveit_pro::behaviors::DetachOrRemoveURDF::kDetachURDFServiceName = "detach_urdf"
constexpr static

Definition at line 35 of file detach_or_remove_urdf.hpp.

kRemoveURDFFromSceneBehaviorName​

constexpr auto moveit_pro::behaviors::DetachOrRemoveURDF::kRemoveURDFFromSceneBehaviorName = "RemoveURDFFromScene"
constexpr static

Definition at line 33 of file detach_or_remove_urdf.hpp.

kRemoveURDFFromSceneServiceName​

constexpr auto moveit_pro::behaviors::DetachOrRemoveURDF::kRemoveURDFFromSceneServiceName = "remove_urdf_from_scene"
constexpr static

Definition at line 36 of file detach_or_remove_urdf.hpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.