From f58fd24c042a8bbd960bff3fda7fef92f8288ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Guzzi?= Date: Mon, 8 Apr 2024 20:40:06 +0200 Subject: [PATCH] Added type --- navground_sim/src/state_estimations/sensor_boundary.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/navground_sim/src/state_estimations/sensor_boundary.cpp b/navground_sim/src/state_estimations/sensor_boundary.cpp index 05e1b56b..fbb8bad2 100644 --- a/navground_sim/src/state_estimations/sensor_boundary.cpp +++ b/navground_sim/src/state_estimations/sensor_boundary.cpp @@ -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(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(_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(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(_max_y - p[1], 0, _range); } auto buffer = _state->get_buffer("boundary_distance"); if (!buffer) {