Skip to content

Commit

Permalink
Added type
Browse files Browse the repository at this point in the history
  • Loading branch information
jeguzzi committed Apr 8, 2024
1 parent 86ad8e0 commit f58fd24
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions navground_sim/src/state_estimations/sensor_boundary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ void BoundarySensor::update(Agent *agent, World *world,
const auto p = agent->pose.position;
size_t i = 0;
if (std::isfinite(_min_x)) {
distances[i++] = std::clamp(p[0] - _min_x, 0.0, _range);
distances[i++] = std::clamp<ng_float_t>(p[0] - _min_x, 0, _range);
}
if (std::isfinite(_max_x)) {
distances[i++] = std::clamp(_max_x - p[0], 0.0, _range);
distances[i++] = std::clamp<ng_float_t>(_max_x - p[0], 0, _range);
}
if (std::isfinite(_min_y)) {
distances[i++] = std::clamp(p[1] - _min_y, 0.0, _range);
distances[i++] = std::clamp<ng_float_t>(p[1] - _min_y, 0, _range);
}
if (std::isfinite(_max_y)) {
distances[i++] = std::clamp(_max_y - p[1], 0.0, _range);
distances[i++] = std::clamp<ng_float_t>(_max_y - p[1], 0, _range);
}
auto buffer = _state->get_buffer("boundary_distance");
if (!buffer) {
Expand Down

0 comments on commit f58fd24

Please sign in to comment.