SwerveDrive4Odometry
- class wpimath.SwerveDrive4Odometry(kinematics: wpimath._wpimath.SwerveDrive4Kinematics, gyroAngle: wpimath._wpimath.Rotation2d, modulePositions: Tuple[wpimath._wpimath.SwerveModulePosition, wpimath._wpimath.SwerveModulePosition, wpimath._wpimath.SwerveModulePosition, wpimath._wpimath.SwerveModulePosition], initialPose: wpimath._wpimath.Pose2d = Pose2d(Translation2d(x=0.000000, y=0.000000), Rotation2d(0.000000)))
Bases:
SwerveDrive4OdometryBaseClass for swerve drive odometry. Odometry allows you to track the robot’s position on the field over a course of a match using readings from your swerve drive encoders and swerve azimuth encoders.
Teams can use odometry during the autonomous period for complex tasks like path following. Furthermore, odometry can be used for latency compensation when using computer-vision systems.
Constructs a SwerveDriveOdometry object.
- Parameters:
kinematics – The swerve drive kinematics for your drivetrain.
gyroAngle – The angle reported by the gyroscope.
modulePositions – The wheel positions reported by each module.
initialPose – The starting position of the robot on the field.