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

move() actual coordinates is wrong #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 14, 2024

  1. Configuration menu
    Copy the full SHA
    7d3b5f0 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2024

  1. move() contained one mistake and one error:

    - By doing relative move() step after step, trigonometric computation would accumulate floating-point inaccuracies along the loop
    - x/centerx were conflated leading to move() being rect.width/2 inferior to the expectation (same for y/centery)
    - This was encounterd (and can be reproduced) using:
    ```
    robot.penDown()
    robot.rotate(45)
    robot.move(DISTANCE)
    robot.rotate(-90)
    robot.move(DISTANCE)
    robot.rotate(-135)
    robot.move(DISTANCE * math.sqrt(2))
    ```
    
    Expected: The robot is back exactly its starting point.
    Actual: It's not because both move(DISTANCE) were actually less than DISTANCE.
    drzraf committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    fb75126 View commit details
    Browse the repository at this point in the history