File tree 2 files changed +3
-14
lines changed
src/main/kotlin/org/sert2521/gamename
2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ import org.sert2521.gamename.Characteristics
6
6
import org.sert2521.gamename.Talons
7
7
import org.sert2521.gamename.util.Logger
8
8
import org.sert2521.gamename.util.Telemetry
9
- import org.sert2521.gamename.util.applyDeadband
10
9
import org.team2471.frc.lib.actuators.TalonSRX
11
10
import org.team2471.frc.lib.framework.DaemonSubsystem
11
+ import org.team2471.frc.lib.math.deadband
12
12
import kotlin.math.abs
13
13
import kotlin.math.max
14
14
@@ -85,8 +85,8 @@ object Drivetrain : DaemonSubsystem("Drivetrain") {
85
85
feet * 12.0 / Math .PI / Characteristics .WHEEL_DIAMETER * Characteristics .ENCODER_TICKS_PER_REVOLUTION
86
86
87
87
fun drive (throttle : Double , turn : Double ) {
88
- val scaledThrottle = applyDeadband( abs(throttle).coerceAtMost(1.0 ))
89
- val scaledTurn = applyDeadband( abs(throttle).coerceAtMost(1.0 ))
88
+ val scaledThrottle = abs(throttle).coerceAtMost(1.0 ).deadband( 0.02 )
89
+ val scaledTurn = abs(throttle).coerceAtMost(1.0 ).deadband( 0.02 )
90
90
91
91
val squaredThrottle = Math .copySign(scaledThrottle * scaledThrottle, throttle)
92
92
val squaredTurn = Math .copySign(scaledTurn * scaledTurn, turn)
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments