DexterInd / GoPiGo3

The GoPiGo3 is a Raspberry Pi Robot!
https://gopigo.io
Other
96 stars 85 forks source link

EasyGoPiGo3.steer() uses no_limit_speed, says uses current speed #277

Closed slowrunner closed 2 years ago

slowrunner commented 4 years ago

The self doc on the EasyGoPiGo3.steer() method states:

        Each motor is assigned a percentage of the current speed value. 
..
        :param int left_percent: Percentage of current speed value that gets applied to left motor. 
..
        :param int right_percent: Percentage of current speed value that gets applied to right motor. 
..
        For setting the motor speed, use :py:meth:`~easygopigo3.EasyGoPiGo3.set_speed`.
        Default ``speed`` is set to **300** - see :py:meth:`~easygopigo3.EasyGoPiGo3.__init__`.
        .. important::

but coded as (and nearly impossible to use):

        self.set_motor_dps(self.MOTOR_LEFT, self.NO_LIMIT_SPEED * left_percent / 100)
        self.set_motor_dps(self.MOTOR_RIGHT, self.NO_LIMIT_SPEED * right_percent / 100)
slowrunner commented 3 years ago

Added pull request: https://github.com/DexterInd/GoPiGo3/pull/289

CleoQc commented 2 years ago

A preference to use get_speed() instead of accessing speed directly means this PR https://github.com/DexterInd/GoPiGo3/pull/303 got merged instead of https://github.com/DexterInd/GoPiGo3/pull/289 In essence it's the exact same fix, and thank you for your contribution.