-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'offseason-tuning' into auto-scoring-with-zones
- Loading branch information
Showing
3 changed files
with
42 additions
and
18 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/main/kotlin/com/team4099/robot2023/commands/drivetrain/SwerveModuleTuningCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.team4099.robot2023.commands.drivetrain | ||
|
||
import com.team4099.robot2023.subsystems.drivetrain.drive.Drivetrain | ||
import edu.wpi.first.math.kinematics.SwerveModuleState | ||
import edu.wpi.first.wpilibj2.command.CommandBase | ||
import org.team4099.lib.units.derived.Angle | ||
import org.team4099.lib.units.derived.inRotation2ds | ||
|
||
class SwerveModuleTuningCommand(val drivetrain: Drivetrain, val steeringPosition: Angle) : | ||
CommandBase() { | ||
init { | ||
addRequirements(drivetrain) | ||
} | ||
|
||
override fun execute() { | ||
for (module in drivetrain.swerveModules) { | ||
module.setPositionClosedLoop( | ||
SwerveModuleState(0.0, steeringPosition.inRotation2ds), | ||
SwerveModuleState(0.0, steeringPosition.inRotation2ds), | ||
false | ||
) | ||
} | ||
} | ||
|
||
override fun isFinished(): Boolean { | ||
return false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters