Skip to content

Commit

Permalink
fix TopicInfo depcrecation warnings (#543)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 authored Jun 6, 2023
1 parent 94d1586 commit 8006a56
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/plugins/image_display/ImageDisplay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ void ImageDisplay::OnRefresh()
for (auto topic : allTopics)
{
std::vector<transport::MessagePublisher> publishers;
this->dataPtr->node.TopicInfo(topic, publishers);
std::vector<transport::MessagePublisher> subscribers;
this->dataPtr->node.TopicInfo(topic, publishers, subscribers);
for (auto pub : publishers)
{
if (pub.MsgTypeName() == "gz.msgs.Image")
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/navsat_map/NavSatMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ void NavSatMap::OnRefresh()
for (auto topic : allTopics)
{
std::vector<transport::MessagePublisher> publishers;
this->dataPtr->node.TopicInfo(topic, publishers);
std::vector<transport::MessagePublisher> subscribers;
this->dataPtr->node.TopicInfo(topic, publishers, subscribers);
for (auto pub : publishers)
{
if (pub.MsgTypeName() == "gz.msgs.NavSat")
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/point_cloud/PointCloud.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ void PointCloud::OnRefresh()
for (auto topic : allTopics)
{
std::vector<gz::transport::MessagePublisher> publishers;
this->dataPtr->node.TopicInfo(topic, publishers);
std::vector<gz::transport::MessagePublisher> subscribers;
this->dataPtr->node.TopicInfo(topic, publishers, subscribers);
for (auto pub : publishers)
{
if (pub.MsgTypeName() == "gz.msgs.PointCloudPacked")
Expand Down
14 changes: 8 additions & 6 deletions src/plugins/topic_viewer/TopicViewer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,10 @@ void TopicViewerPrivate::CreateModel()

for (unsigned int i = 0; i < topics.size(); ++i)
{
std::vector<transport::MessagePublisher> infoMsgs;
this->node.TopicInfo(topics[i], infoMsgs);
std::string msgType = infoMsgs[0].MsgTypeName();
std::vector<transport::MessagePublisher> publishers;
std::vector<transport::MessagePublisher> subscribers;
this->node.TopicInfo(topics[i], publishers, subscribers);
std::string msgType = publishers[0].MsgTypeName();
this->AddTopic(topics[i], msgType);
}
}
Expand Down Expand Up @@ -384,9 +385,10 @@ void TopicViewer::UpdateModel()
for (unsigned int i = 0; i < topics.size(); ++i)
{
// get the msg type
std::vector<transport::MessagePublisher> infoMsgs;
this->dataPtr->node.TopicInfo(topics[i], infoMsgs);
std::string msgType = infoMsgs[0].MsgTypeName();
std::vector<transport::MessagePublisher> publishers;
std::vector<transport::MessagePublisher> 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]) &&
Expand Down

0 comments on commit 8006a56

Please sign in to comment.