-
Notifications
You must be signed in to change notification settings - Fork 913
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
rostopic: Make all numeric fields fixed width for easier reading #400
Comments
This would be a great feature. It would probably be best to add a command line option to apply this kind of fixed width output. Please consider providing a PR to add this functionality. Since it is not likely that the maintainers will have time to work on this feature request I will mark the ticket with the milestone "untargeted". |
I'll take this on, sure. |
Any preference as to functionality? Should this apply only to floating point numbers, or to integers and Boolean values as well? |
On the one hand you could print all values of the array fixed length (based on their type). For types where the potential value range is huge compared to the actually used one that might waste a lot of space (e.g. int64). Calculating the necessary max width based on all the values would result in less space but would also jump when the range of the values changes (e.g. from 99 to 100). On the other hand you could print the array entries in separate line to avoid the dynamic length problem. But then the number of lines per message might be a lot for big arrays. Depending on the use case either or might make more sense... |
My original plan was to add a fixed width flag that would simply apply to all numerical values in the message, regardless of whether or not they're part of an array. However, you then start to get ugly output like header sequence numbers with nine spaces before them. For now, I'll make it only for arrays of ints and floats, and will hold off on the line breaks (though I agree that could also work). Thanks for the input! |
This should be addressed with the recently merged PRs in genpy and ros_comm referenced above. |
* upstream/indigo-devel: fix regression of PR ros#515 Adding support for fixed-width floating-point and integer array values as per issue ros#400 Fix exception at roslaunch startup if python is build without ipv6 support. Fix exception at roscore startup if python has ipv6 disabled. use fileno comparison only as an alternative and when available fix removal of QueuedConnection leading to wrong subscriber count (fix ros#526) fix comment (fix ros#529) unregister statistics publisher Fix: TCPROS header validation crash when `callerid` header is not set avoid storing subscriber reference in SubscriberStatisticsLogger only create SubscriberStatisticsLogger when enabled make param functions thread-safe Do not use Python when building for Android Do not use ifaddrs on Android as it is not natively supported
* upstream/indigo-devel: fix regression of PR ros#515 Adding support for fixed-width floating-point and integer array values as per issue ros#400 Fix exception at roslaunch startup if python is build without ipv6 support. Fix exception at roscore startup if python has ipv6 disabled. use fileno comparison only as an alternative and when available fix removal of QueuedConnection leading to wrong subscriber count (fix ros#526) fix comment (fix ros#529) unregister statistics publisher Fix: TCPROS header validation crash when `callerid` header is not set avoid storing subscriber reference in SubscriberStatisticsLogger only create SubscriberStatisticsLogger when enabled make param functions thread-safe Do not use Python when building for Android Do not use ifaddrs on Android as it is not natively supported
When viewing, for example, covariances within a nav_msgs/Odometry message, or any message with an array of floating-point values, it can be hard to see the values if the messages are updating frequently. In general, it might be easier to make all numeric fields have fixed width and precision so that each message has a constant character size.
The text was updated successfully, but these errors were encountered: