Package swervelib.math
Class SwervePoseEstimator2.InterpolationRecord
java.lang.Object
swervelib.math.SwervePoseEstimator2.InterpolationRecord
- All Implemented Interfaces:
edu.wpi.first.math.interpolation.Interpolatable<SwervePoseEstimator2.InterpolationRecord>
- Enclosing class:
- SwervePoseEstimator2
private class SwervePoseEstimator2.InterpolationRecord
extends Object
implements edu.wpi.first.math.interpolation.Interpolatable<SwervePoseEstimator2.InterpolationRecord>
Represents an odometry record. The record contains the inputs provided as well as the pose that was observed based
on these inputs, as well as the previous record and its inputs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final edu.wpi.first.math.geometry.Rotation2dprivate final edu.wpi.first.math.geometry.Rotation2dprivate final edu.wpi.first.math.geometry.Rotation2dprivate final edu.wpi.first.math.kinematics.SwerveModulePosition[]private final edu.wpi.first.math.geometry.Pose2d -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateInterpolationRecord(edu.wpi.first.math.geometry.Pose2d poseMeters, edu.wpi.first.math.geometry.Rotation2d gyro, edu.wpi.first.math.geometry.Rotation2d gyroPitch, edu.wpi.first.math.geometry.Rotation2d gyroRoll, edu.wpi.first.math.kinematics.SwerveModulePosition[] modulePositions) Constructs an Interpolation Record with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()interpolate(SwervePoseEstimator2.InterpolationRecord endValue, double t) Return the interpolated record.
-
Field Details
-
poseMeters
private final edu.wpi.first.math.geometry.Pose2d poseMeters -
gyroAngle
private final edu.wpi.first.math.geometry.Rotation2d gyroAngle -
gyroPitch
private final edu.wpi.first.math.geometry.Rotation2d gyroPitch -
gyroRoll
private final edu.wpi.first.math.geometry.Rotation2d gyroRoll -
modulePositions
private final edu.wpi.first.math.kinematics.SwerveModulePosition[] modulePositions
-
-
Constructor Details
-
InterpolationRecord
private InterpolationRecord(edu.wpi.first.math.geometry.Pose2d poseMeters, edu.wpi.first.math.geometry.Rotation2d gyro, edu.wpi.first.math.geometry.Rotation2d gyroPitch, edu.wpi.first.math.geometry.Rotation2d gyroRoll, edu.wpi.first.math.kinematics.SwerveModulePosition[] modulePositions) Constructs an Interpolation Record with the specified parameters.- Parameters:
poseMeters- The pose observed given the current sensor inputs and the previous pose.gyro- The current gyro angle.gyroPitch- The current gyro pitch.gyroRoll- The current gyro roll.modulePositions- The distances and rotations measured at each wheel.
-
-
Method Details
-
interpolate
public SwervePoseEstimator2.InterpolationRecord interpolate(SwervePoseEstimator2.InterpolationRecord endValue, double t) Return the interpolated record. This object is assumed to be the starting position, or lower bound.- Specified by:
interpolatein interfaceedu.wpi.first.math.interpolation.Interpolatable<SwervePoseEstimator2.InterpolationRecord>- Parameters:
endValue- The upper bound, or end.t- How far between the lower and upper bound we are. This should be bounded in [0, 1].- Returns:
- The interpolated value.
-
equals
-
hashCode
public int hashCode()
-