Skip to content

Commit

Permalink
suppress deprecation warnings in TfDisplay
Browse files Browse the repository at this point in the history
  • Loading branch information
wjwwood committed May 9, 2018
1 parent e8fc475 commit c7f6a4a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/rviz/default_plugin/tf_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,17 @@ void TFDisplay::updateFrames()
{
typedef std::vector<std::string> 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;
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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)
{
Expand Down
10 changes: 10 additions & 0 deletions src/rviz/properties/tf_frame_property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@ void TfFrameProperty::setFrameManager( FrameManager* frame_manager )
void TfFrameProperty::fillFrameList()
{
std::vector<std::string> 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();
Expand Down

0 comments on commit c7f6a4a

Please sign in to comment.