Fix up more third robot stuff.
- Get rid of shooter in start_list.txt. It is not needed
yet and was blowing up the queue system.
- Get rid of unused version of gyro_board_data.h.
- (Attempt) to fix messed up shifters. (I can't be sure this
is fixed until I get a chance to test it.)
- Clean up some crap in constants.cpp/h.
- Fix encoder values for bot3 drivetrain.
diff --git a/bot3/atom_code/scripts/start_list.txt b/bot3/atom_code/scripts/start_list.txt
index 83f541f..deeae24 100644
--- a/bot3/atom_code/scripts/start_list.txt
+++ b/bot3/atom_code/scripts/start_list.txt
@@ -2,7 +2,5 @@
MotorWriter
joystick_reader
drivetrain
-CRIOLogReader
-shooter
auto
-gyro_board_reader
+gyro_sensor_receiver
diff --git a/bot3/input/gyro_board_data.h b/bot3/input/gyro_board_data.h
deleted file mode 100644
index a3b60e5..0000000
--- a/bot3/input/gyro_board_data.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef BOT3_INPUT_GYRO_BOARD_DATA_H_
-#define BOT3_INPUT_GYRO_BOARD_DATA_H_
-
-#include "aos/common/byteorder.h"
-
-namespace bot3 {
-
-// The struct that the gyro board sends out with all of the data in it.
-struct GyroBoardData {
- int64_t gyro_angle;
-
- int32_t left_drive;
- int32_t right_drive;
- int32_t shooter_angle;
- int32_t shooter;
-
- int32_t capture_top_rise;
- int32_t capture_top_fall;
- int32_t capture_bottom_fall_delay;
-
- uint8_t top_rise_count;
-
- uint8_t top_fall_count;
-
- uint8_t bottom_rise_count;
-
- uint8_t bottom_fall_delay_count;
- uint8_t bottom_fall_count;
-
- union {
- struct {
- uint8_t top_disc : 1;
- uint8_t bottom_disc : 1;
- };
- uint32_t digitals;
- };
-
- void NetworkToHost() {
- // Apparently it sends the information out in little endian.
-#if 0
- using ::aos::ntoh;
-
- gyro_angle = ntoh(gyro_angle);
-
- right_drive = ntoh(right_drive);
- left_drive = ntoh(left_drive);
- shooter_angle = ntoh(shooter_angle);
- shooter = ntoh(shooter);
- indexer = ntoh(indexer);
- wrist = ntoh(wrist);
-
- capture_top_rise = ntoh(capture_top_rise);
- capture_top_fall = ntoh(capture_top_fall);
- capture_bottom_fall_delay = ntoh(capture_bottom_fall_delay);
- capture_wrist_rise = ntoh(capture_wrist_rise);
- capture_shooter_angle_rise = ntoh(capture_shooter_angle_rise);
-
- digitals = ntoh(digitals);
-#endif
- }
-} __attribute__((__packed__));
-
-} // namespace bot3
-
-#endif // BOT3_INPUT_GYRO_BOARD_DATA_H_
diff --git a/bot3/input/gyro_sensor_receiver.cc b/bot3/input/gyro_sensor_receiver.cc
index 625df57..add717f 100644
--- a/bot3/input/gyro_sensor_receiver.cc
+++ b/bot3/input/gyro_sensor_receiver.cc
@@ -49,6 +49,10 @@
gyro.MakeWithBuilder()
.angle(data()->gyro_angle / 16.0 / 1000.0 / 180.0 * M_PI)
.Send();
+
+ LOG(INFO, "Got encoder data: %lf, %lf\n",
+ drivetrain_translate(data()->main.right_drive),
+ drivetrain_translate(data()->main.left_drive));
drivetrain.position.MakeWithBuilder()
.right_encoder(drivetrain_translate(data()->main.right_drive))
diff --git a/bot3/output/atom_motor_writer.cc b/bot3/output/atom_motor_writer.cc
index 3d00b1b..c3a9858 100644
--- a/bot3/output/atom_motor_writer.cc
+++ b/bot3/output/atom_motor_writer.cc
@@ -39,8 +39,8 @@
}
shifters.FetchLatest();
if (shifters.get()) {
- SetSolenoid(1, shifters->set);
- SetSolenoid(2, !shifters->set);
+ SetSolenoid(7, shifters->set);
+ SetSolenoid(8, !shifters->set);
}
/*if (shooter.output.IsNewerThanMS(kOutputMaxAgeMS)) {