sphero-inc / sphero-sdk-raspberrypi-python

Sphero RVR SDK to run on Raspberry Pi using Python
Other
77 stars 50 forks source link

Argument order issue in drive_control_async.py #6

Closed crhobson closed 4 years ago

crhobson commented 4 years ago

asyncio.contols.drive_control_async.py

In the class DriveControlAsync the definition of the function _timeddrive is timed_drive(self, speed, heading, flags, time_to_drive)

However in both the _drive_backwardseconds & _drive_forwardseconds function when they call __timed_drive they use the argument order (heading, speed, flags, time_to_drive)

This results in the values of heading and speed being swapped, and unexpected behaviour of the robot.

peerdavid commented 4 years ago

I have seen something similar in the class DriveControlAsync function roll_stop which calls roll_start with heading and speed swapped. Therefore if this function is used with a heading != 0 the rvr drives with this speed straight ahead rather than stopping the robot...

acampos81 commented 4 years ago

@crhobson This issue has been addressed with the latest pull request. Thank you for bringing this to our attention!

@peerdavid we'll review DriveControlAsync to ensure consistency.