mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-22 06:41:39 +00:00
Addressing issue #7 by reading CANCoder values until successful with 10ms delay between readings. Fall back to reading relative encoder.
This commit is contained in:
@@ -86,8 +86,11 @@ public class SwerveIMUSimulation
|
||||
* @param modulePoses {@link Pose2d} representing the swerve modules.
|
||||
* @param field {@link Field2d} to update.
|
||||
*/
|
||||
public void updateOdometry(SwerveKinematics2 kinematics, SwerveModuleState2[] states, Pose2d[] modulePoses,
|
||||
Field2d field)
|
||||
public void updateOdometry(
|
||||
SwerveKinematics2 kinematics,
|
||||
SwerveModuleState2[] states,
|
||||
Pose2d[] modulePoses,
|
||||
Field2d field)
|
||||
{
|
||||
angle += kinematics.toChassisSpeeds(states).omegaRadiansPerSecond * (timer.get() - lastTime);
|
||||
lastTime = timer.get();
|
||||
|
||||
Reference in New Issue
Block a user