0
$\begingroup$

Rosanswers logo

Hi! I am currently running Octomap on my Qbot using ROS kinetic and Ubuntu 16.04. (My plan is to run ROS navigation stack using the built octomap and create a multi-robot system) Because of the multi-robot networking requirement I need to name my robots uniquely, and I tried doing this using both and tags. While my launch file works as expected without the namespace parameter, it does not give the expected result with the namespace. I generated rqt_graphs for my working and not working programs and figured out that /camera/depth/points topic is not published so that it can output into the octomap_server node.

This is my first launch file which works accurately.

    <launch>
        <!-- run kobuki base -->
        <include file="$(find kobuki_node)/launch/minimal.launch"/>

        <!-- tf config -->
        <include file="$(find multi_robot_exploration)/launch/tf_pub.launch" />

        <!-- run kinect -->
        <include file="$(find freenect_launch)/launch/freenect.launch"/>

        <!-- run octomap_server -->
        <include file="$(find octomap_server)/launch/octomap_mapping.launch"/>
</launch>

And here is the relevant rqt_graph (generated without running RViz) image description

This is my second launch file which I wrote by including the group tag and a namespace

     <launch>
    <group ns="qbot1">
        <!-- run kobuki base -->
        <include file="$(find kobuki_node)/launch/minimal.launch"/>

        <!-- tf config -->
        <include file="$(find multi_robot_exploration)/launch/tf_pub.launch" />

        <!-- run kinect -->
        <include file="$(find freenect_launch)/launch/freenect.launch"/>

        <!-- run octomap_server -->
        <include file="$(find octomap_server)/launch/octomap_mapping.launch"/>
    </group>
</launch>

And this is the relevant rqt_graph image description

It looks like the /camera/depth/points topic is not available in the second setting, and hence it cannot publish to octomap_server. But it is available when I launch the file without tag. Does anybody know what I am doing wrong here?

Note: I use the standard ROS packages for Octomap, kobuki_node, and freenect drivers. I have located all of them within my working directory and sourced them. I have tried adding namespace variable as different include tags also.


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

Post score: 1


Original comments

Comment by janindu on 2019-03-21:
Hi,

  1. Do you see any errors / warnings when you launch the qbot1 launch file?

  2. What is the output when you execute

    rosnode info /qbot1/camera/camera_nodelet_manager

?

Comment by TharushiDeSilva on 2019-03-22:\

  1. There are no additional warnings. (Same warnings as the first one - Could not find any compatible depth output mode for 1. Falling back to default depth output mode 1)

  2. In the info log I can see these relevant information

    Node [/qbot1/camera/camera_nodelet_manager] Publications:

    • /qbot1/camera/depth/points [sensor_msgs/PointCloud2]
    • /qbot1/camera/depth_registered/points [sensor_msgs/PointCloud2]

The full log is published here. https://drive.google.com/file/d/1XYYna5UhFS2BtggB_JWlfWVLuZR_NUr9/view?usp=sharing

Comment by janindu on 2019-03-22:
That means the nodelet has advertised the topic

/qbot1/camera/depth/points

The next two steps to debug are

  1. Check if the nodelet is actually publishing to /qbot1/camera/depth/points by executing 'rostopic echo /qbot1/camera/depth/points'
  2. If messages are published, then try rosnode info /qbot1/octomap_server to see if octomap server has subscribed to the proper topic

Comment by TharushiDeSilva on 2019-03-22:
The data stream is published into the topic /qbot1/camera/depth/points

The octomap_server seems to subscribe to the topic without the namespace.

 Node [/qbot1/octomap_server]
    Subscriptions: 
     * /camera/depth/points [unknown type]

Guess I have to look inside octomap_server node.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I figured out that qbot1/camera/depth/points topic is successfully published through freenect.launch launcher, but the octomap_server is subscribing to /camera/depth/points topic. The OctomapServer.cpp source code looks for the absolute namespace and it does not read the qbot1 prefix. According to the remapping that I am using, the code line 177 of OctomapServer.cpp is changed like this.

m_pointCloudSub = new message_filters::Subscriber<sensor_msgs::PointCloud2> (m_nh, "/camera/depth/points", 5);

Because of the / in front of the subscribed topic, it always looks for a topic that starts as /camera/depth/points.

This should be correctly used as;

 m_pointCloudSub = new message_filters::Subscriber<sensor_msgs::PointCloud2> (m_nh, "camera/depth/points", 5);

Originally posted by TharushiDeSilva with karma: 79 on 2019-03-22

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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