Advertisement
Guest User

Patch RVIZ for OGRE1.9 - Better

a guest
Dec 14th, 2013
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 7.42 KB | None | 0 0
  1. diff -aur ./rviz.orig/CMakeLists.txt ./rviz/CMakeLists.txt
  2. --- ./rviz.orig/CMakeLists.txt  2013-12-14 12:06:51.248587392 +0100
  3. +++ ./rviz/CMakeLists.txt   2013-12-14 10:13:32.033728000 +0100
  4. @@ -21,6 +21,18 @@
  5.  OUTPUT_VARIABLE OGRE_PLUGIN_PATH
  6.  OUTPUT_STRIP_TRAILING_WHITESPACE
  7.  )
  8. +
  9. +pkg_check_modules(OGRE-Overlay OGRE-Overlay)
  10. +if (OGRE-Overlay_FOUND)
  11. +set(OGRE_LDFLAGS ${OGRE_LDFLAGS} ${OGRE-Overlay_LDFLAGS})
  12. +set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} ${OGRE-Overlay_INCLUDE_DIRS})
  13. +set(OGRE_LIBRARIES ${OGRE_LIBRARIES};${OGRE-Overlay_LIBRARIES})
  14. +set(OGRE_LIBRARY_DIRS ${OGRE_LIBRARY_DIRS} ${OGRE-Overlay_LIBRARY_DIRS})
  15. +set(OGRE_CFLAGS ${OGRE_CFLAGS} ${OGRE-Overlay_CFLAGS})
  16. +endif()
  17. +
  18. +
  19. +
  20.  message(STATUS OGRE_PLUGIN_PATH=${OGRE_PLUGIN_PATH})
  21.  
  22.  if(APPLE)
  23. @@ -36,6 +48,8 @@
  24.  
  25.  find_package(urdfdom REQUIRED)
  26.  
  27. +message(STATUS "urdfdom_LIBRARIES={${urdfdom_LIBRARIES}}")
  28. +
  29.  find_package(catkin REQUIRED
  30.    COMPONENTS
  31.    angles
  32. diff -aur ./rviz.orig/src/rviz/default_plugin/map_display.cpp ./rviz/src/rviz/default_plugin/map_display.cpp
  33. --- ./rviz.orig/src/rviz/default_plugin/map_display.cpp 2013-12-14 12:06:51.278587237 +0100
  34. +++ ./rviz/src/rviz/default_plugin/map_display.cpp  2013-12-14 09:51:04.144028000 +0100
  35. @@ -60,7 +60,7 @@
  36.  MapDisplay::MapDisplay()
  37.    : Display()
  38.    , manual_object_( NULL )
  39. -  , material_( 0 )
  40. +  //~ , material_( NULL )
  41.    , loaded_( false )
  42.    , resolution_( 0.0f )
  43.    , width_( 0 )
  44. diff -aur ./rviz.orig/src/rviz/ogre_helpers/movable_text.cpp ./rviz/src/rviz/ogre_helpers/movable_text.cpp
  45. --- ./rviz.orig/src/rviz/ogre_helpers/movable_text.cpp  2013-12-14 12:06:51.278587237 +0100
  46. +++ ./rviz/src/rviz/ogre_helpers/movable_text.cpp   2013-12-14 11:44:39.155472000 +0100
  47. @@ -47,7 +47,7 @@
  48.  #include "OGRE/OgreSceneNode.h"
  49.  #include "OGRE/OgreMaterialManager.h"
  50.  #include "OGRE/OgreHardwareBufferManager.h"
  51. -#include "OGRE/OgreFontManager.h"
  52. +#include "OGRE/Overlay/OgreFontManager.h"
  53.  
  54.  #include <sstream>
  55.  
  56. diff -aur ./rviz.orig/src/rviz/ogre_helpers/movable_text.h ./rviz/src/rviz/ogre_helpers/movable_text.h
  57. --- ./rviz.orig/src/rviz/ogre_helpers/movable_text.h    2013-12-14 12:06:51.278587237 +0100
  58. +++ ./rviz/src/rviz/ogre_helpers/movable_text.h 2013-12-14 09:51:04.144028000 +0100
  59. @@ -50,6 +50,7 @@
  60.  {
  61.  class RenderQueue;
  62.  class Camera;
  63. +class Font;
  64.  }
  65.  
  66.  namespace rviz
  67. diff -aur ./rviz.orig/src/rviz/ogre_helpers/point_cloud.cpp ./rviz/src/rviz/ogre_helpers/point_cloud.cpp
  68. --- ./rviz.orig/src/rviz/ogre_helpers/point_cloud.cpp   2013-12-14 12:06:51.278587237 +0100
  69. +++ ./rviz/src/rviz/ogre_helpers/point_cloud.cpp    2013-12-14 09:51:04.144028000 +0100
  70. @@ -137,19 +137,20 @@
  71.    std::stringstream ss;
  72.    static int count = 0;
  73.    ss << "PointCloudMaterial" << count++;
  74. -  point_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudPoint");
  75. -  square_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudSquare");
  76. -  flat_square_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudFlatSquare");
  77. -  sphere_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudSphere");
  78. -  tile_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudTile");
  79. -  box_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudBox");
  80. -
  81. -  point_material_ = Ogre::MaterialPtr(point_material_)->clone(ss.str() + "Point");
  82. -  square_material_ = Ogre::MaterialPtr(square_material_)->clone(ss.str() + "Square");
  83. -  flat_square_material_ = Ogre::MaterialPtr(flat_square_material_)->clone(ss.str() + "FlatSquare");
  84. -  sphere_material_ = Ogre::MaterialPtr(sphere_material_)->clone(ss.str() + "Sphere");
  85. -  tile_material_ = Ogre::MaterialPtr(tile_material_)->clone(ss.str() + "Tiles");
  86. -  box_material_ = Ogre::MaterialPtr(box_material_)->clone(ss.str() + "Box");
  87. +
  88. +  point_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudPoint").staticCast<Ogre::Material>();
  89. +  square_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudSquare").staticCast<Ogre::Material>();
  90. +  flat_square_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudFlatSquare").staticCast<Ogre::Material>();
  91. +  sphere_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudSphere").staticCast<Ogre::Material>();
  92. +  tile_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudTile").staticCast<Ogre::Material>();
  93. +  box_material_ = Ogre::MaterialManager::getSingleton().getByName("rviz/PointCloudBox").staticCast<Ogre::Material>();
  94. +
  95. +  point_material_ = point_material_->clone(ss.str() + "Point");
  96. +  square_material_ = square_material_->clone(ss.str() + "Square");
  97. +  flat_square_material_ = flat_square_material_->clone(ss.str() + "FlatSquare");
  98. +  sphere_material_ = sphere_material_->clone(ss.str() + "Sphere");
  99. +  tile_material_ = tile_material_->clone(ss.str() + "Tiles");
  100. +  box_material_ = box_material_->clone(ss.str() + "Box");
  101.  
  102.    point_material_->load();
  103.    square_material_->load();
  104. @@ -174,12 +175,12 @@
  105.    tile_material_->unload();
  106.    box_material_->unload();
  107.  
  108. -  Ogre::MaterialManager::getSingleton().remove(point_material_);
  109. +  /*Ogre::MaterialManager::getSingleton().remove(point_material_);
  110.    Ogre::MaterialManager::getSingleton().remove(square_material_);
  111.    Ogre::MaterialManager::getSingleton().remove(flat_square_material_);
  112.    Ogre::MaterialManager::getSingleton().remove(sphere_material_);
  113.    Ogre::MaterialManager::getSingleton().remove(tile_material_);
  114. -  Ogre::MaterialManager::getSingleton().remove(box_material_);
  115. +  Ogre::MaterialManager::getSingleton().remove(box_material_);*/
  116.  }
  117.  
  118.  const Ogre::AxisAlignedBox& PointCloud::getBoundingBox() const
  119. diff -aur ./rviz.orig/src/rviz/ogre_helpers/point_cloud.h ./rviz/src/rviz/ogre_helpers/point_cloud.h
  120. --- ./rviz.orig/src/rviz/ogre_helpers/point_cloud.h 2013-12-14 12:06:51.278587237 +0100
  121. +++ ./rviz/src/rviz/ogre_helpers/point_cloud.h  2013-12-14 09:51:04.144028000 +0100
  122. @@ -213,12 +213,12 @@
  123.    Ogre::Vector3 common_direction_;          ///< See Ogre::BillboardSet::setCommonDirection
  124.    Ogre::Vector3 common_up_vector_;          ///< See Ogre::BillboardSet::setCommonUpVector
  125.  
  126. -  Ogre::ResourcePtr point_material_;
  127. -  Ogre::ResourcePtr square_material_;
  128. -  Ogre::ResourcePtr flat_square_material_;
  129. -  Ogre::ResourcePtr sphere_material_;
  130. -  Ogre::ResourcePtr tile_material_;
  131. -  Ogre::ResourcePtr box_material_;
  132. +  Ogre::MaterialPtr point_material_;
  133. +  Ogre::MaterialPtr square_material_;
  134. +  Ogre::MaterialPtr flat_square_material_;
  135. +  Ogre::MaterialPtr sphere_material_;
  136. +  Ogre::MaterialPtr tile_material_;
  137. +  Ogre::MaterialPtr box_material_;
  138.    Ogre::MaterialPtr current_material_;
  139.    float alpha_;
  140.  
  141. diff -aur ./rviz.orig/src/rviz/ogre_helpers/render_system.cpp ./rviz/src/rviz/ogre_helpers/render_system.cpp
  142. --- ./rviz.orig/src/rviz/ogre_helpers/render_system.cpp 2013-12-14 12:06:51.278587237 +0100
  143. +++ ./rviz/src/rviz/ogre_helpers/render_system.cpp  2013-12-14 12:07:52.894935442 +0100
  144. @@ -47,6 +47,7 @@
  145.  #include <ros/console.h>
  146.  
  147.  #include <OGRE/OgreRenderWindow.h>
  148. +#include <OGRE/Overlay/OgreOverlaySystem.h>
  149.  
  150.  #include "rviz/env_config.h"
  151.  #include "rviz/ogre_helpers/ogre_logging.h"
  152. @@ -84,6 +85,7 @@
  153.  
  154.    setupDummyWindowId();
  155.    ogre_root_ = new Ogre::Root( rviz_path+"/ogre_media/plugins.cfg" );
  156. +  Ogre::OverlaySystem *os = new Ogre::OverlaySystem();
  157.    loadOgrePlugins();
  158.    setupRenderSystem();
  159.    ogre_root_->initialise(false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement