Skip to content

Commit cf74366

Browse files
trbljumpCoolSpy3omichel
authored
Fix PositionSensor.getMotor() (#6825)
* Fix PositionSensor.getMotor() Was calling the wrong function to get the associated motor. * Update changelog-r2025.md * Add PR link --------- Co-authored-by: CoolSpy3 <[email protected]> Co-authored-by: Olivier Michel <[email protected]>
1 parent ec04f7e commit cf74366

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/reference/changelog-r2025.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- **Removed `libController.a` and `libCppController.a` libraries on Windows. Please use `Controller.lib` and `CppController.lib` instead ([#6753](https://github.com/cyberbotics/webots/pull/6753)).**
1111
- Bug Fixes
1212
- Fixed a bug preventing the `webots-controller` executable from running on arm-based mac devices ([#6806](https://github.com/cyberbotics/webots/pull/6806)).
13+
- Fixed a typo in the `controller.PositionSensor` Python class: the `motor` property code was calling the wrong method ([#6825](https://github.com/cyberbotics/webots/pull/6825)).
1314
- Fixed a bug causing Webots to crash when multiple sounds were used with a [Speaker](speaker.md) node ([#6843](https://github.com/cyberbotics/webots/pull/6843)).
1415
- Fixed a bug causing the "Reload/Reset" buttons in the controller recompilation popup to not work on Windows ([#6844](https://github.com/cyberbotics/webots/pull/6844)).
1516
- Fixed resolution of relative paths when converting protos to their base nodes ([#6856](https://github.com/cyberbotics/webots/pull/6856)).

lib/controller/python/controller/position_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def brake(self):
5151
@property
5252
def motor(self):
5353
from .motor import Motor
54-
tag = wb.wb_brake_get_motor(self._tag)
54+
tag = wb.wb_position_sensor_get_motor(self._tag)
5555
return None if tag == 0 else Motor(tag)
5656

5757
@property

0 commit comments

Comments
 (0)