Bringup main robot
This gets all mechanisms zeroed and running.
Many profiles are still heavily detuned.
Catapult motors are moved to the CANivore bus.
Change-Id: I38a1845f804bd490d5fff285c636010ac8ea2c27
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/frc971/wpilib/can_sensor_reader.cc b/frc971/wpilib/can_sensor_reader.cc
index 54be05d..1f56b17 100644
--- a/frc971/wpilib/can_sensor_reader.cc
+++ b/frc971/wpilib/can_sensor_reader.cc
@@ -7,8 +7,10 @@
aos::EventLoop *event_loop,
std::vector<ctre::phoenix6::BaseStatusSignal *> signals_registry,
std::vector<std::shared_ptr<TalonFX>> talonfxs,
- std::function<void(ctre::phoenix::StatusCode status)> flatbuffer_callback)
+ std::function<void(ctre::phoenix::StatusCode status)> flatbuffer_callback,
+ SignalSync sync)
: event_loop_(event_loop),
+ sync_(sync),
signals_(signals_registry.begin(), signals_registry.end()),
talonfxs_(talonfxs),
flatbuffer_callback_(flatbuffer_callback) {
@@ -28,8 +30,12 @@
}
void CANSensorReader::Loop() {
- ctre::phoenix::StatusCode status =
- ctre::phoenix6::BaseStatusSignal::WaitForAll(20_ms, signals_);
+ ctre::phoenix::StatusCode status;
+ if (sync_ == SignalSync::kDoSync) {
+ status = ctre::phoenix6::BaseStatusSignal::WaitForAll(20_ms, signals_);
+ } else {
+ status = ctre::phoenix6::BaseStatusSignal::RefreshAll(signals_);
+ }
if (!status.IsOK()) {
AOS_LOG(ERROR, "Failed to read signals from talonfx motors: %s: %s",