mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[wpimath] Allow multiple vision measurements from same timestamp (#4917)
Co-authored-by: Jordan McMichael <jlmcmchl@gmail.com> Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
@@ -212,7 +212,16 @@ public class DifferentialDrivePoseEstimator {
|
||||
sample.get().rightMeters,
|
||||
sample.get().poseMeters.exp(scaledTwist));
|
||||
|
||||
// Step 6: Replay odometry inputs between sample time and latest recorded sample to update the
|
||||
// Step 6: Record the current pose to allow multiple measurements from the same timestamp
|
||||
m_poseBuffer.addSample(
|
||||
timestampSeconds,
|
||||
new InterpolationRecord(
|
||||
getEstimatedPosition(),
|
||||
sample.get().gyroAngle,
|
||||
sample.get().leftMeters,
|
||||
sample.get().rightMeters));
|
||||
|
||||
// Step 7: Replay odometry inputs between sample time and latest recorded sample to update the
|
||||
// pose buffer and correct odometry.
|
||||
for (Map.Entry<Double, InterpolationRecord> entry :
|
||||
m_poseBuffer.getInternalBuffer().tailMap(timestampSeconds).entrySet()) {
|
||||
|
||||
@@ -199,7 +199,13 @@ public class MecanumDrivePoseEstimator {
|
||||
sample.get().wheelPositions,
|
||||
sample.get().poseMeters.exp(scaledTwist));
|
||||
|
||||
// Step 6: Replay odometry inputs between sample time and latest recorded sample to update the
|
||||
// Step 6: Record the current pose to allow multiple measurements from the same timestamp
|
||||
m_poseBuffer.addSample(
|
||||
timestampSeconds,
|
||||
new InterpolationRecord(
|
||||
getEstimatedPosition(), sample.get().gyroAngle, sample.get().wheelPositions));
|
||||
|
||||
// Step 7: Replay odometry inputs between sample time and latest recorded sample to update the
|
||||
// pose buffer and correct odometry.
|
||||
for (Map.Entry<Double, InterpolationRecord> entry :
|
||||
m_poseBuffer.getInternalBuffer().tailMap(timestampSeconds).entrySet()) {
|
||||
|
||||
@@ -201,7 +201,13 @@ public class SwerveDrivePoseEstimator {
|
||||
sample.get().modulePositions,
|
||||
sample.get().poseMeters.exp(scaledTwist));
|
||||
|
||||
// Step 6: Replay odometry inputs between sample time and latest recorded sample to update the
|
||||
// Step 6: Record the current pose to allow multiple measurements from the same timestamp
|
||||
m_poseBuffer.addSample(
|
||||
timestampSeconds,
|
||||
new InterpolationRecord(
|
||||
getEstimatedPosition(), sample.get().gyroAngle, sample.get().modulePositions));
|
||||
|
||||
// Step 7: Replay odometry inputs between sample time and latest recorded sample to update the
|
||||
// pose buffer and correct odometry.
|
||||
for (Map.Entry<Double, InterpolationRecord> entry :
|
||||
m_poseBuffer.getInternalBuffer().tailMap(timestampSeconds).entrySet()) {
|
||||
|
||||
Reference in New Issue
Block a user