ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Rvis filter point cloud

asked 2018-07-05 04:50:46 -0500

Fresh gravatar image

updated 2018-07-05 09:13:24 -0500

Edit1: I use a TI radar sensor with teh following rviz commands:

<!-- Static transform from map to base_radar_link for visualization of stand-alone mmWave sensor using Rviz -->
  <node pkg="tf" type="static_transform_publisher" name="static_tf_map_to_base_radar_link" args="0 0 0 0 0 0 map base_radar_link 100"/>

  <!-- Launch Rviz with pre-defined configuration to view mmWave sensor detected object data (color by intensity) -->
  <node pkg="rviz" type="rviz" name="rviz" args="-d $(find ti_mmwave_rospkg)/launch/radar_det_obj_color_by_intensity.rviz"/>

Now I tried to insert the following code but there was no effect. But I am not Sure where to add it (I tried to add it after the static transformation) and what i must insert in the remap line?!

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

  <!-- Run a passthrough filter to delimit in x direction -->
    <node pkg="nodelet" type="nodelet" name="psx" args="load pcl/PassThrough box_filter_pcl_manager" output="screen">
      <remap from="/mr/ti_radar/RScan" to="/mr/ti_radar/RScan" />
        filter_field_name: z
        filter_limit_min: -0.5
        filter_limit_max: 0.5

Hi I try to visualize the recorded data from a radar sensor. This works fine with rvis and pointcloud 2 but now i want to filter the values. All values over a value and under a value should not be shown in rviz. Is there an easy filter function in rvis directly to do that or to i need any kind of filter node between the rosbag and rviz? br Harald

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-10-03 12:54:47 -0500

sheldonr gravatar image

updated 2018-10-10 15:17:09 -0500


Nodelets are pre-compiled PCL programs that can be loaded into ROS without having to compile them with catkin. Their advantage is that they don't pass a 3D dataset from node to node, but only pass the pointers. It makes processing 3D data so much faster. Unfortunately, nodelets are poorly documented, and it took me a month to build a filter chain that could filter data and then load it into RVIZ. The data was collected from a Quanergy M8 sensor, which is a budget version of a Velodyne Ladar having only 8 beams. Like radar, ladar is inherently a 3D data set, so the data was captured into a PointCloud2 format and stored in a rosbag format. I could then run the rosbag utility in a continuous loop to simulate a real time data stream.

The filter you are searching for is called "CropBox", but I include some other filters as well.

The data was piped through four nodelet filters: cropping, cleaning, segmenting (identifying a wall), and removing the wall. RVIZ could visualize any of the filtering stages, and rqt_reconfigure permitted dynamic resetting of the parameters. Even so, initial settings of the parameters were often included on the command line or the nodelet wouldn't run. Some of the parameters were never documented--hence the long implementation time.

The batch file has been tested on ROS-indigo and ROS-kinetic. If other nodelet filters are desired, the command:

rosrun nodelet declared_nodelets

will print all the identified nodelets in your distro. Segmentation was tricky, and once again, not all the PCL models and methods are implemented. Often there's no alternative but to read the PCL source code and guess at the nodelet implementation.

Here's the contents of "filter.bash" batch file I ran using the command "> bash ./filter.bash"

gnome-terminal \

--tab-with-profile=Default -e "roscore" \

--tab-with-profile=Default -e "rosbag play -r 1 --loop bag.bag" \

--tab-with-profile=Default -e "rosrun rviz rviz -f Sensor -d ./default3.rviz" \

--tab-with-profile=Default -e "rosrun nodelet nodelet standalone pcl/CropBox /pcl_CropBox/input:=/Sensor/points _min_x:=-3.0 _max_x:=5.0 _min_y:=-3.0 _max_y:=5.0 _min_z:=-2.0 _max_z:=4.0 " \

--tab-with-profile=Default -e "rosrun nodelet nodelet standalone pcl/StatisticalOutlierRemoval /pcl_StatisticalOutlierRemoval/input:=/pcl_CropBox/output _stddev:=0.4 _mean_k:=20 " \

--tab-with-profile=Default -e "rosrun nodelet nodelet standalone pcl/SACSegmentation /pcl_SACSegmentation/input:=/pcl_StatisticalOutlierRemoval/output _model_type:=9 _distance_threshold:=0.05 _method_type:=0 _eps_angle:=0.15 _max_iterations:=500 _axis:=(0.0,1.0,0.0) " \

--tab-with-profile=Default -e "rosrun nodelet nodelet standalone pcl/ExtractIndices /pcl_ExtractIndices/indices:=/pcl_SACSegmentation/inliers /pcl_ExtractIndices/input:=/pcl_StatisticalOutlierRemoval/output _approximate_sync:=true _negative:=true " \

--tab-with-profile=Default -e "rosrun rqt_reconfigure rqt_reconfigure" \


edit flag offensive delete link more

answered 2018-07-05 06:14:24 -0500

You can use the nodelets provided by pcl_ros filters to do just this. You can set a range for any of the values in the point cloud position or meta data using the pass through filter.

edit flag offensive delete link more


I tried to insert a filter (as seen in the start messae) but there is no effect?!

Fresh gravatar image Fresh  ( 2018-07-05 09:37:52 -0500 )edit

Try just doing a simple rostopic list and see if your namespacing is correct for the parameters.

stevemacenski gravatar image stevemacenski  ( 2018-07-05 12:53:32 -0500 )edit

I tried the followin rostopic command and there are no messages shown!

rostopic echo /psx/output 
WARNING: no messages received and simulated time is active.
Is /clock being published?
Fresh gravatar image Fresh  ( 2018-07-06 01:49:53 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-07-05 04:50:46 -0500

Seen: 1,457 times

Last updated: Oct 10 '18