Skip to content

Commit

Permalink
separate range check
Browse files Browse the repository at this point in the history
  • Loading branch information
PetervDooren authored and MatthijsBurgh committed Apr 13, 2022
1 parent 6a9af31 commit 7b82885
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ed_sensor_integration/src/kinect/fitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,9 @@ void Fitter::checkExpectedBeamThroughEntity(const std::vector<double>& model_ran
expected_ranges = model_ranges;
std::vector<int> expected_identifiers(nr_data_points_, 0);
renderEntity(entity, sensor_pose_xya, 1, expected_ranges, expected_identifiers);

if (expected_center_beam < 0 || expected_center_beam >= nr_data_points_ || expected_identifiers[expected_center_beam] != 1) // expected center beam MUST contain the rendered model
if (expected_center_beam < 0 || expected_center_beam >= nr_data_points_)
throw FitterError("Expected beam outside of measurement range(" + std::to_string(nr_data_points_) + "), index: " + std::to_string(expected_center_beam));
if (expected_identifiers[expected_center_beam] != 1) // expected center beam MUST contain the rendered model
throw FitterError("Expected beam does not go through entity");
}

Expand Down

0 comments on commit 7b82885

Please sign in to comment.