-
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.
- Loading branch information
1 parent
85d3aa6
commit 967fc84
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
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,26 @@ | ||
package frc.robot.subsystems.drive; | ||
|
||
import org.littletonrobotics.junction.AutoLog; | ||
|
||
import edu.wpi.first.math.geometry.Pose2d; | ||
import swervelib.SwerveDrive; | ||
|
||
public class DriveIO { | ||
@AutoLog | ||
public static class DriveIOInputs { | ||
public Pose2d pose; | ||
public double poseX = 0.0; | ||
public double poseY = 0.0; | ||
public double poseRotInDegrees = 0.0; | ||
} | ||
|
||
/** Updates the set of loggable inputs. */ | ||
public void updateInputs(DriveIOInputs inputs, SwerveDrive swerveDrive) { | ||
inputs.pose = swerveDrive.getPose(); | ||
inputs.poseX = inputs.pose.getTranslation().getX(); | ||
inputs.poseY = inputs.pose.getTranslation().getY(); | ||
inputs.poseRotInDegrees = inputs.pose.getRotation().getDegrees(); | ||
} | ||
|
||
// Other methods for controlling the drive subsystem... | ||
} |
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