RecordEpisode Class
Start a Trainer recording session for demonstration collection via the train server 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
| RecordEpisode (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) | |
|
Constructor. More... | |
| RecordEpisode (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< StartRecordingSrv > > 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< StartRecordingSrv::Request, std::string > | createRequest () override |
|
User-provided function to create the service request. More... | |
| tl::expected< bool, std::string > | processResponse (const StartRecordingSrv::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
Start a Trainer recording session for demonstration collection via the train server node.
Calls the train server's /trainer/start_recording service — the same session the training panel drives, so a Behavior-started recording shows up live in the UI. Ports set here always win; the named training config only fills in what the ports leave unset. A non-empty camera_topics selects the captured streams even when config_name is set; an empty camera_topics falls back to the config's cameras, then the cameras discovered on the live graph, then the recording defaults. Joint topics and fps resolve from the named config when not otherwise specified. Pair with SaveEpisode to snapshot each episode and StopRecording to end the session and register the dataset.
| Data Port Name | Port Type | Object Type | Description |
|---|---|---|---|
| service_name | input | std::string | Name of the Trainer start_recording service. |
| dataset_name | input | std::string | Recording name; also the ConvertDataset key. |
| task | input | std::string | Task stored with each episode; its conversion label. |
| config_name | input | std::string | Optional named training config; empty = defaults. |
| camera_topics | input | std::vector<std::string> | Camera topics; empty = the config's cameras. |
| num_episodes | input | int | Episodes to collect in this session. |
| recording_id | output | std::string | Id of the started recording session. |
Definition at line 40 of file record_episode.hpp.
Public Constructors
RecordEpisode()
| 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 49 of file record_episode.hpp, definition at line 38 of file record_episode.cpp.
RecordEpisode()
| 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 59 of file record_episode.hpp, definition at line 44 of file record_episode.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 70 of file record_episode.hpp, definition at line 87 of file record_episode.cpp.
getFuture()
| inline virtual |
Classes derived from AsyncBehaviorBase must implement getFuture() so it returns a shared_future member.
Definition at line 78 of file record_episode.hpp.
getResponseTimeout()
| virtual |
Bound the wait so an unresponsive train server fails the Behavior instead of hanging forever.
Declaration at line 75 of file record_episode.hpp, definition at line 147 of file record_episode.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 68 of file record_episode.hpp, definition at line 77 of file record_episode.cpp.
processResponse()
|
Declaration at line 72 of file record_episode.hpp, definition at line 137 of file record_episode.cpp.
Private Member Attributes
future_
|
Definition at line 83 of file record_episode.hpp.
Public Static Functions
metadata()
| static |
Declaration at line 65 of file record_episode.hpp, definition at line 72 of file record_episode.cpp.
providedPorts()
| static |
Declaration at line 63 of file record_episode.hpp, definition at line 51 of file record_episode.cpp.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.