Get_angle vs get_position PROS

I was looking at the PROS wiki for the Rotational Sensor, and I was wondering what the difference between the get_position and get_angle command in PROS.

I agree that isn’t super clear from the documentation.

https://pros.cs.purdue.edu/v5/api/cpp/rotation.html#get-position

I think the difference is get_position will be degrees traveled since turned on and get_angle will give the absolute angle with respect to some reference 0 point.

For example 3.5 rotations since you powered it on being 126000(36000 3.5) while the get_angle will get the absolute angle which will always being between 0 and 360000. If you started at the 0 angle get_angle would return 18000(360000.5) if you started at say 45 degrees it would be 13500 ((180-45)*100). If you then turned off the V5 and turned it back on the get_position would return 0 and get_angle would return the same 13500.

In the case of a robot arm you don’t want to know how many rotations it has done since it start you want to know the exact current angle. So you can say move to angle 90 degrees.
On a drive train you want to say move 5 rotations from current position.

1 Like

Will be fixed soon in an update tonight after I get off work. Tabor is right on this ^

1 Like