Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature for reporting issues and logs related to robots #183

Merged
merged 10 commits into from
Mar 9, 2022

Conversation

mxgrey
Copy link
Contributor

@mxgrey mxgrey commented Mar 9, 2022

The robot state and robot log schemas are already defined to support reporting issues and log events, but that has gone unused until now because we were not exposing a way for system integrators to provide that information.

This PR introduces that API. System integrators can now log robot-specific events and report issues that the robot is experiencing. Each issue has a lifecycle which the system integrator maintains by holding onto an IssueTicket. The issue will remain in the robot state until the ticket is marked as resolved or the ticket gets dropped by the system integrator.

This PR depends on open-rmf/rmf_task#59

Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Copy link

@akash-roboticist akash-roboticist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test script worked fine.

[WARN] [1646814907.259822762] [TestReportingAdapter]: BroadcastClient unable to connect to [ws://localhost:7878]. Please make sure server is running.
[INFO] [1646814907.284840731] [TestReportingAdapter]: Added a robot named [R0] with participant ID [0]
spawn observer thread
Starting Websocket Server
Beginning websocket.serve

[RobotCommandHandle] Setting new path of 2 waypoints...
Waypoints: [0, 0]
[WARN] [1646814909.260059187] [TestReportingAdapter]: BroadcastClient unable to connect to [ws://localhost:7878]. Please make sure server is running.
[INFO] [1646814909.261691631] [TestReportingAdapter]: BroadcastClient successfully connected to uri: [ws://localhost:7878]
Noticed the first issue:
{'category': 'Something bad is happening', 'detail': {'This object': 'has details', 'about': ['the', 'bad', 'thing']}}
Noticed both issues:
{'category': 'Something even worse is happening', 'detail': {'This problem': 'is even worse', 'so': {'as': 'an error', 'we': 'labeled it'}}}
{'category': 'Something bad is happening', 'detail': {'This object': 'has details', 'about': ['the', 'bad', 'thing']}}
Noticed that an issue was resolved
Noticed that both issues are gone
Received all the logs
Noticed 7 logs:
{'seq': 0, 'text': 'Opened issue [Something bad is happening]: {"This object":"has details","about":["the","bad","thing"]}', 'tier': 'warning', 'unix_millis_time': 1646814911325}
{'seq': 1, 'text': 'Opened issue [Something even worse is happening]: {"This problem":"is even worse","so":{"as":"an error","we":"labeled it"}}', 'tier': 'error', 'unix_millis_time': 1646814911570}
{'seq': 2, 'text': 'Resolved issue [Something bad is happening]: {"This":"issue","is":["now","fixed"]}', 'tier': 'info', 'unix_millis_time': 1646814911820}
{'seq': 3, 'text': 'Dropped issue [Something even worse is happening]', 'tier': 'warning', 'unix_millis_time': 1646814912070}
{'seq': 4, 'text': 'I am logging some info', 'tier': 'info', 'unix_millis_time': 1646814912320}
{'seq': 5, 'text': 'I am logging a warning', 'tier': 'warning', 'unix_millis_time': 1646814912320}
{'seq': 6, 'text': 'I am logging an error', 'tier': 'error', 'unix_millis_time': 1646814912320}
Received exit signal```

Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Copy link

@akash-roboticist akash-roboticist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mxgrey mxgrey merged commit 2cee31f into main Mar 9, 2022
@mxgrey mxgrey deleted the feature/reporting branch March 9, 2022 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants