Skip to content

Commit

Permalink
[wpimath] Use std::norm() in IsStabilizable() (wpilibsuite#5599)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Sep 1, 2023
1 parent 8e2465f commit a750bee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions wpimath/src/main/native/include/frc/StateSpaceUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ bool IsStabilizableImpl(const Matrixd<States, States>& A,
Eigen::EigenSolver<Matrixd<States, States>> es{A, false};

for (int i = 0; i < A.rows(); ++i) {
if (es.eigenvalues()[i].real() * es.eigenvalues()[i].real() +
es.eigenvalues()[i].imag() * es.eigenvalues()[i].imag() <
1) {
if (std::norm(es.eigenvalues()[i]) < 1) {
continue;
}

Expand Down

0 comments on commit a750bee

Please sign in to comment.