Quantcast
Channel: Gazebo: Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 7017

Subscriber in Visual Plugin

$
0
0
Hey guys, I have a model with 2 nested models (tried this without nesting, same outcome) resembling tft screens. I have a visual plugin that changes the image in the screen, receiving the commands from a gz topic. The thing is that, since i have two of those tft screens, i have two instances of the plugin, and only one of them receives the messages. Code where only one receives the data (the one that gets initialized later): m_node = transport::NodePtr(new transport::Node()); m_visual = _parent; m_node->Init(); std::string topic_name = "~/tft/"+m_parentName+"/state"; m_stateSub = m_node->Subscribe(topic_name, onStateData); I noticed when doing gz topic -i, that both plugin shared the same port, so, i tried to get them changed by adding this: gazebo::transport::init(); gazebo::transport::run(); // rest of the code above This time, they have separate topic ports, tho, neither of them receives data. I can confirm that data is being published by doing gz topic -e, and i can confirm that both subscribers subscribe to the correct topic. What am i missing here ? Also, there is any way to get a handle to VisualPtr from a model/link plugin (instead of a visual plugin) ? Thanks in advance!

Viewing all articles
Browse latest Browse all 7017

Trending Articles