diff --git a/jsk_rviz_plugins/CMakeLists.txt b/jsk_rviz_plugins/CMakeLists.txt index 27bc4fa16..8d00c764f 100644 --- a/jsk_rviz_plugins/CMakeLists.txt +++ b/jsk_rviz_plugins/CMakeLists.txt @@ -4,7 +4,9 @@ # http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html cmake_minimum_required(VERSION 2.8.3) project(jsk_rviz_plugins) -add_compile_options(-std=c++11) +if("$ENV{ROS_DISTRO}" STRGREATER "indigo") + add_compile_options(-std=c++11) +endif() # Load catkin and all dependencies required for this package # TODO: remove all from COMPONENTS that are not catkin packages. find_package(catkin REQUIRED COMPONENTS rviz jsk_hark_msgs jsk_footstep_msgs jsk_recognition_utils diff --git a/jsk_rviz_plugins/src/ambient_sound_display_groovy.cpp b/jsk_rviz_plugins/src/ambient_sound_display_groovy.cpp index 180f30efc..9191f6661 100644 --- a/jsk_rviz_plugins/src/ambient_sound_display_groovy.cpp +++ b/jsk_rviz_plugins/src/ambient_sound_display_groovy.cpp @@ -234,7 +234,11 @@ namespace jsk_rviz_plugins // We are keeping a circular buffer of visual pointers. This gets // the next one, or creates and stores it if it was missing. +#if ROS_VERSION_MINIMUM(1,12,0) std::shared_ptr visual; +#else + boost::shared_ptr visual; +#endif //AmbientSoundVisual* visual_ptr; if( visuals_.full()) { diff --git a/jsk_rviz_plugins/src/ambient_sound_display_groovy.h b/jsk_rviz_plugins/src/ambient_sound_display_groovy.h index bed7c2c42..21735d392 100644 --- a/jsk_rviz_plugins/src/ambient_sound_display_groovy.h +++ b/jsk_rviz_plugins/src/ambient_sound_display_groovy.h @@ -10,6 +10,8 @@ #include #endif +#include + namespace Ogre { class SceneNode; @@ -109,7 +111,11 @@ private Q_SLOTS: // adjustable history length, so we need one visual per history // item. //boost::circular_buffer visuals_; +#if ROS_VERSION_MINIMUM(1,12,0) boost::circular_buffer > visuals_; +#else + boost::circular_buffer > visuals_; +#endif // A node in the Ogre scene tree to be the parent of all our visuals. //Ogre::SceneNode* scene_node_; diff --git a/jsk_rviz_plugins/src/bounding_box_display_common.h b/jsk_rviz_plugins/src/bounding_box_display_common.h index 48463668f..da3473e5b 100644 --- a/jsk_rviz_plugins/src/bounding_box_display_common.h +++ b/jsk_rviz_plugins/src/bounding_box_display_common.h @@ -59,9 +59,15 @@ namespace jsk_rviz_plugins public: BoundingBoxDisplayCommon() {}; ~BoundingBoxDisplayCommon() {}; +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr ShapePtr; typedef std::shared_ptr BillboardLinePtr; typedef std::shared_ptr ArrowPtr; +#else + typedef boost::shared_ptr ShapePtr; + typedef boost::shared_ptr BillboardLinePtr; + typedef boost::shared_ptr ArrowPtr; +#endif protected: QColor color_; diff --git a/jsk_rviz_plugins/src/camera_info_display.h b/jsk_rviz_plugins/src/camera_info_display.h index 0a1f6d62f..10fe497cd 100644 --- a/jsk_rviz_plugins/src/camera_info_display.h +++ b/jsk_rviz_plugins/src/camera_info_display.h @@ -64,7 +64,11 @@ namespace jsk_rviz_plugins class TrianglePolygon { public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr Ptr; +#else + typedef boost::shared_ptr Ptr; +#endif TrianglePolygon(Ogre::SceneManager* manager, Ogre::SceneNode* node, const cv::Point3d& O, @@ -87,8 +91,13 @@ namespace jsk_rviz_plugins { Q_OBJECT public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr ShapePtr; typedef std::shared_ptr BillboardLinePtr; +#else + typedef boost::shared_ptr ShapePtr; + typedef boost::shared_ptr BillboardLinePtr; +#endif CameraInfoDisplay(); virtual ~CameraInfoDisplay(); diff --git a/jsk_rviz_plugins/src/facing_visualizer.h b/jsk_rviz_plugins/src/facing_visualizer.h index 98caffdfa..0064af6f8 100644 --- a/jsk_rviz_plugins/src/facing_visualizer.h +++ b/jsk_rviz_plugins/src/facing_visualizer.h @@ -57,7 +57,11 @@ namespace jsk_rviz_plugins class SquareObject { public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr Ptr; +#else + typedef boost::shared_ptr Ptr; +#endif SquareObject(Ogre::SceneManager* manager, double outer_radius, double inner_radius, @@ -86,7 +90,11 @@ namespace jsk_rviz_plugins class TextureObject // utility class for texture { public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr Ptr; +#else + typedef boost::shared_ptr Ptr; +#endif TextureObject(const int width, const int height, const std::string name); virtual ~TextureObject(); virtual int getWidth() { return width_; }; @@ -106,7 +114,11 @@ namespace jsk_rviz_plugins class FacingObject { public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr Ptr; +#else + typedef boost::shared_ptr Ptr; +#endif FacingObject(Ogre::SceneManager* manager, Ogre::SceneNode* parent, double size); @@ -137,7 +149,11 @@ namespace jsk_rviz_plugins class SimpleCircleFacingVisualizer: public FacingObject { public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr Ptr; +#else + typedef boost::shared_ptr Ptr; +#endif SimpleCircleFacingVisualizer(Ogre::SceneManager* manager, Ogre::SceneNode* parent, rviz::DisplayContext* context, @@ -184,7 +200,11 @@ namespace jsk_rviz_plugins class FacingTexturedObject: public FacingObject { public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr Ptr; +#else + typedef boost::shared_ptr Ptr; +#endif FacingTexturedObject(Ogre::SceneManager* manager, Ogre::SceneNode* parent, double size); @@ -200,7 +220,11 @@ namespace jsk_rviz_plugins class GISCircleVisualizer: public FacingTexturedObject { public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr Ptr; +#else + typedef boost::shared_ptr Ptr; +#endif GISCircleVisualizer(Ogre::SceneManager* manager, Ogre::SceneNode* parent, double size, diff --git a/jsk_rviz_plugins/src/footstep_display.h b/jsk_rviz_plugins/src/footstep_display.h index cf6701953..576095f1f 100644 --- a/jsk_rviz_plugins/src/footstep_display.h +++ b/jsk_rviz_plugins/src/footstep_display.h @@ -75,7 +75,11 @@ namespace jsk_rviz_plugins rviz::BoolProperty* show_name_property_; rviz::BoolProperty* use_group_coloring_property_; jsk_footstep_msgs::FootstepArray::ConstPtr latest_footstep_; +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr ShapePtr; +#else + typedef boost::shared_ptr ShapePtr; +#endif std::vector shapes_; std::vector texts_; std::vector text_nodes_; diff --git a/jsk_rviz_plugins/src/normal_display.cpp b/jsk_rviz_plugins/src/normal_display.cpp index 8e554078f..ee78390f2 100644 --- a/jsk_rviz_plugins/src/normal_display.cpp +++ b/jsk_rviz_plugins/src/normal_display.cpp @@ -232,7 +232,11 @@ namespace jsk_rviz_plugins if (validateFloats(Ogre::Vector3(x, y, z)) && validateFloats(Ogre::Vector3(normal_x, normal_y, normal_z))) { +#if ROS_VERSION_MINIMUM(1,12,0) std::shared_ptr visual; +#else + boost::shared_ptr visual; +#endif if(visuals_.full()){ visual = visuals_.front(); }else{ diff --git a/jsk_rviz_plugins/src/normal_display.h b/jsk_rviz_plugins/src/normal_display.h index 9387fad56..a95a1692e 100644 --- a/jsk_rviz_plugins/src/normal_display.h +++ b/jsk_rviz_plugins/src/normal_display.h @@ -56,7 +56,12 @@ Q_OBJECT virtual void reset(); +#if ROS_VERSION_MINIMUM(1,12,0) boost::circular_buffer > visuals_; +#else + boost::circular_buffer > visuals_; +#endif + // Function to handle an incoming ROS message. private Q_SLOTS: diff --git a/jsk_rviz_plugins/src/normal_visual.h b/jsk_rviz_plugins/src/normal_visual.h index 6f8740a5a..0ef301bac 100644 --- a/jsk_rviz_plugins/src/normal_visual.h +++ b/jsk_rviz_plugins/src/normal_visual.h @@ -9,6 +9,7 @@ #include #include #include +#include namespace jsk_rviz_plugins { @@ -27,7 +28,11 @@ namespace jsk_rviz_plugins void setScale( float scale ); private: +#if ROS_VERSION_MINIMUM(1,12,0) std::shared_ptr normal_arrow_; +#else + boost::shared_ptr normal_arrow_; +#endif Ogre::SceneNode* frame_node_; Ogre::SceneManager* scene_manager_; }; diff --git a/jsk_rviz_plugins/src/overlay_diagnostic_display.cpp b/jsk_rviz_plugins/src/overlay_diagnostic_display.cpp index cee8a8da4..30bba8c3b 100644 --- a/jsk_rviz_plugins/src/overlay_diagnostic_display.cpp +++ b/jsk_rviz_plugins/src/overlay_diagnostic_display.cpp @@ -148,8 +148,13 @@ namespace jsk_rviz_plugins for (size_t i = 0; i < msg->status.size(); i++) { diagnostic_msgs::DiagnosticStatus status = msg->status[i]; if (status.name == diagnostics_namespace_) { +#if ROS_VERSION_MINIMUM(1,12,0) latest_status_ = std::make_shared(status); +#else + latest_status_ + = boost::make_shared(status); +#endif latest_message_time_ = ros::WallTime::now(); break; } diff --git a/jsk_rviz_plugins/src/overlay_diagnostic_display.h b/jsk_rviz_plugins/src/overlay_diagnostic_display.h index 48f96ad94..01cc7fc08 100644 --- a/jsk_rviz_plugins/src/overlay_diagnostic_display.h +++ b/jsk_rviz_plugins/src/overlay_diagnostic_display.h @@ -115,7 +115,11 @@ namespace jsk_rviz_plugins boost::mutex mutex_; OverlayObject::Ptr overlay_; +#if ROS_VERSION_MINIMUM(1,12,0) std::shared_ptr latest_status_; +#else + boost::shared_ptr latest_status_; +#endif State previous_state_; ros::WallTime latest_message_time_; ros::WallTime animation_start_time_; diff --git a/jsk_rviz_plugins/src/overlay_image_display.cpp b/jsk_rviz_plugins/src/overlay_image_display.cpp index c7bc19e4e..3d3ad2e35 100644 --- a/jsk_rviz_plugins/src/overlay_image_display.cpp +++ b/jsk_rviz_plugins/src/overlay_image_display.cpp @@ -96,7 +96,11 @@ namespace jsk_rviz_plugins void OverlayImageDisplay::onInitialize() { ros::NodeHandle nh; +#if ROS_VERSION_MINIMUM(1,12,0) it_ = std::shared_ptr(new image_transport::ImageTransport(nh)); +#else + it_ = boost::shared_ptr(new image_transport::ImageTransport(nh)); +#endif updateWidth(); updateHeight(); diff --git a/jsk_rviz_plugins/src/overlay_image_display.h b/jsk_rviz_plugins/src/overlay_image_display.h index 7108fcc78..62539b678 100644 --- a/jsk_rviz_plugins/src/overlay_image_display.h +++ b/jsk_rviz_plugins/src/overlay_image_display.h @@ -85,7 +85,11 @@ namespace jsk_rviz_plugins rviz::FloatProperty* alpha_property_; int width_, height_, left_, top_; double alpha_; +#if ROS_VERSION_MINIMUM(1,12,0) std::shared_ptr it_; +#else + boost::shared_ptr it_; +#endif image_transport::Subscriber sub_; sensor_msgs::Image::ConstPtr msg_; bool is_msg_available_; diff --git a/jsk_rviz_plugins/src/overlay_utils.h b/jsk_rviz_plugins/src/overlay_utils.h index ddbeae026..efa69f7b6 100644 --- a/jsk_rviz_plugins/src/overlay_utils.h +++ b/jsk_rviz_plugins/src/overlay_utils.h @@ -59,6 +59,8 @@ #include #include +#include + namespace jsk_rviz_plugins { class OverlayObject; @@ -86,7 +88,11 @@ namespace jsk_rviz_plugins class OverlayObject { public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr Ptr; +#else + typedef boost::shared_ptr Ptr; +#endif OverlayObject(const std::string& name); virtual ~OverlayObject(); diff --git a/jsk_rviz_plugins/src/pictogram_display.h b/jsk_rviz_plugins/src/pictogram_display.h index e0f7086ef..6ae929110 100644 --- a/jsk_rviz_plugins/src/pictogram_display.h +++ b/jsk_rviz_plugins/src/pictogram_display.h @@ -68,7 +68,11 @@ namespace jsk_rviz_plugins class PictogramObject: public FacingTexturedObject { public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr Ptr; +#else + typedef boost::shared_ptr Ptr; +#endif PictogramObject(Ogre::SceneManager* manager, Ogre::SceneNode* parent, double size); diff --git a/jsk_rviz_plugins/src/polygon_array_display.h b/jsk_rviz_plugins/src/polygon_array_display.h index c3240b9ed..194133803 100644 --- a/jsk_rviz_plugins/src/polygon_array_display.h +++ b/jsk_rviz_plugins/src/polygon_array_display.h @@ -53,6 +53,8 @@ #include #endif +#include + namespace jsk_rviz_plugins { @@ -61,7 +63,11 @@ namespace jsk_rviz_plugins { Q_OBJECT public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr ArrowPtr; +#else + typedef boost::shared_ptr ArrowPtr; +#endif PolygonArrayDisplay(); virtual ~PolygonArrayDisplay(); protected: diff --git a/jsk_rviz_plugins/src/segment_array_display.h b/jsk_rviz_plugins/src/segment_array_display.h index 8706c4d10..868b34067 100644 --- a/jsk_rviz_plugins/src/segment_array_display.h +++ b/jsk_rviz_plugins/src/segment_array_display.h @@ -56,7 +56,11 @@ namespace jsk_rviz_plugins { Q_OBJECT public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr BillboardLinePtr; +#else + typedef boost::shared_ptr BillboardLinePtr; +#endif SegmentArrayDisplay(); virtual ~SegmentArrayDisplay(); protected: diff --git a/jsk_rviz_plugins/src/simple_occupancy_grid_array_display.h b/jsk_rviz_plugins/src/simple_occupancy_grid_array_display.h index 59121afe9..d7a44c65e 100644 --- a/jsk_rviz_plugins/src/simple_occupancy_grid_array_display.h +++ b/jsk_rviz_plugins/src/simple_occupancy_grid_array_display.h @@ -54,7 +54,11 @@ namespace jsk_rviz_plugins { Q_OBJECT public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr PointCloudPtr; +#else + typedef boost::shared_ptr PointCloudPtr; +#endif SimpleOccupancyGridArrayDisplay(); virtual ~SimpleOccupancyGridArrayDisplay(); protected: diff --git a/jsk_rviz_plugins/src/torus_array_display.h b/jsk_rviz_plugins/src/torus_array_display.h index 005c31449..002b8bf61 100644 --- a/jsk_rviz_plugins/src/torus_array_display.h +++ b/jsk_rviz_plugins/src/torus_array_display.h @@ -60,8 +60,13 @@ namespace jsk_rviz_plugins { Q_OBJECT public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr ArrowPtr; typedef std::shared_ptr ShapePtr; +#else + typedef boost::shared_ptr ArrowPtr; + typedef boost::shared_ptr ShapePtr; +#endif TorusArrayDisplay(); virtual ~TorusArrayDisplay(); protected: diff --git a/jsk_rviz_plugins/src/twist_stamped_display.h b/jsk_rviz_plugins/src/twist_stamped_display.h index 89e94a7f2..73d662cfd 100644 --- a/jsk_rviz_plugins/src/twist_stamped_display.h +++ b/jsk_rviz_plugins/src/twist_stamped_display.h @@ -60,8 +60,13 @@ namespace jsk_rviz_plugins { Q_OBJECT public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr ArrowPtr; typedef std::shared_ptr BillboardLinePtr; +#else + typedef boost::shared_ptr ArrowPtr; + typedef boost::shared_ptr BillboardLinePtr; +#endif TwistStampedDisplay(); virtual ~TwistStampedDisplay(); protected: diff --git a/jsk_rviz_plugins/src/video_capture_display.h b/jsk_rviz_plugins/src/video_capture_display.h index ae30a9720..ff9326f36 100644 --- a/jsk_rviz_plugins/src/video_capture_display.h +++ b/jsk_rviz_plugins/src/video_capture_display.h @@ -43,13 +43,19 @@ #include #include +#include + namespace jsk_rviz_plugins { class VideoCaptureDisplay: public rviz::Display { Q_OBJECT public: +#if ROS_VERSION_MINIMUM(1,12,0) typedef std::shared_ptr Ptr; +#else + typedef boost::shared_ptr Ptr; +#endif VideoCaptureDisplay(); virtual ~VideoCaptureDisplay(); protected: