Skip to main content

UpdatePlanningSceneService Class

Uses the service advertised by the PointCloudServiceOctomapUpdater plugin to apply a point cloud to the planning scene collision octomap and wait until the update has been applied. More...

Declaration

class moveit_pro::behaviors::UpdatePlanningSceneService { ... }

Included Headers

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

UpdatePlanningSceneService (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)

Construct a new Update Planning Scene object. More...

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

Alternate constructor which can use an existing ClientInterfaceBase to support testing with a mock service client interface. More...

Private Member Functions Index

tl::expected< std::string, std::string >getServiceName () override

Gets the name of the service from an input data port. More...

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

Compose a service request message by getting a point cloud from an input data port and wrapping it in a SendPointCloud2::Request message. More...

tl::expected< bool, std::string >processResponse (const SendPointCloud2::Response &response) override

Evaluate the service response message to determine if the service succeeded or failed. 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 > >future_

Classes derived from AsyncBehaviorBase must have this shared_future as a class member. More...

Public Static Functions Index

static BT::PortsListprovidedPorts ()

Returns list of ports for this behavior. More...

static BT::KeyValueVectormetadata ()

Description

Uses the service advertised by the PointCloudServiceOctomapUpdater plugin to apply a point cloud to the planning scene collision octomap and wait until the update has been applied.

Data Port NamePort TypeObject Type
point_cloudInputsensor_msgs::msg::PointCloud2
point_cloud_serviceInputstd::string

Definition at line 26 of file update_planning_scene_service.hpp.

Public Constructors

UpdatePlanningSceneService()

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

Construct a new Update Planning Scene object.

Parameters
name

See SharedResourcesNode

config

See SharedResourcesNode

shared_resources

See SharedResourcesNode

Declaration at line 35 of file update_planning_scene_service.hpp, definition at line 27 of file update_planning_scene_service.cpp.

UpdatePlanningSceneService()

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

Alternate constructor which can use an existing ClientInterfaceBase to support testing with a mock service client interface.

Parameters
name

See SharedResourcesNode

config

See SharedResourcesNode

shared_resources

See SharedResourcesNode

client_interface

unique_ptr to an instance of a class derived from ClientInterfaceBase. The Behavior will take ownership of the unique_ptr in this constructor.

Declaration at line 47 of file update_planning_scene_service.hpp, definition at line 33 of file update_planning_scene_service.cpp.

Private Member Functions

createRequest()

tl::expected< SendPointCloud2::Request, std::string > moveit_pro::behaviors::UpdatePlanningSceneService::createRequest ()
virtual

Compose a service request message by getting a point cloud from an input data port and wrapping it in a SendPointCloud2::Request message.

Returns

Returns the service request message if successful. If not successful, returns an error message.

Declaration at line 73 of file update_planning_scene_service.hpp, definition at line 70 of file update_planning_scene_service.cpp.

getFuture()

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

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

Definition at line 82 of file update_planning_scene_service.hpp.

getServiceName()

tl::expected< std::string, std::string > moveit_pro::behaviors::UpdatePlanningSceneService::getServiceName ()
virtual

Gets the name of the service from an input data port.

Returns

Returns the name if it could be retrieved from the port. If the name could not be retrieved, return an error message.

Declaration at line 66 of file update_planning_scene_service.hpp, definition at line 56 of file update_planning_scene_service.cpp.

processResponse()

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

Evaluate the service response message to determine if the service succeeded or failed.

Returns

If the service succeeded, returns true. If the service did not succeed, returns an error message.

Declaration at line 79 of file update_planning_scene_service.hpp, definition at line 81 of file update_planning_scene_service.cpp.

Private Member Attributes

future_

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

Classes derived from AsyncBehaviorBase must have this shared_future as a class member.

Definition at line 88 of file update_planning_scene_service.hpp.

Public Static Functions

metadata()

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

Declaration at line 58 of file update_planning_scene_service.hpp, definition at line 50 of file update_planning_scene_service.cpp.

providedPorts()

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

Returns list of ports for this behavior.

Inputs to this behavior are: the point cloud, and the name of the service used to update the planning scene.

Returns

BT::PortsList The list of I/O Ports

Declaration at line 56 of file update_planning_scene_service.hpp, definition at line 41 of file update_planning_scene_service.cpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.