mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Updated to include gyro and accelerometer, and Rotation3d offset.
This commit is contained in:
@@ -3,8 +3,10 @@ package swervelib.simulation;
|
||||
import edu.wpi.first.math.geometry.Pose2d;
|
||||
import edu.wpi.first.math.geometry.Rotation2d;
|
||||
import edu.wpi.first.math.geometry.Rotation3d;
|
||||
import edu.wpi.first.math.geometry.Translation3d;
|
||||
import edu.wpi.first.wpilibj.Timer;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.Field2d;
|
||||
import java.util.Optional;
|
||||
import swervelib.math.SwerveKinematics2;
|
||||
import swervelib.math.SwerveModuleState2;
|
||||
|
||||
@@ -77,6 +79,16 @@ public class SwerveIMUSimulation
|
||||
return new Rotation3d(0, 0, angle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the acceleration [x, y, z] from the IMU in m/s/s. If acceleration isn't supported returns empty.
|
||||
*
|
||||
* @return {@link Translation3d} of the acceleration as an {@link Optional}.
|
||||
*/
|
||||
public Optional<Translation3d> getAccel()
|
||||
{
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the odometry of the simulated {@link swervelib.SwerveDrive} and post the {@link swervelib.SwerveModule}
|
||||
* states to the {@link Field2d}.
|
||||
|
||||
Reference in New Issue
Block a user