Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mqtt_client doesn't react correctly to a changed ROS message type #15

Open
lreiher opened this issue Mar 14, 2023 · 3 comments
Open

mqtt_client doesn't react correctly to a changed ROS message type #15

lreiher opened this issue Mar 14, 2023 · 3 comments

Comments

@lreiher
Copy link
Member

lreiher commented Mar 14, 2023

Steps to reproduce

  • roslaunch mqtt_client standalone.launch
  • rostopic pub -r 1 /ping/ros std_msgs/String "Hello"
  • rostopic echo /pong/ros
  • kill publisher
  • rostopic pub -r 1 /ping/ros std_msgs/Int32 1
@JiaqiangZhang
Copy link

JiaqiangZhang commented May 3, 2023

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.

@lreiher
Copy link
Member Author

lreiher commented May 4, 2023

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?

@JiaqiangZhang
Copy link

JiaqiangZhang commented May 4, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants