ros-perception / laser_filters

Assorted filters designed to operate on 2D planar laser scanners, which use the sensor_msgs/LaserScan type.
BSD 3-Clause "New" or "Revised" License
164 stars 200 forks source link

Replace the invalid value of scans for the footprint_filter by NaN #47

Closed alain-m closed 8 years ago

alain-m commented 8 years ago

The invalid value for scans in the footprint_filter is max_range+1 while the other filters (range_filter, scan_shadows, intensity) use NaN. REP 117 states : "This REP proposes that these values be represented by -Inf, NaN, and +Inf respectively and as defined within floating point standards."

stwirth commented 8 years ago

+1. Intuitively max_range+1 would mean the laser measures something far away but it does not exactly know how far as it is more than the maximum range. That does not make sense for a footprint filter.

jonbinney commented 8 years ago

Sounds right to me. My only worry is that if someone currently has code that says if (range[i] > max_range) { discard it } else { do something } they may have NaN values sneaking into their program after this PR. I'm inclined to merge it anyway but I'll wait a couple days to see if anyone has any objections. @chadrockey what do you think?

jonbinney commented 8 years ago

Need a couple more opinions about whether this is too big a change to release into indigo. @haidai @kaijenhsiao

KaijenHsiao commented 8 years ago

I would be a bit worried about existing robots expecting non-NaN values. But if the other filters use NaN already, that makes it seem less likely to me that it would ruin someone's day. I vote merge it.

jonbinney commented 8 years ago

Alright, I'm going to go ahead and merge. Thanks @alain-m !