mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpimath] Replace frc/EigenCore.h typedefs with Eigen's where possible (#5597)
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "frc/EigenCore.h"
|
||||
#include "frc/controller/DifferentialDriveFeedforward.h"
|
||||
#include "frc/controller/LinearPlantInversionFeedforward.h"
|
||||
#include "frc/system/plant/LinearSystemId.h"
|
||||
@@ -38,9 +38,9 @@ TEST(DifferentialDriveFeedforwardTest, CalculateWithTrackwidth) {
|
||||
auto [left, right] = differentialDriveFeedforward.Calculate(
|
||||
currentLeftVelocity, nextLeftVelocity, currentRightVelocity,
|
||||
nextRightVelocity, dt);
|
||||
frc::Matrixd<2, 1> nextX = plant.CalculateX(
|
||||
frc::Vectord<2>{currentLeftVelocity, currentRightVelocity},
|
||||
frc::Vectord<2>{left, right}, dt);
|
||||
Eigen::Vector2d nextX = plant.CalculateX(
|
||||
Eigen::Vector2d{currentLeftVelocity, currentRightVelocity},
|
||||
Eigen::Vector2d{left, right}, dt);
|
||||
EXPECT_NEAR(nextX(0), nextLeftVelocity.value(), 1e-6);
|
||||
EXPECT_NEAR(nextX(1), nextRightVelocity.value(), 1e-6);
|
||||
}
|
||||
@@ -72,9 +72,9 @@ TEST(DifferentialDriveFeedforwardTest, CalculateWithoutTrackwidth) {
|
||||
auto [left, right] = differentialDriveFeedforward.Calculate(
|
||||
currentLeftVelocity, nextLeftVelocity, currentRightVelocity,
|
||||
nextRightVelocity, dt);
|
||||
frc::Matrixd<2, 1> nextX = plant.CalculateX(
|
||||
frc::Vectord<2>{currentLeftVelocity, currentRightVelocity},
|
||||
frc::Vectord<2>{left, right}, dt);
|
||||
Eigen::Vector2d nextX = plant.CalculateX(
|
||||
Eigen::Vector2d{currentLeftVelocity, currentRightVelocity},
|
||||
Eigen::Vector2d{left, right}, dt);
|
||||
EXPECT_NEAR(nextX(0), nextLeftVelocity.value(), 1e-6);
|
||||
EXPECT_NEAR(nextX(1), nextRightVelocity.value(), 1e-6);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user