0
$\begingroup$

Rosanswers logo

Hi, I am using the nodelet obstacle_detection from rtabmap to output a pointcloud that contains the obstacles to avoid.

I launch the obstacles_detection nodelet using:

   <launch>

   <node pkg="nodelet" type="nodelet" name="obstacles_detection" args="load rtabmap_ros/obstacles_detection stereo_nodelet">
      <remap from="cloud" to="/obstacles_cloud"/>
      <remap from="obstacles" to="/pointCloud_obstacles"/>
      <param name="frame_id" type="string" value="base_link"/>
      <param name="map_frame_id" type="string" value="map"/>
      <param name="min_cluster_size" type="int" value="5"/>
      <param name="cluster_radius"       type="double" value="0.1"/>
      <param name="max_obstacles_height" type="double" value="0.5"/>
      
   </node>

   </launch>

The problem is that the node doesn't subscribe to the obstacles_cloud topic and don't publish the pointCloud_obstacle topic.

The obstacle_detection node launches without errors, moreover the obstacles_cloud topic is correctly published from the pointcloud_xyz node.

To launch the pointcloud_xyz node I use:

   <node pkg="nodelet" type="nodelet" name="points_xyz" args="standalone rtabmap_ros/point_cloud_xyz">
   <remap from="depth/image"         to="/zed2/depth/depth_registered"/>
   <remap from="depth/camera_info"   to="/zed2/depth/camera_info"/>
   <remap from="cloud"               to="/obstacles_cloud" />
   <param name="decimation"  type="double" value="4"/>
   <param name="voxel_size"  type="double" value="0.05"/>
   <param name="approx_sync" type="bool" value="false"/>
</node>

I checked the behaviour of the node points_xyz using rostopic echo /obstacles_cloud and the node works correctly, it sends the correct type of messages (Sensor_msgs/Pointcloud2) on the correct topic at a rate of about 11Hz and they are not empty.

The output I get using rosnode info /obstacles_detection is

Node [/obstacles_detection]
Publications: 
 * /rosout [rosgraph_msgs/Log]

Subscriptions: 
 * /clock [rosgraph_msgs/Clock]

Services: 
 * /obstacles_detection/get_loggers
 * /obstacles_detection/set_logger_level


contacting node http://alessio-pc:36503/ ...
Pid: 22655
Connections:
 * topic: /rosout
    * to: /rosout
    * direction: outbound (47561 - 127.0.0.1:36618) [12]
    * transport: TCPROS
 * topic: /clock
    * to: /gazebo (http://alessio-pc:34549/)
    * direction: inbound (45134 - alessio-pc:44717) [13]
    * transport: TCPROS

And this confirms that the node is not subscribed to any topic.


Originally posted by AlessioParmeggiani on ROS Answers with karma: 165 on 2022-01-29

Post score: 2


Original comments

Comment by matlabbe on 2022-01-29:
You are loading the first nodelet in nodelets manager stereo_nodelet, does it exist? Otherwise, try launching like the second nodelet as a standalone.

Comment by AlessioParmeggiani on 2022-01-30:
Hi @matlabbe, thank you for answering!

I think it should exist because I am following the official tutorial proposed in the documentation of Rtabmap and it uses the same code: http://wiki.ros.org/rtabmap_ros/Tutorials/StereoOutdoorNavigation#Local_costmap.

I'll check that nodelet then, thank you for your suggestion!

Comment by matlabbe on 2022-01-30:
I updated the example in the wiki with the nodelet manager, as seen in the referred launch file here https://github.com/introlab/rtabmap_ros/blob/62b1058218ebdaa41a8c17b27eeccf7cf2d5e0ae/launch/azimut3/az3_mapping_robot_stereo_nav.launch#L69

Comment by AlessioParmeggiani on 2022-01-31:
Thank you! I added to the launch file:

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

Now I am able to launch the node and it correctly subscribe to the topics :)

But I ecnountered another problem, I get a new error from the obstacles_detection nodelet:

Lookup would require extrapolation -0.120000000s into the future.  Requested time 1027.127000000 but the latest data is at time 1027.007000000, when looking up transform from frame [base_link] to frame [map]

I'll look into that. EDIT: Question with solution to this new problem

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The problem has been solved by adding to the launch file:

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

as suggested by user matlabbe above. See comments to question for more details


Originally posted by AlessioParmeggiani with karma: 165 on 2022-02-08

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.