Point cloud filtering "box"
I need to filter my point cloud and I found this link: https://answers.ros.org/question/10121/point-cloud-box-filtering/
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
Asked by S.Yildiz on 2019-03-06 07:05:01 UTC
Answers
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.
Asked by jgallostra on 2019-03-06 08:25:59 UTC
Comments
So do I have to replace in the remap ->
Asked by S.Yildiz on 2019-03-11 03:13:37 UTC
My message type is point cloud 2. Is this the reason why its not working?
Asked by S.Yildiz on 2019-03-11 03:30:43 UTC
Well maybe if you show what your code is it will be easier to spot the error...
Asked by jgallostra on 2019-03-11 04:02:39 UTC
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.
Asked by jgallostra on 2019-03-11 04:48:56 UTC
Thank you that worked
Asked by S.Yildiz on 2019-03-11 06:16:20 UTC
Comments