[wpimath] Fix precondition violation messages in LQR and Kalman filters (#6731)

This commit is contained in:
Tyler Veness
2024-06-21 20:55:01 -07:00
committed by GitHub
parent d2b1aa1869
commit b8c2571638
9 changed files with 20 additions and 21 deletions

View File

@@ -55,7 +55,7 @@ class KalmanFilter {
* @param stateStdDevs Standard deviations of model states.
* @param measurementStdDevs Standard deviations of measurements.
* @param dt Nominal discretization timestep.
* @throws std::invalid_argument If the system is unobservable.
* @throws std::invalid_argument If the system is undetectable.
*/
KalmanFilter(LinearSystem<States, Inputs, Outputs>& plant,
const StateArray& stateStdDevs,

View File

@@ -41,8 +41,8 @@ KalmanFilter<States, Inputs, Outputs>::KalmanFilter(
if (!IsDetectable<States, Outputs>(discA, C)) {
std::string msg = fmt::format(
"The system passed to the Kalman filter is "
"unobservable!\n\nA =\n{}\nC =\n{}\n",
"The system passed to the Kalman filter is undetectable!\n\n"
"A =\n{}\nC =\n{}\n",
discA, C);
wpi::math::MathSharedStore::ReportError(msg);

View File

@@ -58,7 +58,7 @@ class SteadyStateKalmanFilter {
* @param stateStdDevs Standard deviations of model states.
* @param measurementStdDevs Standard deviations of measurements.
* @param dt Nominal discretization timestep.
* @throws std::invalid_argument If the system is unobservable.
* @throws std::invalid_argument If the system is undetectable.
*/
SteadyStateKalmanFilter(LinearSystem<States, Inputs, Outputs>& plant,
const StateArray& stateStdDevs,

View File

@@ -39,8 +39,8 @@ SteadyStateKalmanFilter<States, Inputs, Outputs>::SteadyStateKalmanFilter(
if (!IsDetectable<States, Outputs>(discA, C)) {
std::string msg = fmt::format(
"The system passed to the Kalman filter is "
"unobservable!\n\nA =\n{}\nC =\n{}\n",
"The system passed to the Kalman filter is undetectable!\n\n"
"A =\n{}\nC =\n{}\n",
discA, C);
wpi::math::MathSharedStore::ReportError(msg);