[wpimath] Replace frc/EigenCore.h typedefs with Eigen's where possible (#5597)

This commit is contained in:
Tyler Veness
2023-08-31 11:03:37 -07:00
committed by GitHub
parent 383289bc4b
commit 99f66b1e24
25 changed files with 79 additions and 80 deletions

View File

@@ -4,7 +4,8 @@
#include "frc/controller/DifferentialDriveFeedforward.h"
#include "frc/EigenCore.h"
#include <Eigen/Core>
#include "frc/controller/LinearPlantInversionFeedforward.h"
#include "frc/system/plant/LinearSystemId.h"
@@ -30,8 +31,8 @@ DifferentialDriveWheelVoltages DifferentialDriveFeedforward::Calculate(
units::meters_per_second_t nextRightVelocity, units::second_t dt) {
frc::LinearPlantInversionFeedforward<2, 2> feedforward{m_plant, dt};
frc::Vectord<2> r{currentLeftVelocity, currentRightVelocity};
frc::Vectord<2> nextR{nextLeftVelocity, nextRightVelocity};
Eigen::Vector2d r{currentLeftVelocity, currentRightVelocity};
Eigen::Vector2d nextR{nextLeftVelocity, nextRightVelocity};
auto u = feedforward.Calculate(r, nextR);
return {units::volt_t{u(0)}, units::volt_t{u(1)}};
}