Gazebo | Ignition | Community
Ask Your Question

model plugin doesn't receive data from a subscribed topic

asked 2013-07-23 10:45:51 -0500

Chris gravatar image


I have a problem and I think it comes from a stupid mistake, but I am not able to find it.

I have a world and a model plugin and data has to be exchanged. So I use the message system to send and receive messages. It works fine, both plugins are loaded and the model plugin sends a message to the world plugin. The data is received and the world plugin sends some data back. But the callback-function of the model plugin is never called.

Can you take a quick look and tell me what I did wrong? Here is the code code

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-07-23 16:29:59 -0500

nkoenig gravatar image

I believe this is related to a problem with the Gazebo transport system. In the world pulgin message callback, you're creating a publisher then sending a message and then immediately deleting the node and publisher. The result is that the message doesn't have a chance to be sent.

The workaround is to make the node and publisher a member of the World Plugin. You should only have at most one node per class anyway.

edit flag offensive delete link more


Thank you, that solves my problem!

Chris gravatar imageChris ( 2013-07-24 04:35:21 -0500 )edit

Question Tools


Asked: 2013-07-23 10:45:51 -0500

Seen: 666 times

Last updated: Jul 23 '13