mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[wpimath] Replace frc/EigenCore.h typedefs with Eigen's where possible (#5597)
This commit is contained in:
@@ -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)}};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user