Skip to content

wait_until_angle_changed_by(delta) is not direction-sensitive #534

Closed

Description

@ndward

4.14.61-ev3dev-2.2.2-ev3
ii python3-ev3dev 1.2.0 all Python language bindings for ev3d
ii python3-ev3dev 2.0.0~beta2 all Python language bindings for ev3d

https://python-ev3dev.readthedocs.io/en/ev3dev-stretch/sensors.html#ev3dev2.sensor.lego.GyroSensor.wait_until_angle_changed_by

wait_until_angle_changed_by(delta): Wait until angle has changed by specified amount.

It's not clear from the above description whether this is direction-sensitive. For example, if I have delta = +90° (clockwise rotation) and the sensor is turned 100° counterclockwise, does that mean the angle has changed by delta?

My tests make me think that the direction does NOT matter, but quite often users will be looking for a turn in a specific direction, so I'm surprised the function cannot handle that. Maybe the function can be made direction-sensitive?

Activity

  1. dwalton76 commented on Oct 26, 2018

    @dwalton76
    Collaborator

    The code is using the abs() of the delta so the direction does not matter.

  2. WasabiFan commented on Oct 27, 2018

    @WasabiFan
    Member

    @dwalton76 I think Nigel is suggesting that it would be useful to make it direction-sensitive. It seems reasonable to me that we could add an argument which skipped the abs call to enable that scenario.

  3. self-assigned this
    on Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions