We have multiple layers of components used for the dVRK:
IO
PID
Teleop
Console
For each of these layers, we also have a corresponding Qt widget and potentialy a ROS bridge. There is no real standard regarding error handling and other health messages between the components. De facto, we started to use:
Events with strings for errors and status updates (with convoluted names like RobotErrorMsg, ...)
Events for enabled/disabled (again, convoluted names)
No generic name for commands to put a component in safe mode
What I would propose:
Events with strings for errors, warnings and updates called ("Error", "Warning" and "Status"). In GUI, Status would show up in black, Warnings in dark red and Errors in bright red. For example the PID component could use:
Status("Enabled")"
Warning("Joint limit")
Error("Tracking error")
Event "Enabled" would have a boolean payload, "true" for active/enabled, false for anything else
Command "SafeMode()" would allow any safety supervisor to stop a component. E.g. if the tele-op component detects an error from MTM, it would put the PSM in safe mode.
Finally, all Error and Warning events should be sent only once unless the failure changes (e.g. if a second or different joint limit is reached, emit a new event). When the cause of the error is resolved, a Status event should be sent.
We have multiple layers of components used for the dVRK:
For each of these layers, we also have a corresponding Qt widget and potentialy a ROS bridge. There is no real standard regarding error handling and other health messages between the components. De facto, we started to use:
What I would propose:
Status("Enabled")"
Warning("Joint limit")
Error("Tracking error")
Finally, all Error and Warning events should be sent only once unless the failure changes (e.g. if a second or different joint limit is reached, emit a new event). When the cause of the error is resolved, a Status event should be sent.