Skip to content

[Bug] reset_angle() without arguments during hold gives unexpected movement #352

Closed
@laurensvalk

Description

@laurensvalk

Describe the bug
When used without arguments, reset_angle() should reset the angle to the absolute marker.

But in some cases while holding, it jumps to zero.

To reproduce

from pybricks.pupdevices import Motor
from pybricks.parameters import Port
from pybricks.tools import wait

motor = Motor(Port.B)

motor.run_target(500, 90)
motor.reset_angle()
wait(1000)

Things do seem to work correctly when giving an angle argument or when using a different stop mode.

Expected behavior
With no arguments given, the angle should do this for positive angles:
motor.reset_angle(motor.angle() % 360)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsoftware: pybricks-micropythonIssues with Pybricks MicroPython firmware (or EV3 runtime)topic: motorsIssues involving motors

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions