Filtering laser scan data - Remove NaN
Hi,
Does anyone know how to filter out /scan topic data to remove NaN?
Thanks!
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Hi,
Does anyone know how to filter out /scan topic data to remove NaN?
Thanks!
For my work, I ended up filtering the values offline, during data pre-processing after recording with rosbag.
If you are using python and numpy, this is as simple as scan[np.isnan(scan)] = max_range
.
For altering the values online, an option would be to use the InterpolationFilter of laser_filters.
Hi fandrade. It was a valid assumption for my problem. Due to the high density of the laser-scans compared to the size of the obstacles I was dealing with, if an object got closer to the robot than min_distance
it would be picked up by neighbouring readings of the scan anyway, thus not affecting my path planning algorithm. So it was safe to keep it simple and map the invalid reading to max_distance
. More robust solutions would be to use an interpolation filter, as I mentioned in my answer, or a "valid average", where you just replace the invalid readings with the average value of their neighbouring readings that are not-NaN (or should I say aN? :).
Hi vbs, I think you found a nice solution. I am still dealing with this problem because I am only using 5 laser beams as the input of a deep neural network, where I am doing reinforcement learning, so when beams come with NaN, I cant figure out a way to interpolate o set a min/max value.
Asked: 2015-03-22 15:31:51 -0600
Seen: 2,740 times
Last updated: Oct 22 '22
The significance of acceleration limits
Unable to detect obstacles in costmap [closed]
issue of ground filter in octomap_server
How to manually add messages to tf::MessageFilter?
Plotting Lidar Scan data in rviz
Compiler cant find transformLaserScanToPointCloud function
Unscented Kalman Filter - Bayes++ [closed]
How to configure tabletop detector's table_z_filter_min/max ? [closed]
I know it's an old topic, but did you find an answer to this?
Did anyone find an answer?
Remove NaN should not be difficult. Would you please share a sample message by executing
rostopic echo /scan
on terminal? Ideally, if you are on Python,NumPy
can be used.