-
Notifications
You must be signed in to change notification settings - Fork 1
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
How to detect device not sending anymore #5
Comments
Introducing a status topic is a good idea. However, I suggest limiting messages to changes of the status. If the topic is latched, any subscriber will get the latest status anyway. I suggest an enum with all relevant states. An is_alive service in the firmware is not required in my opinion. The driver sees that device is streaming (or not), doesn't it? |
Right, that make sense to have a latched status topic only. I hesitate to create a specific status message with enums, because that means any tool that wants to read it, then depends on the build of
the
yes the is_alive was supposed to be a user request, to make a specific query to the device through the driver. If the device is not streaming, the driver does not (yet) regularly ping to see if the device is still responding. With the introduction of a status topic, the driver will have to figure it out regularly, and in case not streaming, then ping the device itself to see if it is still alive. So no service required but an additional internal alive check. |
I believe the discussion on PR #6 show that a full rework of all the throwing system is required before being able to identify the correct state of the driver at top level. I won't be able to tackle this project. You can close this topic here. I will work on my fork with a minimalist solution not suitable for upstream |
Devices running a FW (teensy or PIC) using the SerialProtocol (SP) FW library can sometimes lock-up (*), and not send data anymore although they were streaming fine in the first place.
Such case is currently handled in SW
agni_serial_protocol
with a timeout and a message "sp: nothing to read" repeated as long as the driver is running.For higher-level systems, detecting the device is in a dead state, is not immediate (maybe detecting no data on the awaited topics), and only a driver restart would throw an exception and confirm the device is dead due to not initializing well anymore.
With this issue, I raise the question, should one have a "status" message for the state of the
sp_to_ros
node, instead of just printing to console. Maybe a diagnostic message would be even cleaner as this is used throughout ROS to monitor nodes and see if they are healthy. The other difference between a basic status and diagnostic message is also that a diagnostic message is sent regularly (to prove the node is alive I suppose).The higher level system could react to errors in the status or diagnostic messages without monitoring other topics (whose names could be as various as they are devices)
There are also no service available in
agni_serial_protocol
that directly requeries the device except changing the period of a logical sensor. Maybe ais_alive
service doing a ping awaiting the ping response of SP could be an alternative to restarting the driver to test the device.@rhaschke what do you think ?
(*) device that currently locks-up is the fingernail mock-up device if nail is pressed, and sending a period change request that goes to the device apparently is also not working (says wrong header) even when the device still streams. Probably a too old FW SP lib inside.
The text was updated successfully, but these errors were encountered: