34template <
typename WheelSpeeds, WheelPositions WheelPositions>
66 void SetVisionMeasurementStdDevs(
79 void ResetPosition(
const Rotation2d& gyroAngle,
87 Pose2d GetEstimatedPosition()
const;
109 void AddVisionMeasurement(
const Pose2d& visionRobotPose,
110 units::second_t timestamp);
141 const Pose2d& visionRobotPose, units::second_t timestamp,
143 SetVisionMeasurementStdDevs(visionMeasurementStdDevs);
144 AddVisionMeasurement(visionRobotPose, timestamp);
169 Pose2d UpdateWithTime(units::second_t currentTime,
174 struct InterpolationRecord {
190 bool operator==(
const InterpolationRecord& other)
const =
default;
198 bool operator!=(
const InterpolationRecord& other)
const =
default;
208 InterpolationRecord Interpolate(
210 InterpolationRecord endValue,
double i)
const;
213 static constexpr units::second_t kBufferDuration = 1.5_s;
215 Kinematics<WheelSpeeds, WheelPositions>& m_kinematics;
216 Odometry<WheelSpeeds, WheelPositions>& m_odometry;
218 Eigen::Matrix3d m_visionK = Eigen::Matrix3d::Zero();
220 TimeInterpolatableBuffer<InterpolationRecord> m_poseBuffer{
221 kBufferDuration, [
this](
const InterpolationRecord& start,
222 const InterpolationRecord&
end,
double t) {
223 return start.Interpolate(this->m_kinematics,
end, t);
#define WPILIB_DLLEXPORT
Definition: SymbolExports.h:36
Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual wheel s...
Definition: Kinematics.h:23
Class for odometry.
Definition: Odometry.h:25
Represents a 2D pose containing translational and rotational elements.
Definition: Pose2d.h:25
This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.
Definition: PoseEstimator.h:35
void AddVisionMeasurement(const Pose2d &visionRobotPose, units::second_t timestamp, const wpi::array< double, 3 > &visionMeasurementStdDevs)
Adds a vision measurement to the Kalman Filter.
Definition: PoseEstimator.h:140
A rotation in a 2D coordinate frame represented by a point on the unit circle (cosine and sine).
Definition: Rotation2d.h:26
Definition: WheelPositions.h:11
static EIGEN_DEPRECATED const end_t end
Definition: IndexedViewHelper.h:181
Definition: AprilTagPoseEstimator.h:15
bool operator==(const Value &lhs, const Value &rhs)
constexpr bool operator!=(const UNIT_LIB_DEFAULT_TYPE lhs, const Units &rhs) noexcept
Definition: base.h:2727
constexpr empty_array_t empty_array
Definition: array.h:16