Ask Your Question

How to filter ranges of a portion of a laser scan

asked 2018-10-24 09:26:26 -0600

humanoid3 gravatar image


I am currently using a rplidar A1 360 degree laser scan.

I am trying to use the laser_filters package to filter my laser scan. Basically, I want to remove all the points behind the lidar that intersect with the robot (wires, motor controllers, etc). However, I want to keep any laser scan point behind the lidar that does not intersect with the robot.

I could use the range filter, and apply it to filter out data within the diameter of the robot, but I will lose valuable information in front of the lidar. I was wondering if there are any laser filters that combine range and angle filters in the way I described.

edit retag flag offensive close merge delete


Is your lidar at the center of the robot ? @harshal answer is a possibility, another workaround is to use a for loop in your scan callback to remove the ranges you don't want given the index (ie. the angle).

Delb gravatar imageDelb ( 2018-10-24 12:04:43 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-10-24 10:48:04 -0600

harshal gravatar image

updated 2018-11-12 03:39:50 -0600

One fast solution could be to use range filter onto a topic, and angle filter onto another topic, and then go on to combine the data from the 2 topics (using ira_laser_tools, for example) onto the desired topic.

Edit1: To clarify, range filter would give 360 data beyond robot radius(circumscribed), even if not centered on the robot. So , say, /scanrange has 360 degree data beyond 0.1m from the scanner. Angle filter would remove the region from behind the robot. So, /scanangle has 270 degree data (excludes the wires, motor controllers, etc.) but from 0m of the scanner. The scan merger would essentially create a union of the 2 scans, hopefully leaving you with desired data.

edit flag offensive delete link more

answered 2018-11-09 09:09:49 -0600

jsampson gravatar image

You could use two laser scan filters in series. The first one could filter angle and the second could filter range. (Or swap the order to get the effect you want.)

edit flag offensive delete link more

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-10-24 09:26:26 -0600

Seen: 541 times

Last updated: Nov 12 '18