groove-x / mqtt_bridge

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

Unable to change format of topic before sending to remote server #16

Closed kauffmanes closed 3 years ago

kauffmanes commented 6 years ago

I got this set up to listen for messages on a topic and forward them to a remote server using the JSON format and it's working great. I would ideally like to change the format before it's sent to a remote server. For example, instead of { "topic1": "123" }, is there a way to send it out like {"topic": "topic1", "value": "123"}?

ledmonster commented 3 years ago

to do so, please implement custom Bridge class and use it. See mqtt_bridge.bridge module. thank you.