Skip to content

Commit

Permalink
chassis: Latency compensate steer angle readings
Browse files Browse the repository at this point in the history
  • Loading branch information
auscompgeek committed Mar 10, 2024
1 parent ffbc668 commit d42306a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ def get_angle_absolute(self) -> float:

def get_angle_integrated(self) -> float:
"""Gets steer angle from motor's integrated relative encoder"""
return self.steer.get_position().value * math.tau
rot = self.steer.get_position().get_latency_compensated_value(
self.steer.get_velocity()
)
return rot * math.tau

def get_rotation(self) -> Rotation2d:
"""Get the steer angle as a Rotation2d"""
Expand Down

0 comments on commit d42306a

Please sign in to comment.