Should spawn_model set namespace to rospy.get_namespace() by default?
I've been working with multi-robot scenarios using gazebo. I use nested (included) launch files to launch individual robots, and I want each robot to be in its own namespace. Unfortunately, using <group> tags isn't enough to accomplish this. In order for relevant gazebo topics to appear in the appropriate namespace, I have to pass the "-namespace" argument to spawn_model. Without this everything always ends up in the "/" namespace (despite the fact that the namespace member in the spawn_model utility is initialised to "").
The problem is that using the "-namespace" argument in this case is inconvenient, since a launch file which simply launches a robot shouldn't need to know in which namespace it resides. For complex scenarios, which use nested launch files and namespaces, this is extremely problematic.
Currently I address this by passing in a parameter to the launch file, which contains the desired namespace. This works, but in a chain of included launch files, this parameter will have to be passed around and modified several times, which is still problematic.
One option would be to allow launch files to know in which namespace they reside (e.g. $(arg roslaunch_namespace)). This would probably be useful in general. But this seems to be going around the real problem, which in this case is with spawn_model, in particular.
My suggestion is that spawn_model initialise its namespace member to "rospy.get_namespace()" instead of "". This works great for me, and I assume most people would agree with the resulting behaviour. Spawned models live in the same namespace as the spawn_model executable.
However, since I'm relatively new to ROS, I thought I'd ask if anyone sees any problem with this before I create a ticket.