55 units::meter_t leftDistance,
56 units::meter_t rightDistance,
57 const Pose2d& initialPose);
78 units::meter_t leftDistance, units::meter_t rightDistance,
104 units::meter_t rightDistance,
const Pose2d& pose);
134 units::second_t timestamp);
165 const Pose2d& visionRobotPose, units::second_t timestamp,
167 SetVisionMeasurementStdDevs(visionMeasurementStdDevs);
168 AddVisionMeasurement(visionRobotPose, timestamp);
182 units::meter_t rightDistance);
197 units::meter_t leftDistance,
198 units::meter_t rightDistance);
201 struct InterpolationRecord {
209 units::meter_t leftDistance;
212 units::meter_t rightDistance;
220 bool operator==(
const InterpolationRecord& other)
const =
default;
228 bool operator!=(
const InterpolationRecord& other)
const =
default;
239 InterpolationRecord endValue,
243 static constexpr units::second_t kBufferDuration = 1.5_s;
248 Eigen::Matrix3d m_visionK = Eigen::Matrix3d::Zero();
250 TimeInterpolatableBuffer<InterpolationRecord> m_poseBuffer{
251 kBufferDuration, [
this](
const InterpolationRecord& start,
252 const InterpolationRecord&
end,
double t) {
253 return start.Interpolate(this->m_kinematics,
end, t);
#define WPILIB_DLLEXPORT
Definition: SymbolExports.h:36
Helper class that converts a chassis velocity (dx and dtheta components) to left and right wheel velo...
Definition: DifferentialDriveKinematics.h:25
Class for differential drive odometry.
Definition: DifferentialDriveOdometry.h:25
This class wraps Differential Drive Odometry to fuse latency-compensated vision measurements with dif...
Definition: DifferentialDrivePoseEstimator.h:35
void AddVisionMeasurement(const Pose2d &visionRobotPose, units::second_t timestamp)
Adds a vision measurement to the Kalman Filter.
Pose2d UpdateWithTime(units::second_t currentTime, const Rotation2d &gyroAngle, units::meter_t leftDistance, units::meter_t rightDistance)
Updates the pose estimator with wheel encoder and gyro information.
void SetVisionMeasurementStdDevs(const wpi::array< double, 3 > &visionMeasurementStdDevs)
Sets the pose estimator's trust in vision measurements.
Pose2d GetEstimatedPosition() const
Gets the estimated robot pose.
Pose2d Update(const Rotation2d &gyroAngle, units::meter_t leftDistance, units::meter_t rightDistance)
Updates the pose estimator with wheel encoder and gyro information.
void ResetPosition(const Rotation2d &gyroAngle, units::meter_t leftDistance, units::meter_t rightDistance, const Pose2d &pose)
Resets the robot's position on the field.
DifferentialDrivePoseEstimator(DifferentialDriveKinematics &kinematics, const Rotation2d &gyroAngle, units::meter_t leftDistance, units::meter_t rightDistance, const Pose2d &initialPose, const wpi::array< double, 3 > &stateStdDevs, const wpi::array< double, 3 > &visionMeasurementStdDevs)
Constructs a DifferentialDrivePoseEstimator.
void AddVisionMeasurement(const Pose2d &visionRobotPose, units::second_t timestamp, const wpi::array< double, 3 > &visionMeasurementStdDevs)
Adds a vision measurement to the Kalman Filter.
Definition: DifferentialDrivePoseEstimator.h:164
DifferentialDrivePoseEstimator(DifferentialDriveKinematics &kinematics, const Rotation2d &gyroAngle, units::meter_t leftDistance, units::meter_t rightDistance, const Pose2d &initialPose)
Constructs a DifferentialDrivePoseEstimator with default standard deviations for the model and vision...
Represents a 2D pose containing translational and rotational elements.
Definition: Pose2d.h:25
A rotation in a 2D coordinate frame represented by a point on the unit circle (cosine and sine).
Definition: Rotation2d.h:26
static EIGEN_DEPRECATED const end_t end
Definition: IndexedViewHelper.h:181
Definition: AprilTagFieldLayout.h:22
bool operator==(const Value &lhs, const Value &rhs)
constexpr bool operator!=(const UNIT_LIB_DEFAULT_TYPE lhs, const Units &rhs) noexcept
Definition: base.h:2716
constexpr empty_array_t empty_array
Definition: array.h:15