Skip to content
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

Closed
ayrton04 opened this issue May 7, 2014 · 6 comments
Closed

rostopic: Make all numeric fields fixed width for easier reading #400

ayrton04 opened this issue May 7, 2014 · 6 comments

Comments

@ayrton04
Copy link
Contributor

ayrton04 commented May 7, 2014

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.

@dirk-thomas
Copy link
Member

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".

@dirk-thomas dirk-thomas added this to the untargeted milestone May 7, 2014
@ayrton04
Copy link
Contributor Author

ayrton04 commented May 8, 2014

I'll take this on, sure.

@ayrton04
Copy link
Contributor Author

Any preference as to functionality? Should this apply only to floating point numbers, or to integers and Boolean values as well?

@dirk-thomas
Copy link
Member

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...

@ayrton04
Copy link
Contributor Author

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!

@dirk-thomas
Copy link
Member

This should be addressed with the recently merged PRs in genpy and ros_comm referenced above.

@dirk-thomas dirk-thomas removed this from the untargeted milestone Dec 10, 2014
mjyc pushed a commit to mjyc/ros_comm that referenced this issue Dec 10, 2014
* 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
rsinnet pushed a commit to MisoRobotics/ros_comm that referenced this issue Jun 19, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants