ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

freenect /camera/depth/points topic not published under a group namespace tag.

asked 2019-03-21 02:23:51 -0500

TharushiDeSilva gravatar image

updated 2019-03-21 23:33:16 -0500

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 <include> and <group> 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 <group> 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.

edit retag flag offensive close merge delete

Comments

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

?

janindu gravatar image janindu  ( 2019-03-21 23:48:46 -0500 )edit
  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/1XYYn...

TharushiDeSilva gravatar image TharushiDeSilva  ( 2019-03-22 00:13:17 -0500 )edit

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

janindu gravatar image janindu  ( 2019-03-22 00:23:29 -0500 )edit

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.

TharushiDeSilva gravatar image TharushiDeSilva  ( 2019-03-22 00:57:22 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-03-22 06:28:56 -0500

TharushiDeSilva gravatar image

updated 2019-04-07 00:23:14 -0500

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);
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-03-21 02:23:51 -0500

Seen: 498 times

Last updated: Apr 07 '19