LORD-MicroStrain / ntrip_client

ROS NTRIP client
https://github.com/LORD-MicroStrain/ntrip_client
Other
62 stars 54 forks source link

Feature request: publish the current connection state #52

Open gennartan opened 3 months ago

gennartan commented 3 months ago

I would be nice to have a topic to publish the current connection state. This is useful when you want to check the node status in a single command. This is also useful if you want to automatize ntrip control. In case of connection error, the state could be retrived easily by other nodes.

My initial idea was to publish the node state on the diagnostics topic. It is nice when a human wants to check the node status, but lacks of reliability when another node subscribe and use this information.

So I think that the best idea would be to create a new pacakge ntrip_msgs that would contain the definition of the connection status. The ntrip client would then publish this message at regular interval.

Here is a suggestion for the message type:

uint8 STATUS_INITIALIZING = 0
uint8 STATUS_CONNECTED = 1
uint8 STATUS_SERVER_NOT_FOUND = 2
uint8 STATUS_BAD_MOUNTPOINT = 3
uint8 STATUS_BAD_CREDENTIALS = 4

uint8 status
string server
string mountpoint
string message

What do you think about it ?