I have no experience with using the ROS_NAMESPACE variable. In my opinion it is better to set the namespace inside the launch file. Which you might be doing as well, can't tell without seeing the launch files. If you do set them in the launch files and are using the ROS_NAMESPACE variable then I think your namspace may end up like /tb3_1/tb3_1/robot_state_publisher.
To resolve your issue you will have to trace down what is connected to what and what each node is actually expecting. rosnode list, rosnode info your_node, rostopic list, rostopic info your_topic, rosparam list, rosparam get your_param, rosrun rqt_tf_tree rqt_tf_tree
, etc are just a few of the commands that you should always be using to find out where the problem is, atleast to the point that other people can help when you ask a question. If you have two nodes that should be communicating run rosnode info on the nodes to see if they are subscribing/publishing to the correct topics.
Running multiple robots in different namespaces is a problem that has been solved many times, here is a very thorough answer on answers.ros for the same question. I would start there, or google for more examples.
Originally posted by Reamees with karma: 591 on 2018-07-18
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by AmateurHour on 2018-07-18:
Yes, I have the questions that have already been answered on the forum and they were of very little use to me because they are all modeling in a simulation environment. I am trying to run robots in a real environment and have no experience with using any kind of namespace, thus my question. Thanks.
Comment by Reamees on 2018-07-18:
You're welcome. Namespaces should work the same way in simulations as they do in the real world. Working with namespaces could be confusing at first, there are a lot of things that can and will go wrong. It is usually easier to debug the simulation than the actual thing.
Comment by Reamees on 2018-07-18:
I would also suggest reading through the name ros wiki page if you have yet not done so. Even if some of it might not make immediate sense, it will be good to have read it.