ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

error reporting: ROS_ERROR or error topic

asked 2018-01-05 08:35:20 -0600

knxa gravatar image

updated 2018-01-12 05:14:13 -0600

What is best practice for reporting global errors throughout ROS?

One option is to report errors through ROS_ERROR only. A node could then subscribe to /rosout_agg to receive and parse the error messages. The advantage would be that I get the topic and macros for free, and the messages even contain the posting node etc. Disadvantage is that I need to discard a lot of messages with info level and debug level. And if I need things like an error code, I need to encode this in the log message text.

Another option is of course to create a dedicated topic for reporting errors and warnings. All nodes in the system then needs to publish to this topic.

Any advice appreciated, thanks.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2018-01-05 09:58:25 -0600

mgruhler gravatar image

I would actually use diagnostics for this. This is bascially an implementation of your second option with some additional sugar like analysis, aggregation and a viewer.

(All assuming "Reporting" means to send this to the user...)

edit flag offensive delete link more

Comments

1

Thanks, I have come across diagnostics before, but have honestly been a bit confused about best practice. For example REP 107 states that is intended for reporting hardware data and errors. I was looking for something that reports errors in general...

knxa gravatar image knxa  ( 2018-01-12 01:53:51 -0600 )edit

... which might include that some user input was wrong, some file could not be found, etc.

knxa gravatar image knxa  ( 2018-01-12 01:54:04 -0600 )edit

(As you state) it also seems Diagnostics is intended for user info. I was thinking that reported errors could also be used as input to an error handler. A global place that could be configured to take certain actions if certain errors occurs. But this seems like misuse of Diagnostics?

knxa gravatar image knxa  ( 2018-01-12 01:55:20 -0600 )edit

I agree about it being a misuse of diagnotics when using this for error handling in code. I understand that diagnostics has been intended for HW mainly, but I think it is helpful in a lot of other places as well (as Long as it is about getting info to the user) (some might consider that misues too).

mgruhler gravatar image mgruhler  ( 2018-01-12 02:32:02 -0600 )edit

IMO, error handling should happen in the single nodes. So wrong user Input should be detected at the Moment of Input. Not existing files once you try to read/load them. And then the error should be produced in that node.

Maybe I am missing your Goal/idea why you want to have that centralized...

mgruhler gravatar image mgruhler  ( 2018-01-12 02:35:29 -0600 )edit

I was imagining any error referring so a globally defined error code. A configuration could then specify various handlers for each error code. E.g. a node emits an error about low disk space or high temperature for X. An error handler node decides the appropriate action.

knxa gravatar image knxa  ( 2018-01-12 05:13:46 -0600 )edit
1

These would seem to be largely application level and specific concerns, so creating an application specific implementation with topics and application-defined error codes with specific semantics seems justified.

gvdhoorn gravatar image gvdhoorn  ( 2018-01-12 05:15:43 -0600 )edit
0

answered 2018-01-19 04:30:11 -0600

knxa gravatar image

The above discussion led me to some new considerations, please see related question high level system log.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-01-05 08:35:20 -0600

Seen: 2,877 times

Last updated: Jan 19 '18