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

Point cloud filtering "box"

asked 2019-03-06 06:05:01 -0500

S.Yildiz gravatar image

updated 2019-03-11 04:40:31 -0500

gvdhoorn gravatar image

I need to filter my point cloud and I found this link: https://answers.ros.org/question/1012...

I have created a launch file commented the x y nodelets. I want to filter the ground. I have a tof camera and I dont want to see the ground when I drive around. So my problem is when I start the camera and then the launch file for the point cloud I get this warning: "This node/nodelet subscribes topics only when subscribed." What does this mean? what do I have to change? In the z node, I have a remap from ~input to <my camera point cloud>

Thank you in advance


Edit: launch file:

<node pkg="nodelet" type="nodelet" name="pcl_manager" args="manager" output="screen" />

  <!-- Run a VoxelGrid filter to clean NaNs and downsample the data -->
  <node pkg="nodelet" type="nodelet" name="voxel_grid" args="load pcl/VoxelGrid pcl_manager" output="screen">
    <remap from="~input" to="/royale_camera_driver/point_cloud" />
    <rosparam>
      filter_field_name: z
      filter_limit_min: 0.01
      filter_limit_max: 1.5
      filter_limit_negative: False
      leaf_size: 0.01
    </rosparam>
  </node>

I have put this in the launch file. But I always get the warning that I didn't subscribe. But I already do the remapping

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-03-06 07:25:59 -0500

jgallostra gravatar image

The PCLNodelet class inherits from nodelet_topic_tools::NodeletLazy. You can check its header file here.

At startup, if the nodelet does not detect any subscriber to its publishers, it will in turn not subscribe to any topic. There is no need to process information if nobody is listening to the output. This is handled by a ros::WallTimer that calls the following function

   virtual void warnNeverSubscribedCallback(const ros::WallTimerEvent& event)
   {
     if (!ever_subscribed_)
     {
       NODELET_WARN("This node/nodelet subscribes topics only when subscribed.");
     }
  }

So if there is no subscribers to what the nodelet is advertising, then the nodelet will not subscribe to anything and won't do any information processing.

edit flag offensive delete link more

Comments

So do I have to replace in the remap -> <remap from="~input" to="/camera/depth/points"/> the ~input or the other one?

S.Yildiz gravatar image S.Yildiz  ( 2019-03-11 03:13:37 -0500 )edit

My message type is point cloud 2. Is this the reason why its not working?

S.Yildiz gravatar image S.Yildiz  ( 2019-03-11 03:30:43 -0500 )edit

Well maybe if you show what your code is it will be easier to spot the error...

jgallostra gravatar image jgallostra  ( 2019-03-11 04:02:39 -0500 )edit
2

Well, if the remapping is correct (I guess that you have launched a node which advertises the /royale_camera_driver/point_cloud topic), then the only thing left to do is launch a node that subscribes to the output of the VoxelGrid nodelet. You could also try to launch rviz and visualize the output from the nodelet. As I said in my answer, if the nodelet detects that it has no subscribers to its output topics, then it won't process anything; so try to use rviz for visualizing the output.

jgallostra gravatar image jgallostra  ( 2019-03-11 04:48:56 -0500 )edit

Thank you that worked

S.Yildiz gravatar image S.Yildiz  ( 2019-03-11 06:16:20 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-03-06 06:05:01 -0500

Seen: 908 times

Last updated: Mar 11 '19