jsk-ros-pkg / jsk_visualization

jsk visualization ros packages
https://github.com/jsk-ros-pkg/jsk_visualization
324 stars 173 forks source link

Fix simultaneous display of OverlayCamera and OverlayImage #863

Closed peci1 closed 1 year ago

peci1 commented 1 year ago

Without this change, adding both OverlayCamera and OverlayImage to one rviz window crashes with:

[ WARN] [1669695420.835465329, 1666865132.227821766] [ros.rviz]: OGRE EXCEPTION(4:ItemIdentityException): Overlay with name 'OverlayImageDisplayObject0' already exists! in OverlayManager::create at /build/ogre-1.9-CZD0Iy/ogre-1.9-1.9.0+dfsg1/Components/Overlay/src/OgreOverlayManager.cpp (line 109)
terminate called after throwing an instance of 'Ogre::ItemIdentityException'
  what():  OGRE EXCEPTION(4:ItemIdentityException): Overlay with name 'OverlayImageDisplayObject0' already exists! in OverlayManager::create at /build/ogre-1.9-CZD0Iy/ogre-1.9-1.9.0+dfsg1/Components/Overlay/src/OgreOverlayManager.cpp (line 109)

I'm not really sure whether it is correct that I made this string different from the similar one used in the OverlayCamera (OverlayCameraDisplayObject). If these two should be the same, I can update the PR.

knorth55 commented 1 year ago

this PR fixes the typo in overlay_camera_display.cpp.

$ cd jsk_rviz_plugins/src
$ grep -Ei '\"[a-Z]+Object' * -r
linear_gauge_display.cpp:    ss << "LinearGaugeDisplayObject" << count++;
overlay_camera_display.cpp:    ss << "OverlayCameraDisplayObject" << count++;
overlay_camera_display.cpp:    ss << "OverlayImageDisplayObject" << count++;
overlay_diagnostic_display.cpp:      ss << "OverlayDiagnosticDisplayObject" << count++;
overlay_image_display.cpp:        ss << "OverlayImageDisplayObject" << count++;
overlay_menu_display.cpp:      ss << "OverlayMenuDisplayObject" << count++;
overlay_text_display.cpp:      ss << "OverlayTextDisplayObject" << count++;
pie_chart_display.cpp:    ss << "PieChartDisplayObject" << count++;
string_display.cpp:      ss << "StringDisplayObject" << count++;