From 318a84c25c5dcf10109510d13f16d8c1ffe47a4d Mon Sep 17 00:00:00 2001 From: lonely-poppy <77427326+lonely-poppy@users.noreply.github.com> Date: Thu, 1 Aug 2024 17:32:46 +0800 Subject: [PATCH 1/2] fix bug radar.py Fixed the bug that when using Python to write a controller, using getTargets() could not correctly obtain multiple target data detected by radar --- lib/controller/python/controller/radar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/controller/python/controller/radar.py b/lib/controller/python/controller/radar.py index 68d83e49f29..6a27c656235 100644 --- a/lib/controller/python/controller/radar.py +++ b/lib/controller/python/controller/radar.py @@ -51,7 +51,7 @@ def getTargets(self) -> List[RadarTarget]: data = wb.wb_radar_get_targets(self._tag) list = [] for i in range(number_of_targets): - list.append(RadarTarget(data[0], data[1], data[2], data[3])) + list.append(RadarTarget(data[0 + 4*i], data[1 + 4*i], data[2 + 4*i], data[3 + 4*i])) return list @property From 9714e40288ab8d6d31622b9b9b78cc4f2a0f276e Mon Sep 17 00:00:00 2001 From: lonely-poppy <77427326+lonely-poppy@users.noreply.github.com> Date: Thu, 1 Aug 2024 18:43:05 +0800 Subject: [PATCH 2/2] Fixed the bug in obtaining radar detection target information#6606 Fixed the bug that when using Python to write a controller, using getTargets() could not correctly obtain multiple target data detected by radar --- docs/reference/changelog-r2024.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/reference/changelog-r2024.md b/docs/reference/changelog-r2024.md index de3c204627d..2567e763664 100644 --- a/docs/reference/changelog-r2024.md +++ b/docs/reference/changelog-r2024.md @@ -17,3 +17,4 @@ Released on December **th, 2023. - Fixed crashes (with some graphics cards) caused by references to unused GLSL uniforms ([#6587](https://github.com/cyberbotics/webots/pull/6587)). - Fixed `Brake`s added to the second axis of a `Hinge2Joint` being applied to the non-transformed axis ([#6584](https://github.com/cyberbotics/webots/pull/6584)). - Fixed invalid absolute sound file path resulted in crash ([#6593](https://github.com/cyberbotics/webots/pull/6593)) + - Fixed the bug that when the language is Python, getTargets() cannot correctly obtain the multi-target data detected by the radar ([#6606](https://github.com/cyberbotics/webots/pull/6606))