Reduce context switches by prioritizing loops over output
Change-Id: Idaa3e5bb0bc37ada967ca5b3d92d5c199cd3e77e
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/frc971/control_loops/drivetrain/drivetrain.cc b/frc971/control_loops/drivetrain/drivetrain.cc
index 95fab0a2..3413bf6 100644
--- a/frc971/control_loops/drivetrain/drivetrain.cc
+++ b/frc971/control_loops/drivetrain/drivetrain.cc
@@ -355,7 +355,7 @@
event_loop->TryMakeSender<
frc971::control_loops::drivetrain::RioLocalizerInputsStatic>(
"/drivetrain")) {
- event_loop->SetRuntimeRealtimePriority(30);
+ event_loop->SetRuntimeRealtimePriority(37);
for (size_t ii = 0; ii < trajectory_fetchers_.size(); ++ii) {
trajectory_fetchers_[ii].fetcher =
event_loop->MakeFetcher<fb::Trajectory>("/drivetrain");
diff --git a/y2024/control_loops/superstructure/superstructure.cc b/y2024/control_loops/superstructure/superstructure.cc
index b30d530..d3e98ab 100644
--- a/y2024/control_loops/superstructure/superstructure.cc
+++ b/y2024/control_loops/superstructure/superstructure.cc
@@ -52,7 +52,7 @@
robot_constants_->robot()->extend_constants()->zeroing_constants()),
extend_debouncer_(std::chrono::milliseconds(30),
std::chrono::milliseconds(8)) {
- event_loop->SetRuntimeRealtimePriority(30);
+ event_loop->SetRuntimeRealtimePriority(37);
}
bool PositionNear(double position, double goal, double threshold) {