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

[Doc] Document the default for reset_angle in the Motor class doc #1917

Closed
BertLindeman opened this issue Nov 5, 2024 · 3 comments
Closed
Labels
documentation Improvements or additions to documentation

Comments

@BertLindeman
Copy link

BertLindeman commented Nov 5, 2024

Describe the issue
In #389 the argument reset_angle has been introduced.
The doc does not state whether True or False is used if the argument is not specified.

Suggested improvement
After

reset_angle ([bool](https://beta.pybricks.com/static/docs/v2.19.0/micropython/builtins.html#ubuiltins.bool)) 
– Choose True to reset the rotation sensor value to the absolute marker angle (between -180 and 179). 
Choose False to keep the current value, so your program knows where it left off last time.

add

If `reset_angle` is not specified, `False` is used.

Or better fitting text.

This came up in #1916

[EDIT] If I knew how / where I would have tried a PR.
[EDIT 2] Simple? in the doc Will try there.

@BertLindeman BertLindeman added documentation Improvements or additions to documentation triage Issues that have not been triaged yet labels Nov 5, 2024
@BertLindeman
Copy link
Author

BertLindeman commented Nov 5, 2024

I do no want to stir up too much for this.
Looking in pupdevices.py

Is the policy to document the defaults in the parameter list:
image

This would seem to me that the default for reset_angle would be True.

Tested with

from pybricks.pupdevices import Motor
from pybricks.parameters import Port
from pybricks import version

print(version)

motor = Motor(Port.A)
print("start at", motor.angle())

('technichub', '3.6.0b2', 'ci-build-3607-v3.6.0b2-19-g9e5ef68d on 2024-10-29')
start at -146
('technichub', '3.6.0b2', 'ci-build-3607-v3.6.0b2-19-g9e5ef68d on 2024-10-29')
start at -146

@BertLindeman
Copy link
Author

BertLindeman commented Nov 5, 2024

Re-reading shows me I do not understand this mechanism at all.

The difference between reset_angle=True scales the motor angle between -180 and 179,
reset_angle=False keeps the motor angle even if it is outside that range.

So closing this as stupid.

@BertLindeman
Copy link
Author

close as user error

@dlech dlech removed the triage Issues that have not been triaged yet label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants