mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpimath] Clean up Eigen usage
* Replace Matrix<> with Vector<> where vectors are explicitly intended. I found these via `rg "Eigen::Matrix<double, \w+, 1>"`. * Pass all Eigen matrices by const reference. I found these via `rg "\(Eigen"` on main (the initializer list constructors make more false positives). * Replace MakeMatrix() and operator<< usage with initializer list constructors. I found these via `rg MakeMatrix` and `rg "<<"` respectively. * Deprecate MakeMatrix()
This commit is contained in:
committed by
Peter Johnson
parent
72716f51ce
commit
9359431bad
@@ -10,10 +10,10 @@
|
||||
TEST(SingleJointedArmTest, Disabled) {
|
||||
frc::sim::SingleJointedArmSim sim(frc::DCMotor::Vex775Pro(2), 100, 3_kg_sq_m,
|
||||
9.5_in, -180_deg, 0_deg, 10_lb, true);
|
||||
sim.SetState(frc::MakeMatrix<2, 1>(0.0, 0.0));
|
||||
sim.SetState(Eigen::Vector<double, 2>{0.0, 0.0});
|
||||
|
||||
for (size_t i = 0; i < 12 / 0.02; ++i) {
|
||||
sim.SetInput(frc::MakeMatrix<1, 1>(0.0));
|
||||
sim.SetInput(Eigen::Vector<double, 1>{0.0});
|
||||
sim.Update(20_ms);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user