Only run the CAN logger with RT priority when not polling
We are seeing the whole robot pause for a moment and recover. I suspect
this is because the CAN logger is running as RT priority and causing
load/timing violations somewhere. Stopping the CAN logger fixes it.
Instead of fully disabling it, let's try non-rt priority first.
Change-Id: I8d63587bdb6ba067323c318e9d84711b1b1ca638
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/frc971/can_logger/can_logger.cc b/frc971/can_logger/can_logger.cc
index c9e99f7..380410f 100644
--- a/frc971/can_logger/can_logger.cc
+++ b/frc971/can_logger/can_logger.cc
@@ -12,8 +12,10 @@
: shm_event_loop_(event_loop),
fd_(socket(PF_CAN, SOCK_RAW | SOCK_NONBLOCK, CAN_RAW)),
frames_sender_(shm_event_loop_->MakeSender<CanFrame>(channel_name)) {
- // TOOD(max): Figure out a proper priority
- shm_event_loop_->SetRuntimeRealtimePriority(10);
+ // TODO(max): Figure out a proper priority
+ if (!FLAGS_poll) {
+ shm_event_loop_->SetRuntimeRealtimePriority(10);
+ }
struct ifreq ifr;
strcpy(ifr.ifr_name, interface_name.data());
PCHECK(ioctl(fd_.get(), SIOCGIFINDEX, &ifr) == 0)