Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There are two things to know about this.

First, it is possible to have two different publishers to the same topic name with different types in ROS 2. In order to disambiguate them so you can publish them, you can do:

ros2 topic echo /initialpose geometry_msgs/msg/PoseWithCovarianceStamped


ros2 topic echo /initialpose std_msgs/msg/String

(but keep reading).

The second thing here is that in most situations, having two things publishing on the same topic name with different types is not what you want. As you see, it is hard to disambiguate them, and it is unclear what the meaning is. Usually this suggests that your ROS 2 network isn't setup properly; either a node is publishing to /initialpose that shouldn't be, or you should remap/namespace the topics.