uf-mil / ros_alarms

Alarm system implementation in ROS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PRETTY PRINT

DSsoto opened this issue · comments

We should be able to pretty-print an alarm object. (alarm, status, severity, node_name, problem, json params).

Text Effects maybe? cough, cough, @mattlangford

I didn't want to make it a dependency.
Alarms are stored as ros messages on the client side and so they should already have a print method for the python listener. Have you tried printing them there?

The only time you wouldn't get the ability to directly print the alarm is inside of a handler callback, since those get triggered from the servers alarm object, which isn't directly pulled from the message. That could have a __repr__ function defined.

I mean, it's another opensource tool that we'd be offering, but I get where you're coming from. I thought that instead of the alarm server saying Updating alarm: test_alarm, cleared, it could add the severity, node name and params in a pretty printed way.

Yeah, I can print them with a str() method on the AlarmProxy cpp class, but your printing stuff looks a lot nicer.

In a normal use case, I didn't think those debug type messages would be seen by the end user. I think it would be nice regardless and will add it