mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpimath] Fix C++ feedforward constructors and add tests (#6873)
This commit is contained in:
@@ -45,13 +45,13 @@ class WPILIB_DLLEXPORT ArmFeedforward {
|
||||
if (kV.value() < 0) {
|
||||
wpi::math::MathSharedStore::ReportError(
|
||||
"kV must be a non-negative number, got {}!", kV.value());
|
||||
kV = units::unit_t<kv_unit>{0};
|
||||
this->kV = units::unit_t<kv_unit>{0};
|
||||
wpi::math::MathSharedStore::ReportWarning("kV defaulted to 0.");
|
||||
}
|
||||
if (kA.value() < 0) {
|
||||
wpi::math::MathSharedStore::ReportError(
|
||||
"kA must be a non-negative number, got {}!", kA.value());
|
||||
kA = units::unit_t<ka_unit>{0};
|
||||
this->kA = units::unit_t<ka_unit>{0};
|
||||
wpi::math::MathSharedStore::ReportWarning("kA defaulted to 0;");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user