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

Command to monitor and pretty print the rosout logs #849 #850

Closed
wants to merge 1 commit into from

Conversation

guillaumeautran
Copy link

Creation of a rosout print command that generates pretty prints of the content of the /rosout topic. The commands also allows for the filtering of nodes based on a regular expression applied to the node name itself. Output color can be disabled (enabled by default) and the function information detail can also be displayed.

issue: #849

Creation of a rosout print command that generates pretty prints of the content of the `/rosout` topic. The commands also allows for the filtering of nodes based on a regular expression applied to the node name itself. Output color can be disabled (enabled by default) and the function information detail can also be displayed.

issue: ros2#849
@clalancette
Copy link
Contributor

I'm honestly not sure this is a feature we need to have in ros2 itself.

You can easily parse this kind of information using a YAML parser. For instance, I downloaded https://github.com/mikefarah/yq , and now I can do:

$ ros2 topic echo /rosout | yq '.msg'

Which just prints out the message field. You can also easily use something like it to select only the nodes you are interested in:

$ ros2 topic echo /rosout | yq 'select(.name == "talker") .msg'

So given that there are other tools out there that can do this, I'd rather not maintain this in the core itself.

@guillaumeautran
Copy link
Author

That's fair. Just thought I'd bring it here to see if there was any interest.

@clalancette
Copy link
Contributor

Sorry, I was maybe a little more terse than I meant to be.

Everything we put into the ROS 2 core has a cost, mostly in maintenance. That stuff always has to work before we can do a release, so keeping the size of the core smaller means it is somewhat easier to maintain. That's the main reason I always look for other tools to do things, rather than write our own.

However, the good news is that we've attempted to make ROS 2 as pluggable as possible. So if you find value in this extension, then I'd encourage you to put this in a separate repository and release it into Humble, Iron, and Rolling. That neatly sidesteps the problem of having it in the core, while still making the functionality available. Over time if we then find that this is a must-have feature, we can then promote it into the core.

Does that make sense?

@guillaumeautran
Copy link
Author

I do understand the need to keep the core lean to reduce the maintenance cost. And although you are correct that you can use other tools to achieve very similar functionality, I do see the benefit of such command (and a similar one for the diagnostics topic as well).

Anyway, yes it is my plan to create a separate repo for these type of tools. Here at Clearpath, we use this utility all the time to follow the logs live. Will post the link to the repo once it is up.

Thanks for your feedback.

@guillaumeautran
Copy link
Author

FYI: https://github.com/clearpathrobotics/clearpath_ros2cli
More to come :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants