0
$\begingroup$

Rosanswers logo

Hi! I am trying to develop a multi-robot system using Qbots. For that I need to assign different namespaces to each robot in the network. (As Qbot1, Qbot2 etc.) As my previous question, and the answers I got, I wrote a single launch file and tried to push all of my topics under a given namespace. For this process, I used "ns" variable in include tag. Although there was a lot of issues in the results, I decided to make this question simpler by providing a small code, which I think includes the root of those problems.

This is a very simple launch file which can launch a kobuki core and then operate it manually by executing keyop program.

Here is my first launch file without including the namespace.

 <launch>
    <!-- Run the Kobuki base -->
    <include file="$(find kobuki_node)/launch/minimal.launch"/>

    <!-- Run the Keyop controller -->
    <include file="$(find kobuki_keyop)/launch/keyop.launch"/>
    </launch>

This is the rqt_graph I obtained by running the above program.

image description

This is the second launch file I wrote by including the namespace variable.

    <launch>
    <!-- Run the Kobuki base -->
    <include ns="qbot1" file="$(find kobuki_node)/launch/minimal.launch"/>

    <!-- Run the Keyop controller -->
    <include ns="qbot1" file="$(find kobuki_keyop)/launch/keyop.launch"/>
    </launch>

And this is the relevant rqt graph

image description

Although both of the launch files work without a problem, I can see that there are differences in two rqt graphs. Instead of a single mobile_base_nodelet_manager topic (when there is no namespace), the second rqt_graph displays a node and a topic under the name of mobile_base_nodelet_manager. Due to this reason, the more advanced launch files in my program does not work properly.

Can anyone explain me what is wrong with the second launch file, and how can I make it work like the first one. (I already tried writing a single namespace for the whole launch file, and also the group tag)

I use ROS Kinetic version on Ubuntu 16.04.


Originally posted by TharushiDeSilva on ROS Answers with karma: 79 on 2019-03-19

Post score: 0


Original comments

Comment by gvdhoorn on 2019-03-19:
Please attach your imaged directly to your question instead of linking to your google drive. I've given you sufficient karma for that.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There are no differences between the two rqt graphs, except for the namespace. If you look at the first graph, you can see 4 nodes

  1. /keyop
  2. /mobile_base
  3. /mobile_base_nodelet_manager
  4. /diagnostic_aggregator

and 4 topics

  1. /mobile_base_nodelet_manager/bond
  2. /mobile_base/commands/velocity
  3. /mobile_base/commands/motor_power
  4. /diagnostics

If you look at the second graph, you can see the corresponding topics and nodes with the prefix qbot1 and that all nodes are subscribed to / publishing to correct topics.

I think your confusion is about the namespace box. In rqt graphs, the topics and nodes are grouped by the top level namespace in boxes. For an instance, in the first rqt graph, /mobile_base_nodelet_manager/bond topic is inside the box /mobile_base_nodelet_manager because it's the top level namespace. Similarly, topics /mobile_base/commands/velocity and /mobile_base/commands/motor_power are inside the box /mobile_base.

Since you add a top level namespace /qbot1, everything with /qbot1 as the top level namespace, (that is, everything except /diagnostics topic) is within the qbot1 box. In the second rqt graph, you can see the bottom of the box but top and sides are cropped out. The rqt_graph wiki page has an example image which would make it clearer to you.

The bottom line is, given your launch files, the rqt_graphs you are getting are correct. Personally, I prefer the <group> tag if more than one launch file is included in the namespace group.

If your more complex launch files are not working, can you please edit the question or post it as a new question with the actual problem you are running into?


Originally posted by janindu with karma: 849 on 2019-03-21

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by TharushiDeSilva on 2019-03-21:
@janindu. Thank you so much for the explanation. I have posted my advanced issue as a new question in here.

Comment by janindu on 2019-03-21:
I can't see the question anymore. Hope you have solved it!

Comment by TharushiDeSilva on 2019-03-21:
Sorry about that. I sort of figured out the node which is creating the problem, and I had temporarily deleted the question until I could edit it. It is available now. I'm so thankful if you can take a look at it.
https://answers.ros.org/question/319040/freenect-cameradepthpoints-topic-not-published-under-a-group-namespace-tag/

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.