File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class WristComponent:
2727 12.0 / 20.0
2828 ) * 350.628 # not remeasured and just adjusted by the change in gear reduction
2929 TOLERANCE = math .radians (3.0 )
30+ VEL_TOLERANCE = 0.05
3031
3132 def __init__ (self , mech_root : wpilib .MechanismRoot2d ):
3233 self .wrist_ligament = mech_root .appendLigament (
@@ -122,7 +123,9 @@ def at_setpoint(self) -> bool:
122123 return (
123124 abs (self .desired_state .position - self .inclination ())
124125 < WristComponent .TOLERANCE
125- )
126+ ) and abs (
127+ self .desired_state .velocity - self .current_velocity ()
128+ ) < WristComponent .VEL_TOLERANCE
126129
127130 def tilt_to (self , pos : float ) -> None :
128131 clamped_angle = clamp (pos , self .MAXIMUM_DEPRESSION , self .MAXIMUM_ELEVATION )
You can’t perform that action at this time.
0 commit comments