Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Don't reset drivebase when calling use_gyro(True) successively #1858

Closed
laurensvalk opened this issue Oct 1, 2024 · 0 comments
Closed
Labels
software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: control Issues involving control system algorithms

Comments

@laurensvalk
Copy link
Member

Is your feature request related to a problem? Please describe.
User @familynygood recently asked about an accuracy issue in their program, which contains functions such as:

def function_name(self, ...., useGyro=True, then=Stop.HOLD, ...):
        self.drive_base.use_gyro(useGyro)
        self.drive_base.curve(....)

Even though Stop.HOLD is used here as recommended, errors still accumulate.

This is because use_gyro will reset the drive controllers. This was intentional, since the gyro and rotation sensors can report different values.

Describe the solution you'd like
Calling use_gyro(True) and then use_gyro(True) again isn't really intended to be used that way, but I can see why this is commonly used. So we can change the firmware such that we don't call that reset, and therefore preserve accuracy.

Describe alternatives you've considered
As a work around for now, you could use a boolean variable to call use_gyro only when it needs changing.

@laurensvalk laurensvalk added topic: control Issues involving control system algorithms software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: control Issues involving control system algorithms
Projects
None yet
Development

No branches or pull requests

1 participant