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

Nodelet topic connection problem

asked 2015-06-03 10:19:39 -0500

F.Brosseau gravatar image

Hello everybody,

I have a little question for you. I am trying to use the navigation part of the rtabmap package but I am not able to connect topics to some nodelets.

<group ns="/stereo_camera" >

    <!-- Generate a point cloud from the disparity image -->
    <node pkg="nodelet" type="nodelet" name="disparity2cloud" args="load rtabmap_ros/point_cloud_xyz stereo_nodelet">
        <remap from="disparity/image"       to="$(arg camera)/disparity"/>
        <remap from="disparity/camera_info" to="$(arg camera)/right/camera_info"/>
        <remap from="cloud"                to="cloudXYZ"/>

        <param name="voxel_size" type="double" value="0.05"/>
        <param name="decimation" type="int" value="4"/>
        <param name="max_depth" type="double" value="10"/>
    </node>

    <!-- Create point cloud for the local planner -->
    <node pkg="nodelet" type="nodelet" name="obstacles_detection" args="load rtabmap_ros/obstacles_detection stereo_nodelet">
        <remap from="cloud" to="cloudXYZ"/>
        <remap from="obstacles" to="/planner/planner_cloud"/>

        <param name="frame_id" type="string" value="artemisBody"/>
        <param name="map_frame_id" type="string" value="map"/>
        <param name="min_cluster_size" type="int" value="20"/>
        <param name="max_obstacles_height" type="double" value="0.0"/>
    </node>
</group>

with camera=artemis/navCam

The disparity and the camera_info topic are publishing information and seem to work fine but the disparity2cloud nodelet don't suscribe to them. I don't understand why the remapping is not working.

(I guess that I have forgotten something but I really don't know what)

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-06-03 12:36:59 -0500

matlabbe gravatar image

updated 2015-06-03 12:42:59 -0500

Is stereo_nodelet exist? If not, you have two choices: you create a nodelet manager for the two nodelets or create them as standalone nodelets:

<node pkg="nodelet" type="nodelet" name="nodelet_manager"  args="manager"/>

<!-- Generate a point cloud from the disparity image -->
<node pkg="nodelet" type="nodelet" name="disparity2cloud" args="load rtabmap_ros/point_cloud_xyz nodelet_manager">
    <remap from="disparity/image"       to="$(arg camera)/disparity"/>
    <remap from="disparity/camera_info" to="$(arg camera)/right/camera_info"/>
    <remap from="cloud"                to="cloudXYZ"/>

    <param name="voxel_size" type="double" value="0.05"/>
    <param name="decimation" type="int" value="4"/>
    <param name="max_depth" type="double" value="10"/>
</node>

<!-- Create point cloud for the local planner -->
<node pkg="nodelet" type="nodelet" name="obstacles_detection" args="load rtabmap_ros/obstacles_detection nodelet_manager">
    <remap from="cloud" to="cloudXYZ"/>
    <remap from="obstacles" to="/planner/planner_cloud"/>

    <param name="frame_id" type="string" value="artemisBody"/>
    <param name="map_frame_id" type="string" value="map"/>
    <param name="min_cluster_size" type="int" value="20"/>
    <param name="max_obstacles_height" type="double" value="0.0"/>
</node>

or

<!-- Generate a point cloud from the disparity image -->
<node pkg="nodelet" type="nodelet" name="disparity2cloud" args="standalone rtabmap_ros/point_cloud_xyz">
    <remap from="disparity/image"       to="$(arg camera)/disparity"/>
    <remap from="disparity/camera_info" to="$(arg camera)/right/camera_info"/>
    <remap from="cloud"                to="cloudXYZ"/>

    <param name="voxel_size" type="double" value="0.05"/>
    <param name="decimation" type="int" value="4"/>
    <param name="max_depth" type="double" value="10"/>
</node>

<!-- Create point cloud for the local planner -->
<node pkg="nodelet" type="nodelet" name="obstacles_detection" args="standalone rtabmap_ros/obstacles_detection">
    <remap from="cloud" to="cloudXYZ"/>
    <remap from="obstacles" to="/planner/planner_cloud"/>

    <param name="frame_id" type="string" value="artemisBody"/>
    <param name="map_frame_id" type="string" value="map"/>
    <param name="min_cluster_size" type="int" value="20"/>
    <param name="max_obstacles_height" type="double" value="0.0"/>
</node>

Well, the first choice is preferred if cloudXYZ is used only by obstacles_detection nodelet (to keep transferred messages in memory).

EDIT Beware that the nodelets are in "/stereo_camera" namespace. If you want to remap disparity/image to artemis/navCam/disparity, make sure you set your argument "camera=/artemis/navCam" with leading slash. Otherwise, it may try to subscribe to "/stereo_camera/artemis/navCam/disparity".

edit flag offensive delete link more

Comments

Thanks for your help. I forgot to create the nodelet manager.

F.Brosseau gravatar image F.Brosseau  ( 2015-06-04 03:05:09 -0500 )edit

Question Tools

Stats

Asked: 2015-06-03 10:19:39 -0500

Seen: 809 times

Last updated: Jun 03 '15