mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpimath] Fix C++ pose estimator poseEstimate initialization (#7249)
This commit is contained in:
@@ -394,10 +394,15 @@ TEST(SwerveDrivePoseEstimatorTest, TestReset) {
|
||||
frc::Rotation2d{},
|
||||
{frc::SwerveModulePosition{}, frc::SwerveModulePosition{},
|
||||
frc::SwerveModulePosition{}, frc::SwerveModulePosition{}},
|
||||
frc::Pose2d{},
|
||||
frc::Pose2d{-1_m, -1_m, frc::Rotation2d{1_rad}},
|
||||
{1.0, 1.0, 1.0},
|
||||
{1.0, 1.0, 1.0}};
|
||||
|
||||
// Test initial pose
|
||||
EXPECT_EQ(-1, estimator.GetEstimatedPosition().X().value());
|
||||
EXPECT_EQ(-1, estimator.GetEstimatedPosition().Y().value());
|
||||
EXPECT_EQ(1, estimator.GetEstimatedPosition().Rotation().Radians().value());
|
||||
|
||||
// Test reset position
|
||||
{
|
||||
frc::SwerveModulePosition modulePosition{1_m, frc::Rotation2d{}};
|
||||
|
||||
Reference in New Issue
Block a user