-
Notifications
You must be signed in to change notification settings - Fork 21
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
Refactor printing of current configuration settings #84
Refactor printing of current configuration settings #84
Conversation
…ump of g_nodeConfigSettings
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.
One in-line comment.
Additionally, I would suggest to prefix all keys with the enclosing namespace name (ie: instead of tf
, print publisher_qos.tf
).
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.
This looks better now.
I can't test this, but if you could post a copy of the debug log lines this prints at startup just to show it's correct, we can merge.
I'd also recommend removing the trailing whitespace that was introduced.
src/ConfigFile.c
Outdated
Ros_Debug_BroadcastMsg("Config: publisher_qos.robot_status = %d", g_nodeConfigSettings.qos_robot_status); | ||
Ros_Debug_BroadcastMsg("Config: publisher_qos.joint_states = %d", g_nodeConfigSettings.qos_joint_states); | ||
Ros_Debug_BroadcastMsg("Config: publisher_qos.tf = %d", g_nodeConfigSettings.qos_tf); |
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.
minor, but these lines will now only print a nr (ie: the value of the enum
member). They used to print the name of the QoS profile.
It would be nice if we could add a mapping from the enum
integer to their string description again, as that would be much more human readable, but I won't block merging this PR for that (seeing as this was already accepted as part of #81.
@SejalBehere wrote:
I would perhaps suggest a simple Lines 11 to 33 in ab02d18
you'd have fewer values to check (there are only a couple of values in this enum), but the idea could be the same. I might suggest not using There could be something in either RCL or RCLC that already implements this (ie: |
Thank you @gavanderhoorn for the guidance. I'm working on this and will put up the modified code for review. |
I have updated ConfigFile.c to add a lookup table for mapping from integers to strings for I tested this on the controller and the output log displayed is as follows: Click to expand
|
This looks ok to me. I'll defer to @gavanderhoorn though since it was his initial request. (At least I think it was. My memory is fuzzy.) |
Closing in favour of #127. Thanks for all the initial work @SejalBehere 👍 |
For Fixes #33 this PR inserts the function Ros_ConfigFile_PrintActiveConfiguration() and is used to print the current configuration settings once the parsing of the configuration file is complete