Interfaces
The rosetta_interfaces package holds every Rosetta ROS 2 interface: three
actions, three services and six messages. The nodes also use
std_srvs/srv/Trigger, std_srvs/srv/SetBool and std_msgs/msg/Int8. Which
node serves what is on Nodes. The ManageEpisode family belongs to
the human-in-the-loop manager in
rosetta_ros_hil,
whose README describes its behavior.
ros2 interface show rosetta_interfaces/action/RecordEpisode
Ending work
Every action result reports how the work ended in termination_reason. The
legal values are string constants in each .action file. The goal’s terminal
state is the coarse view: SUCCEEDED when the work reached a defined end,
CANCELED when a client cancelled it, ABORTED when the server stopped it.
ManageEpisode also reports whether the robot did the task, in outcome,
independently of termination_reason.
A start service mirrors its action’s goal and returns as soon as the work is
accepted. Work started this way has no goal, so it has no action feedback or
result. Each server therefore publishes the feedback fields on ~/status
while work runs and the result fields on ~/result when it ends, whatever
started the work. ~/result is transient-local, so a subscriber that joins
later still gets the last one. Stop service-started work with the matching
cancel service, or let default_max_duration_s end it.
Actions
Each action has a goal, a result and feedback. Defaults named in the goal tables are parameters of the serving node.
RecordEpisode
Server: episode_recorder_node, as /record_episode by default.
Goal |
Type |
Meaning |
|---|---|---|
|
string |
Task label stored in the bag. Empty uses the node’s |
|
float64 |
Seconds. Zero or less uses the node’s |
Result |
Type |
Meaning |
|---|---|---|
|
string |
|
|
string |
Detail when something went wrong, then |
|
string |
Bag directory. Set on every path, including errors. |
|
int32 |
Messages written to the bag. |
Feedback |
Type |
Meaning |
|---|---|---|
|
float64 |
Seconds since the recording started. |
|
int32 |
Messages written so far. |
RunPolicy
Server: policy_runner_node, as /run_policy by default.
Goal |
Type |
Meaning |
|---|---|---|
|
string |
Task passed to the policy. Empty uses the node’s |
|
float64 |
Seconds. Zero or less uses the node’s |
Result |
Type |
Meaning |
|---|---|---|
|
string |
|
|
string |
Detail when something went wrong. Empty otherwise. |
Feedback |
Type |
Meaning |
|---|---|---|
|
uint32 |
Actions published so far in this run. |
|
uint32 |
Actions waiting in the adapter’s queue. |
ManageEpisode
Server: hil_manager_node, as /manage_episode by default.
Goal |
Type |
Meaning |
|---|---|---|
|
string |
Task for the episode. Empty uses the manager’s |
|
float64 |
Seconds. Zero or less uses the manager’s |
|
float64 |
End the episode when the reward reaches this value. Zero or less disables it. |
Result |
Type |
Meaning |
|---|---|---|
|
string |
|
|
string |
|
|
string |
Detail when something went wrong. The recording’s own |
|
string |
Bag directory of the episode’s recording. Empty when the manager does not record. |
|
float64 |
Last reward value at episode end. |
|
int32 |
Messages written to the bag. |
Feedback |
Type |
Meaning |
|---|---|---|
|
float64 |
Seconds since the episode started. |
|
float64 |
Latest reward value. |
|
string |
|
|
string |
Verdict so far, one of the result’s |
|
int32 |
Messages written so far. |
unlabeled means nobody claimed success or failure. It is a different answer
from a reward of 0.0.
Services
Service |
Request |
Response |
|---|---|---|
|
|
|
|
|
|
|
|
|
The request fields mean the same as the matching goal fields.
StartRecording and StartPolicy have no duration field, so work they start
always uses the node’s default_max_duration_s. accepted: false comes with
the reason in message, such as Rejected: already busy.
Messages
Message |
Fields |
Published on |
|---|---|---|
|
|
recorder |
|
|
recorder |
|
|
runner |
|
|
runner |
|
|
manager |
|
|
manager |
Each message has the same field names, types and order as the action part it mirrors.