Add exists service
DSsoto opened this issue · comments
Alarm server should have an exists() service, so that only queries for alarms that exist will be valid.
At startup, a client node could check if the alarm exists, and only if it does, create an AlarmListener for it.
An alarm would exist only if it has been declared to the server, regardless of whether it is cleared or raised.
But an alarm could be raised or lowered at any time regardless if it initially exists. What use case were you thinking for this?
I'm thinking that maybe the alarm server should have a file with the names of all currently implemented alarms. This way if a client creates a Listener for an alarm that doesn't exist thinking that it can get some important, possibly safety critical signal, the alarm server can just tell it right away it doesn't exist.
This is independent of raising or clearing an alarm.
I added a /known_alarms
rosparam to the alarms.launch file that is queried by the listener and broadcaster before they communicate with the server. If the alarm name doesn't exist in the parameter, the user will be warned with logwarn
message as follows: 'test_alarm' is not in the list of known alarms (as defined in the /known_alarms rosparam)