Open lreiher opened 1 year ago
Hi, @lreiher, has this issue been fixed on ros2? When I want to change the message type, this error shows:
# `mqtt_client` on host1
[mqtt_client-1] [ERROR] [168314**08.779**20] [mqtt_client]: Failed to create generic subscriber: could not create subscription: failed to create topic [rt/test_topicmain] because it's already in use in this context with a different message type, at /home/host1/workspace/tracing_ws/src/ros2/rmw_cyclonedds/rmw_cyclonedds_cpp/src/rmw_node.cpp:1613, at /home/host1/workspace/tracing_ws/src/ros2/rcl/rcl/src/rcl/subscription.c:105
# `mqtt_client` on host2
[mqtt_client-1] [ERROR] [16**08.7794***20] [mqtt_client]: Failed to create generic publisher: could not create publisher: failed to create topic [rt/test_topicmain] because it's already in use in this context with a different message type, at /home/host2/workspace/tracing_ws/src/ros2/rmw_cyclonedds/rmw_cyclonedds_cpp/src/rmw_node.cpp:1828, at /home/host2/workspace/tracing_ws/src/ros2/rcl/rcl/src/rcl/publisher.c:116
These two errors didn't appear at the same.
No, the ros2 version is even less designed for a change of the message type. To be honest, I don't see that big of a use case in changing the message type anyway. If your message type changes, you might just as well restart the mqtt_client
. What's your motivation for changing the message type during operation?
No practical motivation. I'm testing the performance of different rmw. It would be easier to be able to change the message type. Anyway, I finished my test by restarting the broker and mqtt_client
.
Steps to reproduce
roslaunch mqtt_client standalone.launch
rostopic pub -r 1 /ping/ros std_msgs/String "Hello"
rostopic echo /pong/ros
rostopic pub -r 1 /ping/ros std_msgs/Int32 1