Skip to content

Commit

Permalink
Fixed bug radar.py (#6606)
Browse files Browse the repository at this point in the history
* 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

* 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

---------

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
  • Loading branch information
lonely-poppy and omichel committed Aug 2, 2024
1 parent 02900c7 commit 1200531
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/reference/changelog-r2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
2 changes: 1 addition & 1 deletion lib/controller/python/controller/radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1200531

Please sign in to comment.