Skip to main content

AttachURDF Class

This Behavior sends a request to attach a URDF object to a robot for motion planning purposes. More...

Declaration

class moveit_pro::behaviors::AttachURDF { ... }

Included Headers

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

Public Member Typedefs Index

usingAttachURDFSrv = moveit_studio_agent_msgs::srv::AttachURDF

Public Constructors Index

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

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< AttachURDFSrv::Request, std::string >createRequest () override

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

tl::expected< bool, std::string >processResponse (const AttachURDFSrv::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_

Public Static Functions Index

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

Public Static Attributes Index

static constexpr autokDefaultUrdfNamePort = "urdf_name"
static constexpr autokDefaultParentLinkNamePort = "parent_link_name"
static constexpr autokDefaultAllowedCollisionLinksPort = "allowed_collision_links"

Description

This Behavior sends a request to attach a URDF object to a robot for motion planning purposes.

The URDF object must first be added to the planning scene before it can be attached. It is attached to the robot at the specified link at the relative pose between the link and the URDF object collision object. Once attached, the URDF object will move with the link it is attached to. If the URDF object contains joints and those are reported in the /joint_states topic, the URDF object collision shapes will update their state accordingly. If the URDF object is allowed to collide with some other links (e.g. the link it is attached to), these links can be specified in the allowed_collision_links port.

See also DetachURDF for detaching a URDF object.

Data Port NamePort TypeObject Type
urdf_nameinputstd::string
parent_link_nameinputstd::string
allowed_collision_linksinputstd::vector<std::string>

Definition at line 34 of file attach_urdf.hpp.

Public Member Typedefs

AttachURDFSrv

using moveit_pro::behaviors::AttachURDF::AttachURDFSrv = moveit_studio_agent_msgs::srv::AttachURDF

Definition at line 37 of file attach_urdf.hpp.

Public Constructors

AttachURDF()

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

Declaration at line 43 of file attach_urdf.hpp, definition at line 40 of file attach_urdf.cpp.

AttachURDF()

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

Declaration at line 46 of file attach_urdf.hpp, definition at line 46 of file attach_urdf.cpp.

Private Member Functions

createRequest()

tl::expected< AttachURDFSrv::Request, std::string > moveit_pro::behaviors::AttachURDF::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 59 of file attach_urdf.hpp, definition at line 79 of file attach_urdf.cpp.

getFuture()

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

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

Definition at line 65 of file attach_urdf.hpp.

getResponseTimeout()

tl::expected< std::chrono::duration< double >, std::string > moveit_pro::behaviors::AttachURDF::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 57 of file attach_urdf.hpp, definition at line 74 of file attach_urdf.cpp.

getServiceName()

tl::expected< std::string, std::string > moveit_pro::behaviors::AttachURDF::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 55 of file attach_urdf.hpp, definition at line 69 of file attach_urdf.cpp.

processResponse()

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

Declaration at line 61 of file attach_urdf.hpp, definition at line 105 of file attach_urdf.cpp.

Private Member Attributes

future_

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

Definition at line 69 of file attach_urdf.hpp.

Public Static Functions

metadata()

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

Declaration at line 52 of file attach_urdf.hpp, definition at line 64 of file attach_urdf.cpp.

providedPorts()

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

Declaration at line 50 of file attach_urdf.hpp, definition at line 53 of file attach_urdf.cpp.

Public Static Attributes

kDefaultAllowedCollisionLinksPort

constexpr auto moveit_pro::behaviors::AttachURDF::kDefaultAllowedCollisionLinksPort = "allowed_collision_links"
constexpr static

Definition at line 41 of file attach_urdf.hpp.

kDefaultParentLinkNamePort

constexpr auto moveit_pro::behaviors::AttachURDF::kDefaultParentLinkNamePort = "parent_link_name"
constexpr static

Definition at line 40 of file attach_urdf.hpp.

kDefaultUrdfNamePort

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

Definition at line 39 of file attach_urdf.hpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.