-
Notifications
You must be signed in to change notification settings - Fork 60
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
Clarify Rotation Sensor Angle/Position Docs #341
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,7 +149,9 @@ Analogous to `pros::Rotation::reset_position <../cpp/rotation.html#reset-positio | |
rotation_get_position | ||
--------------------- | ||
|
||
Get the Rotation Sensor's current position in centidegrees | ||
Get the Rotation Sensor's current angle in centidegrees (0-36000). This means the absolute position | ||
of the sensor in relation to its position when initialized or reset. The value will continue to increment or decrement | ||
as the sensor rotates past 36000 centidegrees. | ||
|
||
This function uses the following values of ``errno`` when an error state is reached: | ||
|
||
|
@@ -234,7 +236,9 @@ Analogous to `pros::Rotation::get_velocity <../cpp/rotation.html#get-velocity>`_ | |
rotation_get_angle | ||
------------------ | ||
|
||
Get the Rotation Sensor's current angle in centidegrees (0-36000) | ||
Get the Rotation Sensor's current position in centidegrees. This means the absolute position | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar request for a tweak to the wording:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it last reset or is it some global 0 angle on the sensor? Not sure how reset survives restarts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it survives restarts I'd say that explicitly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also I think Jonathan's "rotates past +-36000" is not accurate. As much as I would love it to be a zero centered range I think it's (0,36000). A bit wordy but hopefully more explicit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the reason why this is a little tricky to deal with wording is because since the rotation sensor is a Hall effect sensor, angle is maintained between resets. Position's initial value after reset is set to angle as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahhh so it's technically distance from reset but not for the reason you might think. My opinion is if the 2 "modes" are so confusing to need a paragraph to explain it properly take a paragraph. This is the source for someone to try to understand what the hell it does. I wouldn't have guessed get_position reset to get_angle instead of 0. Now that you say that I can think why, get_position is likely defined as get_angle + full_rotations * 36000,with reset only wiping full rotations, but that wasn't my educated guess. |
||
of the sensor in relation to its position when initialized or reset. The value is continuous, | ||
meaning it will wrap around to zero after it passes 36000 centidegrees. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unclear about the exact behavior around 3600/0. It implies that the value can be both 0 and 3600 at different times, even though they are the exact same angle. Is this actually the case? If so, should we consider cutting off one of those values so that the range is instead [0, 3600), not [0, 3600]? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or, given that this is an integer value, express the range as [0, 3599] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I remember it being correct as [0,36000) on the Kernel doxygen docs, but ig I messed up here. Will fix! |
||
|
||
This function uses the following values of ``errno`` when an error state is reached: | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As someone who has not worked with this sensor before, the following strikes me as a bit of a clearer wording of the same concept:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The current wording implies that the value will roll over, when this is not actually the case.