From c7f6a4a29a28c08989680a4c52e74c1cfb305bb3 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Tue, 8 May 2018 19:24:33 -0700 Subject: [PATCH] suppress deprecation warnings in TfDisplay --- src/rviz/default_plugin/tf_display.cpp | 33 ++++++++++++++++++++++- src/rviz/properties/tf_frame_property.cpp | 10 +++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/rviz/default_plugin/tf_display.cpp b/src/rviz/default_plugin/tf_display.cpp index ef35876332..a792de7ffe 100644 --- a/src/rviz/default_plugin/tf_display.cpp +++ b/src/rviz/default_plugin/tf_display.cpp @@ -368,7 +368,17 @@ void TFDisplay::updateFrames() { typedef std::vector V_string; V_string frames; + // TODO(wjwwood): remove this and use tf2 interface instead +#ifndef _WIN32 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + context_->getTFClient()->getFrameStrings( frames ); + +#ifndef _WIN32 +# pragma GCC diagnostic pop +#endif std::sort(frames.begin(), frames.end()); S_FrameInfo current_frames; @@ -494,8 +504,18 @@ Ogre::ColourValue lerpColor(const Ogre::ColourValue& start, const Ogre::ColourVa void TFDisplay::updateFrame( FrameInfo* frame ) { + // TODO(wjwwood): remove this and use tf2 interface instead +#ifndef _WIN32 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + tf::TransformListener* tf = context_->getTFClient(); +#ifndef _WIN32 +# pragma GCC diagnostic pop +#endif + // Check last received time so we can grey out/fade out frames that have stopped being published ros::Time latest_time; tf->getLatestCommonTime( fixed_frame_.toStdString(), frame->name_, latest_time, 0 ); @@ -617,7 +637,18 @@ void TFDisplay::updateFrame( FrameInfo* frame ) tf::StampedTransform transform; try { - context_->getFrameManager()->getTFClientPtr()->lookupTransform(frame->parent_,frame->name_,ros::Time(0),transform); + // TODO(wjwwood): remove this and use tf2 interface instead +#ifndef _WIN32 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + + auto tf_client = context_->getFrameManager()->getTFClientPtr(); + +#ifndef _WIN32 +# pragma GCC diagnostic pop +#endif + tf_client->lookupTransform(frame->parent_,frame->name_,ros::Time(0),transform); } catch(tf::TransformException& e) { diff --git a/src/rviz/properties/tf_frame_property.cpp b/src/rviz/properties/tf_frame_property.cpp index fb3229057b..c8dbb40c97 100644 --- a/src/rviz/properties/tf_frame_property.cpp +++ b/src/rviz/properties/tf_frame_property.cpp @@ -86,7 +86,17 @@ void TfFrameProperty::setFrameManager( FrameManager* frame_manager ) void TfFrameProperty::fillFrameList() { std::vector std_frames; + // TODO(wjwwood): remove this and use tf2 interface instead +#ifndef _WIN32 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + frame_manager_->getTFClient()->getFrameStrings( std_frames ); + +#ifndef _WIN32 +# pragma GCC diagnostic pop +#endif std::sort( std_frames.begin(), std_frames.end() ); clearOptions();