Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add debug broadcast enable/disable option and debug broadcast port option to config file #309
base: main
Are you sure you want to change the base?
Add debug broadcast enable/disable option and debug broadcast port option to config file #309
Changes from 3 commits
8b3efa1
fe4c0a2
3ce4bb8
8da6be6
040215c
84bfd31
2bbc9e0
39e3c4e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
what would be the value (ie: string) for 'all available network ports'? Because the documentation states that's the default, but I can't set this to
'all available network ports'
I believe.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.
So there is not a dedicated string for 'all available ports'. I was planning on having that, but part of the weirdness with it having the same type as
userlan_monitor_port
(Ros_UserLan_Port_Setting
) is that even if they have different options with different behavior (e.g.userlan_monitor_port
has 'auto detection' anduserlan_debug_broadcast_port
has 'all available ports'), they are parsed the same. So I had the behavior match that ofuserlan_monitor_port
, which doesn't have a specific string for 'auto detection'. That being said, unlikeuserlan_monitor_port
, if the user types in an invalid string, it will default to 'all available ports' rather than 'disabled'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.
I don't like this behavior. I definitely think broadcasting should be enabled if there's an error in the configuration.
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.
I can change that. So
userlan_monitoring_enabled
should be set to disabled if there is an error in the config, but broadcasting should still be enabled? I only ask because they're in the same case for the config switch case.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.
I don't have an opinion on the behavior of
userlan_monitoring_enabled
in this caseThere 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.
UserLan monitoring is extra functionality: it makes detecting disconnections faster, but isn't absolutely necessary (other places will also detect disconnects, they'll just take longer).
There's no harm in disabling it if the configuration is incorrect. And, we really can't do anything if configuration is incorrect: monitoring only a single port (when two are present) would be incorrect (which one to monitor in that case?) and monitoring all of them would also be incorrect -- it would likely result in MotoROS2 detecting disconnects 'all the time'. So disabling is really the only thing we can do.
But debug broadcasts should indeed not be disabled in cases of incorrect configuration. Especially since we often use debug logs to diagnose misconfiguration.
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.
I changed the behavior and this documentation so that it broadcasts to all ports if the specific port isn't active.
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.
Did you have a particular reason changing the phrasing here?
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.
There are now 2 different UserLan ports that the user can specify (monitor and debug broadcast), so I added the word "monitor" to clarify which one this condition checked. But then that put it above 32 characters (the alarm message limit), so I chose to shorten "Invalid" to "Bad" to fit in the character limit. I think that "invalid" is a better word for that, but it's more important to be specific about which config setting needs to be changed.
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.
So should we instead separate parsing and error reporting for monitoring and debug log port?
Would lead to some mild code duplication, but would also make parsing clearer and avoids this situation.
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.
I don't believe that this specific message is affected by combined parsing/error reporting for the two port config options. My preference would be to keep the parsing as combined, but I would be fine with changing it.
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.
I understand why you opted to reuse the
Ros_UserLan_Port_Setting
type, but it does make the parsing code a little harder to read.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.
Yeah I tried doing it both ways, and this had much less duplicated code and was overall cleaner in my opinion. I don't especially like it either though.