StopRecording Class
Stop the active Trainer recording session and register the saved episodes as a dataset. 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
| StopRecording (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) | |
|
Constructor. More... | |
| StopRecording (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< StopRecordingSrv > > client_interface) | |
|
Constructor that injects a service client interface, used to supply a mock in tests. More... | |
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< StopRecordingSrv::Request, std::string > | createRequest () override |
|
User-provided function to create the service request. More... | |
| tl::expected< bool, std::string > | processResponse (const StopRecordingSrv::Response &response) override |
| tl::expected< std::chrono::duration< double >, std::string > | getResponseTimeout () override |
|
Bound the wait so an unresponsive train server fails the Behavior instead of hanging forever. More... | |
| std::shared_future< tl::expected< bool, std::string > > & | getFuture () override |
|
Classes derived from AsyncBehaviorBase must implement getFuture() so it returns a shared_future member. More... | |
Private Member Attributes Index
| std::shared_future< tl::expected< bool, std::string > > | future_ |
Public Static Functions Index
| static BT::PortsList | providedPorts () |
| static BT::KeyValueVector | metadata () |
Description
Stop the active Trainer recording session and register the saved episodes as a dataset.
Calls the train server's /trainer/stop_recording service. Episodes already snapshotted (see SaveEpisode) are kept; the in-progress episode is NOT snapshotted. The stop is idempotent — the Behavior succeeds when no recording was active, so it is safe in cleanup branches of an Objective.
| Data Port Name | Port Type | Object Type | Description |
|---|---|---|---|
| service_name | input | std::string | Name of the Trainer stop_recording service. |
Definition at line 30 of file stop_recording.hpp.
Public Constructors
StopRecording()
| explicit |
Constructor.
- Parameters
-
name The name of the Behavior as it appears in the Behavior tree.
config The node configuration, including the port remappings.
shared_resources Shared resources such as the node handle and transform buffer.
Declaration at line 39 of file stop_recording.hpp, definition at line 30 of file stop_recording.cpp.
StopRecording()
| explicit |
Constructor that injects a service client interface, used to supply a mock in tests.
- Parameters
-
name The name of the Behavior as it appears in the Behavior tree.
config The node configuration, including the port remappings.
shared_resources Shared resources such as the node handle and transform buffer.
client_interface The service client interface to use instead of a real client.
Declaration at line 49 of file stop_recording.hpp, definition at line 36 of file stop_recording.cpp.
Private Member Functions
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 60 of file stop_recording.hpp, definition at line 64 of file stop_recording.cpp.
getFuture()
| inline virtual |
Classes derived from AsyncBehaviorBase must implement getFuture() so it returns a shared_future member.
Definition at line 68 of file stop_recording.hpp.
getResponseTimeout()
| virtual |
Bound the wait so an unresponsive train server fails the Behavior instead of hanging forever.
Declaration at line 65 of file stop_recording.hpp, definition at line 79 of file stop_recording.cpp.
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 58 of file stop_recording.hpp, definition at line 54 of file stop_recording.cpp.
processResponse()
|
Declaration at line 62 of file stop_recording.hpp, definition at line 70 of file stop_recording.cpp.
Private Member Attributes
future_
|
Definition at line 73 of file stop_recording.hpp.
Public Static Functions
metadata()
| static |
Declaration at line 55 of file stop_recording.hpp, definition at line 49 of file stop_recording.cpp.
providedPorts()
| static |
Declaration at line 53 of file stop_recording.hpp, definition at line 43 of file stop_recording.cpp.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.