A base class for behaviors which need to send a request to a ROS service client and wait for a result.
More...
|
| | ServiceClientBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) |
| | Constructs ServiceClientBehaviorBase using the RclcppClientInterface.
|
| |
| | ServiceClientBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< ServiceT > > client_interface) |
| | Constructs ServiceClientBehaviorBase using a user-provided implementation of ClientInterfaceBase.
|
| |
| | ~ServiceClientBehaviorBase () override=default |
| |
| virtual tl::expected< std::string, std::string > | getServiceName ()=0 |
| | User-provided function to get the name of the service when initializing the service client.
|
| |
| virtual tl::expected< std::chrono::duration< double >, std::string > | getResponseTimeout () |
| | Optional user-provided function to set the timeout used when waiting for the service response.
|
| |
| virtual tl::expected< std::chrono::duration< double >, std::string > | getWaitForServerAvailableTimeout () |
| | Optional user-provided function to set the timeout used when waiting for the service server to be available.
|
| |
| virtual tl::expected< typename ServiceT::Request, std::string > | createRequest ()=0 |
| | User-provided function to create the service request.
|
| |
| virtual tl::expected< bool, std::string > | processResponse (const typename ServiceT::Response &) |
| | Optional user-provided function to process the service response after the service has finished.
|
| |
| tl::expected< void, std::string > | doHalt () override |
| | Handles halting logic which is specific to the service client behavior implementation.
|
| |
| | AsyncBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) |
| |
| | ~AsyncBehaviorBase () override=default |
| |
| BT::NodeStatus | onStart () override |
| | Required implementation of BT::StatefulActionNode::onStart().
|
| |
| BT::NodeStatus | onRunning () override |
| | Required implementation of BT::StatefulActionNode::onRunning().
|
| |
| void | onHalted () override |
| | Required implementation of BT::StatefulActionNode::onHalted().
|
| |
| void | resetStatus () |
| | Resets the internal status of this node.
|
| |
| virtual std::shared_future< tl::expected< bool, std::string > > & | getFuture ()=0 |
| | Gets the shared future which is used to monitor the progress of the async process.
|
| |
| void | notifyCanHalt () |
| | Called when runAsync() finishes to notify onHalted() that the async process has finished.
|
| |
| | SharedResourcesNode (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &behavior_context) |
| | Constructor for SharedResourcesNode. Called by BT::BehaviorTreeFactory when creating a new behavior tree containing this node.
|
| |
| const std::shared_ptr< BehaviorContext > & | getBehaviorContext () const |
| |
template<
typename ServiceT>
class moveit_pro::behaviors::ServiceClientBehaviorBase< ServiceT >
A base class for behaviors which need to send a request to a ROS service client and wait for a result.
Important: If a halt is requested before the service request is sent to the service server, the behavior will wait to halt until the service response has been received or the timeout duration has elapsed.
- Template Parameters
-
| ServiceT | ROS service message type used to specialize this class for a specific service. |