groove-x / mqtt_bridge

mqtt_bridge provides a functionality to bridge between ROS and MQTT in bidirectional
MIT License
160 stars 146 forks source link

Error in: src/mqtt_bridge #19

Closed rachel-dev closed 4 years ago

rachel-dev commented 5 years ago

Hi, When I try to use mqtt private path to publish topic from mqtt to ROS, Ros can't get message. For example, publishing a topic which is device/001/echo (private_path: device/001) from MQTT, ROS should get message from /private/back but actually not.

I find the promblem is that in class MqttToRosBridge(Bridge): self._mqtt_client.subscribe(self.topic_from) self._mqtt_client.message_callback_add(self.topic_from, self._callback_mqtt) shold change to self._mqtt_client.subscribe(self._topic_from) self._mqtt_client.message_callback_add(self._topic_from, self._callback_mqtt)