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

systematic check of incoming markers #1275

Merged

Conversation

jgueldenstein
Copy link
Contributor

Using rviz Markers for debugging is often very useful, but sometimes the developer makes mistakes when filling in the fields of the marker.
In some cases the resulting markers are not visible or not displayed as intended.
In a few cases this lead to long debugging sessions when the actual problem was the visualization...

Until now there was little and unorganized debug output from rviz to assist the developer in some of these cases.

I have implemented a systematic check of all marker types as well as marker arrays
as described here and implemented in the Display.

During testing I found some other bugs as well:

  • TEXT_VIEW_FACING Markers with an empty text cause rviz to segfault.
  • TEXT_VIEW_FACING Markers with text that consists exclusively of whitespace trigger a vertex buffer overflow.

These two bugs are resolved in commit d30cda4

  • Markers with an undefined type cause rviz to crash

This is resolved in commit 9c15d9a

Apart from the bugfixes, this pull-request does not change the rendering behavior of rviz.
It simply provides additional warning output to the console and to the display status.

We would like to see this merged in kinetic&upwards, so the request intentionally targets kinetic-devel.

@v4hn

all warnings are now logged in marker status and ROS_WARN

checks were moved from the individual marker classes to marker_utils.cpp

a multitude of checks were added to validate documentation conformity.
@v4hn
Copy link
Contributor

v4hn commented Nov 19, 2018

@wjwwood any chances to see this merged in any (ROS1) branch? Any changes required?
Is there any other maintainer by now that one could ping?

This is very helpful when working with students when they don't know what they are doing really.

@wjwwood
Copy link
Member

wjwwood commented Nov 19, 2018

I'm sorry, but I don't have time to merge any features right now, or release them. I will say that if this changes API or ABI, I'll only take it for melodic or later, but I haven't checked this pr at all yet.

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this cleanup in general. However, I'm a little bit concerned about slowdown.
You frequently allocate std::string from const char* and then push this into stringstream.
I think the std::string allocation can be avoided if you directly pass the stringstream to the checker functions. Using ostringstream::tellp() you can also efficiently decide whether to add a comma or not.
I need to test this in practice...

src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
@v4hn
Copy link
Contributor

v4hn commented Mar 8, 2019 via email

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this iteration. I'm sorry for the delay in reviewing - I was extremely busy recently too.
There are some further remarks. Please have a look.

src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Outdated Show resolved Hide resolved
src/rviz/default_plugin/marker_utils.cpp Show resolved Hide resolved
Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this contribution and your patience. I added a few minor commits. If you don't complain, I will merge.

@jgueldenstein
Copy link
Contributor Author

Thank you very much for your patience, time and your review, I checked your commits and I think they do some nice cleanup and consistency.
f7dea2b is a nice feature to have to immediately see all errors in a marker array. Thanks for that.
I do not quite understand when an undefined owner would occur but I think checking for that is good.

@rhaschke rhaschke merged commit de1ae4a into ros-visualization:kinetic-devel Aug 13, 2019
rhaschke pushed a commit that referenced this pull request Aug 13, 2019
Checks were moved from the individual marker classes to marker_utils.cpp 
A multitude of checks was added to validate conformity to documentation.
All warnings are logged to console and in display status.

Bug fixes:
* checking text in TEXT_VIEW_FACING marker to prevent crashes
* ignore unknown marker type
@v4hn
Copy link
Contributor

v4hn commented Aug 13, 2019 via email

@rhaschke rhaschke mentioned this pull request Sep 1, 2019
rhaschke added a commit to rhaschke/rviz that referenced this pull request Sep 8, 2019
- invalid quaternion: issue warning only
- triangle list accepts points.size()/3 colors as well (face colors)
- don't create (empty) text marker for interactive marker control with empty description
rhaschke added a commit to rhaschke/rviz that referenced this pull request Sep 9, 2019
rhaschke added a commit to rhaschke/rviz that referenced this pull request Sep 9, 2019
- invalid quaternion: issue warning only
- triangle list accepts points.size()/3 colors as well (face colors)
- don't create (empty) text marker for interactive marker control with empty description
rhaschke added a commit to rhaschke/rviz that referenced this pull request Sep 9, 2019
…vels

- distinguish all ros::console::levels
- issue rviz status warning for any message, but don't clutter console
- use logger namespace to allow disabling console output
rhaschke added a commit to rhaschke/rviz that referenced this pull request Sep 10, 2019
- invalid quaternion: issue warning only
- triangle list accepts points.size()/3 colors as well (face colors)
- don't create text marker for interactive marker control with empty description
- allow more fine-grained log levels
  - distinguish all ros::console::levels
  - issue rviz status warning for any message, but avoid cluttering the console
  - use logger namespace to allow disabling console output
rhaschke added a commit to rhaschke/rviz that referenced this pull request Sep 20, 2019
- invalid quaternion: issue warning only
- triangle list accepts points.size()/3 colors as well (face colors)
- don't create text marker for interactive marker control with empty description
- allow more fine-grained log levels
  - distinguish all ros::console::levels
  - issue rviz status warning for any message, but avoid cluttering the console
  - use logger namespace to allow disabling console output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants