merging in changes "queued" up for after Davis
diff --git a/aos/linux_code/logging/binary_log_writer.cc b/aos/linux_code/logging/binary_log_writer.cc
index e7b1e9f..57eb33a 100644
--- a/aos/linux_code/logging/binary_log_writer.cc
+++ b/aos/linux_code/logging/binary_log_writer.cc
@@ -89,7 +89,7 @@
LOG(INFO, "Could not find aos_log-current\n");
printf("Could not find aos_log-current\n");
}
- if (asprintf(filename, "%s/aos_log-%d", directory, fileindex) == -1) {
+ if (asprintf(filename, "%s/aos_log-%03d", directory, fileindex) == -1) {
aos::Die("couldn't create final name because of %d (%s)\n",
errno, strerror(errno));
}
diff --git a/frc971/autonomous/auto.cc b/frc971/autonomous/auto.cc
index 9b51b63..107b380 100644
--- a/frc971/autonomous/auto.cc
+++ b/frc971/autonomous/auto.cc
@@ -121,7 +121,7 @@
void PositionClawForShot() {
// Turn the claw on, keep it straight up until the ball has been grabbed.
if (!control_loops::claw_queue_group.goal.MakeWithBuilder()
- .bottom_angle(0.87)
+ .bottom_angle(0.86)
.separation_angle(0.10)
.intake(4.0)
.centering(1.0)
diff --git a/frc971/constants.cc b/frc971/constants.cc
index bb6e391..31904f4 100755
--- a/frc971/constants.cc
+++ b/frc971/constants.cc
@@ -85,7 +85,7 @@
kCompHighGearRatio,
kCompLeftDriveShifter,
kCompRightDriveShifter,
- false,
+ true,
control_loops::MakeVelocityDrivetrainLoop,
control_loops::MakeDrivetrainLoop,
// ShooterLimits
diff --git a/frc971/control_loops/claw/claw.cc b/frc971/control_loops/claw/claw.cc
index f85613f..417df9f 100755
--- a/frc971/control_loops/claw/claw.cc
+++ b/frc971/control_loops/claw/claw.cc
@@ -613,8 +613,8 @@
doing_calibration_fine_tune_ = false;
if (!was_enabled_ && enabled) {
if (position) {
- top_claw_goal_ = position->top.position;
- bottom_claw_goal_ = position->bottom.position;
+ top_claw_goal_ = position->top.position + top_claw_.offset();
+ bottom_claw_goal_ = position->bottom.position + bottom_claw_.offset();
initial_separation_ =
position->top.position - position->bottom.position;
} else {
diff --git a/frc971/control_loops/shooter/shooter.cc b/frc971/control_loops/shooter/shooter.cc
index 3b03832..9de06a9 100755
--- a/frc971/control_loops/shooter/shooter.cc
+++ b/frc971/control_loops/shooter/shooter.cc
@@ -98,7 +98,7 @@
R(2, 0) += -A(1, 0) / A(1, 2) * (doffset);
}
LOG_STRUCT(
- INFO, "sensor edge",
+ DEBUG, "sensor edge (fake?)",
ShooterChangeCalibration(encoder_val, known_position, old_position,
absolute_position(), previous_offset, offset_));
}
diff --git a/frc971/input/joystick_reader.cc b/frc971/input/joystick_reader.cc
index 87287b7..55274f8 100644
--- a/frc971/input/joystick_reader.cc
+++ b/frc971/input/joystick_reader.cc
@@ -70,18 +70,19 @@
double intake_power;
};
+const double kIntakePower = 4.0;
+const double kGrabSeparation = -0.04;
+const double kShootSeparation = 0.11 + kGrabSeparation;
+
const ClawGoal kTuckGoal = {-2.273474, -0.749484};
-const ClawGoal kIntakeGoal = {-2.273474, 0.0};
+const ClawGoal kIntakeGoal = {-2.273474, kGrabSeparation};
const ClawGoal kIntakeOpenGoal = {-2.0, 1.2};
// TODO(austin): Tune these by hand...
const ClawGoal kFlippedTuckGoal = {2.733474, -0.75};
-const ClawGoal kFlippedIntakeGoal = {2.0, 0.0};
+const ClawGoal kFlippedIntakeGoal = {2.0, kGrabSeparation};
const ClawGoal kFlippedIntakeOpenGoal = {0.95, 1.0};
-const double kIntakePower = 4.0;
-const double kShootSeparation = 0.11;
-
//const ShotGoal kLongShotGoal = {
//{-M_PI / 2.0 + 0.46, kShootSeparation}, 120, false, kIntakePower};
const ShotGoal kLongShotGoal = {
@@ -172,7 +173,7 @@
: is_high_gear_(false),
shot_power_(80.0),
goal_angle_(0.0),
- separation_angle_(0.0),
+ separation_angle_(kGrabSeparation),
velocity_compensation_(false),
intake_power_(0.0),
was_running_(false) {}
@@ -282,7 +283,7 @@
}
if (data.IsPressed(kRollersIn) || data.IsPressed(kRollersOut)) {
intake_power_ = 0.0;
- separation_angle_ = 0.0;
+ separation_angle_ = kGrabSeparation;
}
static const double kAdjustClawGoalDeadband = 0.08;
diff --git a/frc971/input/sensor_receiver.cc b/frc971/input/sensor_receiver.cc
index 057966a..b44bb8d 100644
--- a/frc971/input/sensor_receiver.cc
+++ b/frc971/input/sensor_receiver.cc
@@ -134,7 +134,9 @@
State *state) {
::frc971::logging_structs::CapeReading reading_to_log(
cape_timestamp.sec(), cape_timestamp.nsec(),
- sizeof(*data), sonar_translate(data->main.ultrasonic_pulse_length));
+ sizeof(*data), sonar_translate(data->main.ultrasonic_pulse_length),
+ 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);
bool bad_gyro;
// TODO(brians): Switch to LogInterval for these things.
diff --git a/frc971/queues/to_log.q b/frc971/queues/to_log.q
index 77e87e3..ded9b64 100644
--- a/frc971/queues/to_log.q
+++ b/frc971/queues/to_log.q
@@ -5,4 +5,9 @@
uint32_t nsec;
uint64_t struct_size;
double sonar;
+
+ uint16_t left_low;
+ uint16_t left_high;
+ uint16_t right_low;
+ uint16_t right_high;
};