-
Notifications
You must be signed in to change notification settings - Fork 54
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
Length of sentence check fix #13
Conversation
Increased _NMEA_MIN_LENGTH, as it is pointless to send to NTRIP server a string without position info like this: $GNGGA,160653.60,,,,,0,00,99.99,,,,,,*79 Also made sure that maximum and minimum sentence check is performed excluding \r or \n
fix for TypeError: 'NoneType' object is not iterable in def publish_rtcm(self, event)
Not the best but tested working. It now reconnects in case of network loss and in case of no NMEA sent to server for long and hence 0 bytes from server will also attempt reconnection. Avoids too fast reconnections and also checks if the corrections keeps coming, otherwise also attempt a reconnection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for contributing these changes! I will test them out ASAP, and get back with some more comments. In the meantime, there are a couple of changes to code style and other things I would like to see changed before this is merged
Co-authored-by: Rob <87914992+robbiefish@users.noreply.github.com>
Co-authored-by: Rob <87914992+robbiefish@users.noreply.github.com>
Most of the changes have been made as requested. Some of those I am not really sure how to address them (for example the max nmea length...) Maybe adding a parameter... But this would probably generate more confusion than is worth. |
Hi, I should have the variables names cleaned now. |
Apologies that I have left this open for so long. I finally got the chance to test things out, and the NMEA sentence length change appears to work as expected. However, the reconnect logic does not appear to be working properly. When using a network (virtual) mountpoint, the driver will keep attempting to reconnect until the user sends a NMEA sentence I think that the right thing to do here is to either update this PR to do just what the title suggests (adjustable NMEA length) or make a new PR with just the NMEA sentence length changes that way we can get it merged in without being held up on the reconnect issues. I also think that the message package switching is implemented properly but should also probably be split into it's own PR. If you don't have the time, I am happy to make the PRs for you, just want to give you the chance to get the Github credit :) Also, I took a look at the connection logic, and adapted your code to a different branch. If possible, please let me know if this reconnect logic also solves the reconnect problem for you: ROS, ROS2 |
IIRC it tries to reconnect every time a nmea message to be sent to the ntrip arrives on his topic. Id does not happens to me because I throttle the nmea topic like this:
To recap: is the frequency of a valid nmea message that set the reconnection timing.
It is not much code around that, would you mind just copy the part that you need?
That part of the code that deals with this is taken from here and you could create a pr from it.
Ok, I will give it a try. |
Closing in favor of the following PRs:
|
Increased _NMEA_MIN_LENGTH, as it is pointless to send to NTRIP server a string without position info like this: $GNGGA,160653.60,,,,,0,00,99.99,,,,,,*79
Also made sure that maximum and minimum sentence check is performed excluding \r or \n