To pass messages between nodes they need to have the same topic name, the same topic type, and the nodes need to be connected to the same ROS master.
If you're running both nodes on the same computer, they're probably connected to the same ROS master. I wouldn't worry about this unless you're trying to run ROS across multiple machines.
In your code you should be able to see that you're using the same topic name and message type (although the message type syntax is slightly different in python and C++).
When both of your nodes are running, you can use rosnode info
with the node name to see which topics your node is actually publishing and subscribing, and if your nodes are connected you'll be able to see the connection between nodes.
You can also use rostopic list
to see the list of topics, and rostopic echo
to confirm that your publisher is actually publishing messages.
Not an answer, but: if by 'vector' you really mean a standard
xyz
triplet, please try to usegeometry_msgs/Vector3
as its semantics are much clearer.the vector is the coordinates of a manipulator and the position with the orientation of a mobile robot, and an instantaneous velocity of the wheels of the mobile system
Then I would suggest you use a combination of
Pose
andJointState
, or anOdometry
msg. The whole point of ROS is to use as much semantically correct messages as possible. A multi-array throws away any and all meaning the original data might have.I'm new in ROS, how could I combine Pose and JointState msg !!!!