[wpimath] Update Drake DARE solver to v0.29.0 (#3336)

This version incorporated the patch we were manually applying, so we're
synced back up with upstream now except for some minor #include changes
to reduce header bloat.
This commit is contained in:
Tyler Veness
2021-05-05 09:16:55 -07:00
committed by GitHub
parent 5ef2b4fdc0
commit ba08baabb9
3 changed files with 6 additions and 11 deletions

View File

@@ -7,9 +7,6 @@
#include <Eigen/Eigenvalues>
#include <Eigen/QR>
// This code has https://github.com/RobotLocomotion/drake/pull/11118 applied to
// fix an infinite loop in reorder_eigen().
namespace drake {
namespace math {
namespace {

View File

@@ -11,9 +11,9 @@ namespace math {
/// Computes the unique stabilizing solution X to the discrete-time algebraic
/// Riccati equation:
///
/// \f[
/// @f[
/// A'XA - X - A'XB(B'XB+R)^{-1}B'XA + Q = 0
/// \f]
/// @f]
///
/// @throws std::runtime_error if Q is not positive semi-definite.
/// @throws std::runtime_error if R is not positive definite.

View File

@@ -63,12 +63,10 @@ GTEST_TEST(DARE, SolveDAREandVerify) {
R3 << 1;
SolveDAREandVerify(A3, B3, Q3, R3);
// Test 4: A = B = Q = R = I_2 (2-by-2 identity matrix)
int n4 = 2, m4 = 2;
MatrixXd A4(n4, n4), B4(n4, m4), Q4(n4, n4), R4(m4, m4);
A4 << 1, 0, 0, 1;
B4 << 1, 0, 0, 1;
Q4 << 1, 0, 0, 1;
R4 << 1, 0, 0, 1;
const Eigen::MatrixXd A4{Eigen::Matrix2d::Identity()};
const Eigen::MatrixXd B4{Eigen::Matrix2d::Identity()};
const Eigen::MatrixXd Q4{Eigen::Matrix2d::Identity()};
const Eigen::MatrixXd R4{Eigen::Matrix2d::Identity()};
SolveDAREandVerify(A4, B4, Q4, R4);
}
} // namespace