RetrieveRobotStateParameter Class
Retrieves a joint state from the MoveIt Pro parameter manager node. More...
Declaration
Included Headers
Base class
| class | ServiceClientBehaviorBase<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
| RetrieveRobotStateParameter (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) | |
|
Constructor for RetrieveRobotStateParameter behavior. More... | |
| RetrieveRobotStateParameter (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< RetrieveRobotState > > client_interface) | |
|
Constructor for RetrieveRobotStateParameter behavior that allows for mocking of the service client. More... | |
Private Member Functions Index
| tl::expected< std::string, std::string > | getServiceName () override |
|
Get the name of the service. More... | |
| tl::expected< RetrieveRobotState::Request, std::string > | createRequest () override |
|
Create the service request message. More... | |
| tl::expected< bool, std::string > | processResponse (const RetrieveRobotState::Response &response) override |
|
Handles the service response message once the service finishes. 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... | |
| tl::expected< void, std::string > | doHalt () override |
|
Implementation of the doHalt method that calls clear_stored_parameters service when halted. More... | |
Private Member Attributes Index
| std::shared_future< tl::expected< bool, std::string > > | response_future_ |
|
Holds the result of calling the service asynchronously. More... | |
Public Static Functions Index
| static BT::PortsList | providedPorts () |
|
Required implementation of the static providedPorts function. More... | |
| static BT::KeyValueVector | metadata () |
Description
Retrieves a joint state from the MoveIt Pro parameter manager node.
If no parameter is retrieved within the provided "timeout_sec" parameter, this Behavior returns FAILURE. Specifying zero timeout (default) makes this Behavior wait indefinitely to retrieve the parameter.
| Data Port Name | Port Type | Object Type |
|---|---|---|
| timeout_sec | input | double |
| joint_state | output | moveit_msgs::msg::RobotState |
Definition at line 30 of file retrieve_robot_state_parameter.hpp.
Public Constructors
RetrieveRobotStateParameter()
| explicit |
Constructor for RetrieveRobotStateParameter behavior.
- Parameters
-
name config shared_resources
Declaration at line 39 of file retrieve_robot_state_parameter.hpp, definition at line 40 of file retrieve_robot_state_parameter.cpp.
RetrieveRobotStateParameter()
| explicit |
Constructor for RetrieveRobotStateParameter behavior that allows for mocking of the service client.
- Parameters
-
name config shared_resources client_interface Service client interface, allowing a mock to be injected in tests.
Declaration at line 49 of file retrieve_robot_state_parameter.hpp, definition at line 46 of file retrieve_robot_state_parameter.cpp.
Private Member Functions
createRequest()
| virtual |
Create the service request message.
- Returns
a RetrieveRobotState request message with the specified timeout.
Declaration at line 73 of file retrieve_robot_state_parameter.hpp, definition at line 73 of file retrieve_robot_state_parameter.cpp.
doHalt()
| virtual |
Implementation of the doHalt method that calls clear_stored_parameters service when halted.
Declaration at line 94 of file retrieve_robot_state_parameter.hpp, definition at line 102 of file retrieve_robot_state_parameter.cpp.
getFuture()
| inline virtual |
Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member.
Definition at line 83 of file retrieve_robot_state_parameter.hpp.
getServiceName()
| virtual |
Get the name of the service.
For this behavior the service name is always "/retrieve_joint_state".
- Returns
Returns the service name. Since the service name is set to a constant value, this always succeeds.
Declaration at line 67 of file retrieve_robot_state_parameter.hpp, definition at line 68 of file retrieve_robot_state_parameter.cpp.
processResponse()
|
Handles the service response message once the service finishes.
- Returns
Returns an error result if the service finished but did not succeed, since this is treated as an unexpected error state. Otherwise, returns true.
Declaration at line 80 of file retrieve_robot_state_parameter.hpp, definition at line 88 of file retrieve_robot_state_parameter.cpp.
Private Member Attributes
response_future_
|
Holds the result of calling the service asynchronously.
Definition at line 89 of file retrieve_robot_state_parameter.hpp.
Public Static Functions
metadata()
| static |
Declaration at line 59 of file retrieve_robot_state_parameter.hpp, definition at line 62 of file retrieve_robot_state_parameter.cpp.
providedPorts()
| static |
Required implementation of the static providedPorts function.
- Returns
The list of input and output ports used by this Behavior.
Declaration at line 57 of file retrieve_robot_state_parameter.hpp, definition at line 54 of file retrieve_robot_state_parameter.cpp.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.