commit | 5180bbe48fc101bcdeae570ec277890f1d6786fa | [log] [tgz] |
---|---|---|
author | Austin Schuh <austin.linux@gmail.com> | Wed Apr 05 19:44:45 2023 -0700 |
committer | Austin Schuh <austin.linux@gmail.com> | Wed Apr 12 20:58:52 2023 -0700 |
tree | e6d93713f00e851dc416c1a09b405c0775445b3b | |
parent | d28c0025e7b9022c1dfe67f8e6840baa84e0c428 [diff] |
Reject to send NANs from the drivetrain code Signed-off-by: Austin Schuh <austin.linux@gmail.com> Change-Id: I776bdc4ff0c31a94eb98e9af4dac33304f366a70
diff --git a/frc971/control_loops/drivetrain/line_follow_drivetrain.cc b/frc971/control_loops/drivetrain/line_follow_drivetrain.cc index ea20bd0..9823f0c 100644 --- a/frc971/control_loops/drivetrain/line_follow_drivetrain.cc +++ b/frc971/control_loops/drivetrain/line_follow_drivetrain.cc
@@ -284,6 +284,9 @@ } else if (minU < -12.0) { U_ = U_ - U_.Ones() * (minU + 12.0); } + if (!U_.allFinite()) { + U_.setZero(); + } } flatbuffers::Offset<LineFollowLogging> LineFollowDrivetrain::PopulateStatus(