File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ class IntakeComponent:
2121
2222 # Offset is measured in the vertical position
2323 VERTICAL_ENCODER_VALUE = 2.365140
24+ ARM_ENCODER_OFFSET = VERTICAL_ENCODER_VALUE - math .pi / 2.0
2425 # magic offset the deployed angle by 4 degrees to limit damage inflicted on mechanism
25- DEPLOYED_ANGLE = 1.194348 - VERTICAL_ENCODER_VALUE + math . pi / 2.0 + math .radians (4 )
26- RETRACTED_ANGLE = 2.365140 - VERTICAL_ENCODER_VALUE + math . pi / 2.0
26+ DEPLOYED_ANGLE = 1.194348 - ARM_ENCODER_OFFSET + math .radians (4 )
27+ RETRACTED_ANGLE = 2.365140 - ARM_ENCODER_OFFSET
2728
2829 gear_ratio = 4.0 * 5.0 * (48.0 / 40.0 )
2930
@@ -89,9 +90,7 @@ def raw_encoder(self) -> float:
8990 return self .encoder .get ()
9091
9192 def position (self ):
92- return (
93- self .encoder .get () - IntakeComponent .VERTICAL_ENCODER_VALUE + math .pi / 2.0
94- )
93+ return self .encoder .get () - IntakeComponent .ARM_ENCODER_OFFSET
9594
9695 def velocity (self ) -> float :
9796 return self .motor_encoder .getVelocity ()
You can’t perform that action at this time.
0 commit comments