Skip to main content

AddURDF Class

This Behavior sends a request to add a URDF object to the planning scene as a collision object. More...

Declaration

class moveit_pro::behaviors::AddURDF { ... }

Included Headers

#include <add_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

usingAddURDFSrv = moveit_studio_agent_msgs::srv::AddURDF

Public Constructors Index

AddURDF (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
AddURDF (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< AddURDFSrv > > 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< AddURDFSrv::Request, std::string >createRequest () override

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

tl::expected< bool, std::string >processResponse (const AddURDFSrv::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 autokDefaultPackageNamePort = "package_name"
static constexpr autokDefaultUrdfFilePathPort = "urdf_file_path"
static constexpr autokDefaultUrdfPosePort = "urdf_pose"
static constexpr autokColorNamePort = "urdf_color"

Description

This Behavior sends a request to add a URDF object to the planning scene as a collision object.

The object is added to the planning scene at the specified pose. The object is given as a URDF file, which describes the kinematics and collision geometry. If the URDF contains joints and those are reported in the /joint_states topic, the object collision shapes will update their state accordingly.

See also AttachURDF for attaching a URDF object to the robot.

Data Port NamePort TypeObject Type
urdf_nameinputstd::string
package_nameinputstd::string
urdf_file_pathinputstd::string
urdf_poseinputgeometry_msgs::msg::PoseStamped

Definition at line 32 of file add_urdf.hpp.

Public Member Typedefs

AddURDFSrv

using moveit_pro::behaviors::AddURDF::AddURDFSrv = moveit_studio_agent_msgs::srv::AddURDF

Definition at line 35 of file add_urdf.hpp.

Public Constructors

AddURDF()

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

Declaration at line 43 of file add_urdf.hpp, definition at line 51 of file add_urdf.cpp.

AddURDF()

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

Declaration at line 46 of file add_urdf.hpp, definition at line 57 of file add_urdf.cpp.

Private Member Functions

createRequest()

tl::expected< AddURDFSrv::Request, std::string > moveit_pro::behaviors::AddURDF::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 add_urdf.hpp, definition at line 99 of file add_urdf.cpp.

getFuture()

std::shared_future< tl::expected< bool, std::string > > & moveit_pro::behaviors::AddURDF::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 add_urdf.hpp.

getResponseTimeout()

tl::expected< std::chrono::duration< double >, std::string > moveit_pro::behaviors::AddURDF::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 add_urdf.hpp, definition at line 94 of file add_urdf.cpp.

getServiceName()

tl::expected< std::string, std::string > moveit_pro::behaviors::AddURDF::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 add_urdf.hpp, definition at line 89 of file add_urdf.cpp.

processResponse()

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

Declaration at line 61 of file add_urdf.hpp, definition at line 170 of file add_urdf.cpp.

Private Member Attributes

future_

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

Definition at line 69 of file add_urdf.hpp.

Public Static Functions

metadata()

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

Declaration at line 52 of file add_urdf.hpp, definition at line 84 of file add_urdf.cpp.

providedPorts()

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

Declaration at line 50 of file add_urdf.hpp, definition at line 64 of file add_urdf.cpp.

Public Static Attributes

kColorNamePort

constexpr auto moveit_pro::behaviors::AddURDF::kColorNamePort = "urdf_color"
constexpr static

Definition at line 41 of file add_urdf.hpp.

kDefaultPackageNamePort

constexpr auto moveit_pro::behaviors::AddURDF::kDefaultPackageNamePort = "package_name"
constexpr static

Definition at line 38 of file add_urdf.hpp.

kDefaultUrdfFilePathPort

constexpr auto moveit_pro::behaviors::AddURDF::kDefaultUrdfFilePathPort = "urdf_file_path"
constexpr static

Definition at line 39 of file add_urdf.hpp.

kDefaultUrdfNamePort

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

Definition at line 37 of file add_urdf.hpp.

kDefaultUrdfPosePort

constexpr auto moveit_pro::behaviors::AddURDF::kDefaultUrdfPosePort = "urdf_pose"
constexpr static

Definition at line 40 of file add_urdf.hpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.