Skip to content

Commit 3680acb

Browse files
mergify[bot]hidmic
andauthoredNov 3, 2023
Handle NaNs in AMCL beam sensor model (ros-navigation#3929) (ros-navigation#3937)
* Handle NaNs in AMCL beam sensor model Signed-off-by: Michel Hidalgo <[email protected]> * Use proper isnan check Signed-off-by: Michel Hidalgo <[email protected]> --------- Signed-off-by: Michel Hidalgo <[email protected]> (cherry picked from commit 06c3550) Co-authored-by: Michel Hidalgo <[email protected]>
1 parent 95b2322 commit 3680acb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎nav2_amcl/src/sensors/laser/beam_model.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ BeamModel::sensorFunction(LaserData * data, pf_sample_set_t * set)
7272
step = (data->range_count - 1) / (self->max_beams_ - 1);
7373
for (i = 0; i < data->range_count; i += step) {
7474
obs_range = data->ranges[i][0];
75+
76+
// Check for NaN
77+
if (isnan(obs_range)) {
78+
continue;
79+
}
80+
7581
obs_bearing = data->ranges[i][1];
7682

7783
// Compute the range according to the map

0 commit comments

Comments
 (0)
Please sign in to comment.