Skip to content

Commit

Permalink
Merge pull request #207 from thedropbears/rezero_inclinator
Browse files Browse the repository at this point in the history
  • Loading branch information
LeanMeanBeanMachine4774 authored May 19, 2024
2 parents 9534c96 + 67caff5 commit 5aede32
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/shooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ShooterComponent:
MAX_INCLINE_ANGLE = 1.045 # ~60 degrees
MIN_INCLINE_ANGLE = 0.354 # ~20 degrees
INCLINATOR_TOLERANCE = math.radians(1)
INCLINATOR_OFFSET = 4.023 - MIN_INCLINE_ANGLE
INCLINATOR_OFFSET = 3.894 - MIN_INCLINE_ANGLE
INCLINATOR_SCALE_FACTOR = math.tau # rps -> radians
INCLINATOR_GEAR_RATIO = 18 / 24 * 26 / 300
INCLINATOR_POSITION_CONVERSION_FACTOR = (
Expand Down Expand Up @@ -163,9 +163,12 @@ def _flywheels_at_speed(self) -> bool:
@feedback
def _inclination_angle(self) -> float:
"""Get the angle of the mechanism in radians measured positive upwards from zero parellel to the ground."""
return self._raw_inclination_angle() - self.INCLINATOR_OFFSET

@feedback
def _raw_inclination_angle(self) -> float:
return (
self.absolute_inclinator_encoder.getOutput() * self.INCLINATOR_SCALE_FACTOR
- self.INCLINATOR_OFFSET
)

def is_range_in_bounds(self, range) -> bool:
Expand Down

0 comments on commit 5aede32

Please sign in to comment.