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] Raise runtime errors for likely misconfigured builds #1564

Closed
laurensvalk opened this issue Mar 24, 2024 · 1 comment
Closed

[Feature] Raise runtime errors for likely misconfigured builds #1564

laurensvalk opened this issue Mar 24, 2024 · 1 comment
Labels
enhancement New feature or request software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime)

Comments

@laurensvalk
Copy link
Member

Is your feature request related to a problem? Please describe.
Quite often, we get reports about things not working, when it is an issue of plugging motors in the wrong port or with the wrong direction.

In particular, we get these two quite often:

  • When the left and right motor are swapped or reversed by mistake, a drivebase appears to work normally when using the rotation sensors, but it will run in circles indefinitely in gyro mode because this creates a positive feedback loop.
  • When people try the car code before they build the car, the steering motor will turn forever because there aren't any end stops. This will give apparent issues like "the remote doesn't connect" when this isn't the cause.

Describe the solution you'd like
When a steering motor spins unreasonably far, raise a RuntimeError saying something like "No steering mechanism on Port A."

When a gyro drivebase spins out of control, say something like "Check the left and right motor configuration".

@laurensvalk laurensvalk added enhancement New feature or request software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) labels Mar 24, 2024
@laurensvalk
Copy link
Member Author

The runtime error for the car can conveniently be done in the class setup.

For the gyro drivebase, the issue will only occur when starting to move. I'd rather not risk raising unexpected runtime errors, so maybe we shouldn't try to capture this for the drivebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime)
Projects
None yet
Development

No branches or pull requests

1 participant