From 452494d15e9309bd92cd13c65d01dff3dfff00fc Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Mon, 5 Jun 2023 22:29:08 +0000 Subject: [PATCH] fix TopicInfo depcrecation warnings Signed-off-by: Ian Chen --- src/plugins/image_display/ImageDisplay.cc | 3 ++- src/plugins/navsat_map/NavSatMap.cc | 3 ++- src/plugins/point_cloud/PointCloud.cc | 3 ++- src/plugins/topic_viewer/TopicViewer.cc | 14 ++++++++------ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/plugins/image_display/ImageDisplay.cc b/src/plugins/image_display/ImageDisplay.cc index dea75893c..e3ee17c8e 100644 --- a/src/plugins/image_display/ImageDisplay.cc +++ b/src/plugins/image_display/ImageDisplay.cc @@ -265,7 +265,8 @@ void ImageDisplay::OnRefresh() for (auto topic : allTopics) { std::vector publishers; - this->dataPtr->node.TopicInfo(topic, publishers); + std::vector subscribers; + this->dataPtr->node.TopicInfo(topic, publishers, subscribers); for (auto pub : publishers) { if (pub.MsgTypeName() == "gz.msgs.Image") diff --git a/src/plugins/navsat_map/NavSatMap.cc b/src/plugins/navsat_map/NavSatMap.cc index 6f3f8f558..f1a8b22b7 100644 --- a/src/plugins/navsat_map/NavSatMap.cc +++ b/src/plugins/navsat_map/NavSatMap.cc @@ -156,7 +156,8 @@ void NavSatMap::OnRefresh() for (auto topic : allTopics) { std::vector publishers; - this->dataPtr->node.TopicInfo(topic, publishers); + std::vector subscribers; + this->dataPtr->node.TopicInfo(topic, publishers, subscribers); for (auto pub : publishers) { if (pub.MsgTypeName() == "gz.msgs.NavSat") diff --git a/src/plugins/point_cloud/PointCloud.cc b/src/plugins/point_cloud/PointCloud.cc index f5a27cbf8..328b06616 100644 --- a/src/plugins/point_cloud/PointCloud.cc +++ b/src/plugins/point_cloud/PointCloud.cc @@ -236,7 +236,8 @@ void PointCloud::OnRefresh() for (auto topic : allTopics) { std::vector publishers; - this->dataPtr->node.TopicInfo(topic, publishers); + std::vector subscribers; + this->dataPtr->node.TopicInfo(topic, publishers, subscribers); for (auto pub : publishers) { if (pub.MsgTypeName() == "gz.msgs.PointCloudPacked") diff --git a/src/plugins/topic_viewer/TopicViewer.cc b/src/plugins/topic_viewer/TopicViewer.cc index 6064fa998..4e7ee8b3a 100644 --- a/src/plugins/topic_viewer/TopicViewer.cc +++ b/src/plugins/topic_viewer/TopicViewer.cc @@ -199,9 +199,10 @@ void TopicViewerPrivate::CreateModel() for (unsigned int i = 0; i < topics.size(); ++i) { - std::vector infoMsgs; - this->node.TopicInfo(topics[i], infoMsgs); - std::string msgType = infoMsgs[0].MsgTypeName(); + std::vector publishers; + std::vector subscribers; + this->node.TopicInfo(topics[i], publishers, subscribers); + std::string msgType = publishers[0].MsgTypeName(); this->AddTopic(topics[i], msgType); } } @@ -384,9 +385,10 @@ void TopicViewer::UpdateModel() for (unsigned int i = 0; i < topics.size(); ++i) { // get the msg type - std::vector infoMsgs; - this->dataPtr->node.TopicInfo(topics[i], infoMsgs); - std::string msgType = infoMsgs[0].MsgTypeName(); + std::vector publishers; + std::vector subscribers; + this->dataPtr->node.TopicInfo(topics[i], publishers, subscribers); + std::string msgType = publishers[0].MsgTypeName(); // skip the matched topics if (this->dataPtr->currentTopics.count(topics[i]) &&