From 9a4cb0ee59b9077f4631e3172316ec73c70dc304 Mon Sep 17 00:00:00 2001 From: Jatin Patil Date: Sat, 17 Aug 2024 16:07:09 +0530 Subject: [PATCH] min of max_distance or range_max Signed-off-by: Jatin Patil --- nav2_loopback_sim/nav2_loopback_sim/loopback_simulator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nav2_loopback_sim/nav2_loopback_sim/loopback_simulator.py b/nav2_loopback_sim/nav2_loopback_sim/loopback_simulator.py index c2c4290b68..d1e3982297 100644 --- a/nav2_loopback_sim/nav2_loopback_sim/loopback_simulator.py +++ b/nav2_loopback_sim/nav2_loopback_sim/loopback_simulator.py @@ -324,7 +324,7 @@ def getLaserScan(self, num_samples): # max_distance = math.sqrt( # (self.map.info.width * self.map.info.resolution) ** 2 + # (self.map.info.height * self.map.info.resolution) ** 2) - # max_distance = max(max_distance, self.scan_msg.range_max) + # max_distance = min(max_distance, self.scan_msg.range_max) # for i in range(num_samples): # curr_angle = theta + self.scan_msg.angle_min + i * self.scan_msg.angle_increment # x1 = float(x0) + max_distance * math.cos(curr_angle)