fixing issues with the redone auto
diff --git a/frc971/autonomous/auto.cc b/frc971/autonomous/auto.cc
index e6ecc2d..32f6979 100644
--- a/frc971/autonomous/auto.cc
+++ b/frc971/autonomous/auto.cc
@@ -243,7 +243,7 @@
void Update() {
hot_goal.FetchLatest();
- LOG_STRUCT(INFO, "new counts", *hot_goal);
+ if (hot_goal.get()) LOG_STRUCT(INFO, "new counts", *hot_goal);
}
bool is_left() const {
@@ -366,7 +366,7 @@
if (auto_version == AutoVersion::kDoubleHot) {
if (ShouldExitAuto()) return;
auto drivetrain_action =
- SetDriveGoal(2, 2, first_shot_left ? kTurnAngle : -kTurnAngle);
+ SetDriveGoal(0, 2, first_shot_left ? kTurnAngle : -kTurnAngle);
WaitUntilDoneOrCanceled(drivetrain_action.get());
if (ShouldExitAuto()) return;
}
@@ -380,7 +380,7 @@
if (auto_version == AutoVersion::kDoubleHot) {
if (ShouldExitAuto()) return;
auto drivetrain_action =
- SetDriveGoal(2, 2, first_shot_left ? -kTurnAngle : kTurnAngle);
+ SetDriveGoal(0, 2, first_shot_left ? -kTurnAngle : kTurnAngle);
WaitUntilDoneOrCanceled(drivetrain_action.get());
if (ShouldExitAuto()) return;
}
@@ -434,7 +434,7 @@
if (auto_version == AutoVersion::kDoubleHot) {
if (ShouldExitAuto()) return;
auto drivetrain_action =
- SetDriveGoal(2, 2, second_shot_left ? kTurnAngle : -kTurnAngle);
+ SetDriveGoal(0, 2, second_shot_left ? kTurnAngle : -kTurnAngle);
WaitUntilDoneOrCanceled(drivetrain_action.get());
if (ShouldExitAuto()) return;
}
diff --git a/frc971/input/hot_goal_reader.cc b/frc971/input/hot_goal_reader.cc
index 30789cf..f42f370 100644
--- a/frc971/input/hot_goal_reader.cc
+++ b/frc971/input/hot_goal_reader.cc
@@ -64,7 +64,8 @@
FD_SET(connection, &fds);
struct timeval timeout_timeval =
::aos::time::Time::InSeconds(1).ToTimeval();
- switch (select(connection + 1, &fds, nullptr, nullptr, &timeout_timeval)) {
+ switch (
+ select(connection + 1, &fds, nullptr, nullptr, &timeout_timeval)) {
case 1: {
uint8_t data;
ssize_t read_bytes = read(connection, &data, sizeof(data));
diff --git a/frc971/input/sensor_receiver.cc b/frc971/input/sensor_receiver.cc
index a171621..8e82be3 100644
--- a/frc971/input/sensor_receiver.cc
+++ b/frc971/input/sensor_receiver.cc
@@ -150,6 +150,7 @@
::frc971::logging_structs::CapeReading reading_to_log(
cape_timestamp, static_cast<uint16_t>(sizeof(*data)),
sonar_translate(data->main.ultrasonic_pulse_length),
+ adc_translate(data->main.auto_mode_selector),
data->main.low_left_drive_hall, data->main.high_left_drive_hall,
data->main.low_right_drive_hall, data->main.high_right_drive_hall);
LOG_STRUCT(DEBUG, "cape reading", reading_to_log);
diff --git a/frc971/queues/to_log.q b/frc971/queues/to_log.q
index 341d921..218f37e 100644
--- a/frc971/queues/to_log.q
+++ b/frc971/queues/to_log.q
@@ -4,6 +4,7 @@
Time time;
uint16_t struct_size;
double sonar;
+ double auto_choice;
uint16_t left_low;
uint16_t left_high;