blob: a06bc3b60e1ff50da9e3fb7f5d6cf847221cc0e2 [file] [log] [blame]
Comran Morshed5323ecb2015-12-26 20:50:55 +00001#include "frc971/control_loops/drivetrain/drivetrain.h"
Brian Silverman17f503e2015-08-02 18:17:18 -07002
3#include <stdio.h>
4#include <sched.h>
5#include <cmath>
6#include <memory>
7#include "Eigen/Dense"
8
John Park33858a32018-09-28 23:05:48 -07009#include "aos/logging/logging.h"
10#include "aos/logging/queue_logging.h"
11#include "aos/logging/matrix_logging.h"
Brian Silverman17f503e2015-08-02 18:17:18 -070012
Austin Schuh3a378462019-01-04 21:48:04 -080013#include "frc971/control_loops/drivetrain/down_estimator.h"
Comran Morshed5323ecb2015-12-26 20:50:55 +000014#include "frc971/control_loops/drivetrain/drivetrain.q.h"
Austin Schuh3a378462019-01-04 21:48:04 -080015#include "frc971/control_loops/drivetrain/drivetrain_config.h"
Comran Morshed5323ecb2015-12-26 20:50:55 +000016#include "frc971/control_loops/drivetrain/polydrivetrain.h"
17#include "frc971/control_loops/drivetrain/ssdrivetrain.h"
Austin Schuh3a378462019-01-04 21:48:04 -080018#include "frc971/control_loops/runge_kutta.h"
Brian Silverman17f503e2015-08-02 18:17:18 -070019#include "frc971/queues/gyro.q.h"
20#include "frc971/shifter_hall_effect.h"
Austin Schuh05c5a612016-04-02 15:10:25 -070021#include "frc971/wpilib/imu.q.h"
Brian Silverman17f503e2015-08-02 18:17:18 -070022
Brian Silverman17f503e2015-08-02 18:17:18 -070023using frc971::sensors::gyro_reading;
Campbell Crowley2527ed22017-02-17 21:10:02 -080024using frc971::imu_values;
Austin Schuh9993fb32017-03-15 20:17:46 -070025using ::aos::monotonic_clock;
26namespace chrono = ::std::chrono;
Brian Silverman17f503e2015-08-02 18:17:18 -070027
Comran Morshed5323ecb2015-12-26 20:50:55 +000028namespace frc971 {
Brian Silverman17f503e2015-08-02 18:17:18 -070029namespace control_loops {
Austin Schuh6197a182015-11-28 16:04:40 -080030namespace drivetrain {
Brian Silverman17f503e2015-08-02 18:17:18 -070031
Austin Schuh55a13dc2019-01-27 22:39:03 -080032DrivetrainLoop::DrivetrainLoop(const DrivetrainConfig<double> &dt_config,
33 ::aos::EventLoop *event_loop,
34 const ::std::string &name)
Comran Morshed5323ecb2015-12-26 20:50:55 +000035 : aos::controls::ControlLoop<::frc971::control_loops::DrivetrainQueue>(
Austin Schuh55a13dc2019-01-27 22:39:03 -080036 event_loop, name),
Comran Morshed5323ecb2015-12-26 20:50:55 +000037 dt_config_(dt_config),
Austin Schuh41565602016-02-28 20:10:49 -080038 kf_(dt_config_.make_kf_drivetrain_loop()),
39 dt_openloop_(dt_config_, &kf_),
Austin Schuh093535c2016-03-05 23:21:00 -080040 dt_closedloop_(dt_config_, &kf_, &integrated_kf_heading_),
Austin Schuh05c5a612016-04-02 15:10:25 -070041 down_estimator_(MakeDownEstimatorLoop()),
Austin Schuh093535c2016-03-05 23:21:00 -080042 left_gear_(dt_config_.default_high_gear ? Gear::HIGH : Gear::LOW),
43 right_gear_(dt_config_.default_high_gear ? Gear::HIGH : Gear::LOW),
44 left_high_requested_(dt_config_.default_high_gear),
45 right_high_requested_(dt_config_.default_high_gear) {
Austin Schuh209f1702015-11-29 17:03:00 -080046 ::aos::controls::HPolytope<0>::Init();
Austin Schuh05c5a612016-04-02 15:10:25 -070047 down_U_.setZero();
Austin Schuh209f1702015-11-29 17:03:00 -080048}
49
Austin Schuh093535c2016-03-05 23:21:00 -080050int DrivetrainLoop::ControllerIndexFromGears() {
51 if (MaybeHigh(left_gear_)) {
52 if (MaybeHigh(right_gear_)) {
53 return 3;
54 } else {
55 return 2;
56 }
57 } else {
58 if (MaybeHigh(right_gear_)) {
59 return 1;
60 } else {
61 return 0;
62 }
63 }
64}
65
66Gear ComputeGear(double shifter_position,
67 const constants::ShifterHallEffect &shifter_config,
68 bool high_requested) {
69 if (shifter_position < shifter_config.clear_low) {
70 return Gear::LOW;
71 } else if (shifter_position > shifter_config.clear_high) {
72 return Gear::HIGH;
73 } else {
74 if (high_requested) {
75 return Gear::SHIFTING_UP;
76 } else {
77 return Gear::SHIFTING_DOWN;
78 }
79 }
80}
81
Austin Schuh3a378462019-01-04 21:48:04 -080082::Eigen::Matrix<double, 3, 1> DrivetrainLoop::PredictState(
83 const ::Eigen::Matrix<double, 3, 1> &xytheta_state,
84 const ::Eigen::Matrix<double, 7, 1> &state,
85 const ::Eigen::Matrix<double, 7, 1> &previous_state) const {
86 const double dt =
87 ::std::chrono::duration_cast<::std::chrono::duration<double>>(
88 dt_config_.dt)
89 .count();
90
91 const double distance_traveled =
92 (state(0) + state(2)) / 2.0 -
93 (previous_state(0) + previous_state(2)) / 2.0;
94
95 const double omega0 =
96 (previous_state(3) - previous_state(1)) / (dt_config_.robot_radius * 2.0);
97 const double omega1 = (state(3) - state(1)) / (dt_config_.robot_radius * 2.0);
98 const double alpha = (omega1 - omega0) / dt;
99
100 const double velocity_start = (previous_state(3) + previous_state(1)) / 2.0;
101 const double velocity_end = (state(3) + state(1)) / 2.0;
102
103 const double acceleration = (velocity_end - velocity_start) / dt;
104 const double velocity_offset =
105 distance_traveled / dt - 0.5 * acceleration * dt - velocity_start;
106 const double velocity0 = velocity_start + velocity_offset;
107
108 // TODO(austin): Substep 10x here. This is super important! ?
109 return RungeKutta(
110 [&dt, &velocity0, &acceleration, &omega0, &alpha](
111 double t, const ::Eigen::Matrix<double, 3, 1> &X) {
112 const double velocity1 = velocity0 + acceleration * t;
113 const double omega1 = omega0 + alpha * t;
114 const double theta = X(2);
115
116 return (::Eigen::Matrix<double, 3, 1>()
117 << ::std::cos(theta) * velocity1,
118 ::std::sin(theta) * velocity1, omega1)
119 .finished();
120 },
121 xytheta_state, 0.0,
122 ::std::chrono::duration_cast<::std::chrono::duration<double>>(
123 dt_config_.dt)
124 .count());
125}
126
Austin Schuh6197a182015-11-28 16:04:40 -0800127void DrivetrainLoop::RunIteration(
Comran Morshed5323ecb2015-12-26 20:50:55 +0000128 const ::frc971::control_loops::DrivetrainQueue::Goal *goal,
129 const ::frc971::control_loops::DrivetrainQueue::Position *position,
130 ::frc971::control_loops::DrivetrainQueue::Output *output,
131 ::frc971::control_loops::DrivetrainQueue::Status *status) {
Austin Schuh9993fb32017-03-15 20:17:46 -0700132 monotonic_clock::time_point monotonic_now = monotonic_clock::now();
133
Austin Schuh5900d142016-04-03 21:35:12 -0700134 if (!has_been_enabled_ && output) {
135 has_been_enabled_ = true;
136 down_estimator_.mutable_X_hat(1, 0) = 0.0;
137 }
138
Austin Schuh093535c2016-03-05 23:21:00 -0800139 // TODO(austin): Put gear detection logic here.
140 switch (dt_config_.shifter_type) {
141 case ShifterType::SIMPLE_SHIFTER:
142 // Force the right controller for simple shifters since we assume that
143 // gear switching is instantaneous.
144 if (left_high_requested_) {
145 left_gear_ = Gear::HIGH;
146 } else {
147 left_gear_ = Gear::LOW;
148 }
149 if (right_high_requested_) {
150 right_gear_ = Gear::HIGH;
151 } else {
152 right_gear_ = Gear::LOW;
153 }
154 break;
155 case ShifterType::HALL_EFFECT_SHIFTER:
156 left_gear_ = ComputeGear(position->left_shifter_position,
157 dt_config_.left_drive, left_high_requested_);
158 right_gear_ = ComputeGear(position->right_shifter_position,
159 dt_config_.right_drive, right_high_requested_);
160 break;
Adam Snaider18f44172016-10-22 15:30:21 -0700161 case ShifterType::NO_SHIFTER:
162 break;
Brian Silverman17f503e2015-08-02 18:17:18 -0700163 }
Brian Silverman17f503e2015-08-02 18:17:18 -0700164
Austin Schuhc5fceb82017-02-25 16:24:12 -0800165 kf_.set_index(ControllerIndexFromGears());
Kyle Stachowicz2f3c20f2017-07-13 16:04:05 -0700166
167 // Set the gear-logging parts of the status
168 if (status) {
169 status->gear_logging.left_state = static_cast<uint32_t>(left_gear_);
170 status->gear_logging.right_state = static_cast<uint32_t>(right_gear_);
171 status->gear_logging.left_loop_high = MaybeHigh(left_gear_);
172 status->gear_logging.right_loop_high = MaybeHigh(right_gear_);
173 status->gear_logging.controller_index = kf_.index();
Austin Schuh093535c2016-03-05 23:21:00 -0800174 }
Kyle Stachowicz2f3c20f2017-07-13 16:04:05 -0700175
Campbell Crowley2527ed22017-02-17 21:10:02 -0800176 const bool is_latest_imu_values = ::frc971::imu_values.FetchLatest();
177 if (is_latest_imu_values) {
Austin Schuh05c5a612016-04-02 15:10:25 -0700178 const double rate = -::frc971::imu_values->gyro_y;
179 const double accel_squared = ::frc971::imu_values->accelerometer_x *
180 ::frc971::imu_values->accelerometer_x +
181 ::frc971::imu_values->accelerometer_y *
182 ::frc971::imu_values->accelerometer_y +
183 ::frc971::imu_values->accelerometer_z *
184 ::frc971::imu_values->accelerometer_z;
Austin Schuhf0c05762016-04-03 16:06:49 -0700185 const double angle = ::std::atan2(::frc971::imu_values->accelerometer_x,
186 ::frc971::imu_values->accelerometer_z) +
Austin Schuh05c5a612016-04-02 15:10:25 -0700187 0.008;
Diana Burgessd0180f12018-03-21 21:24:17 -0700188
189 switch (dt_config_.imu_type) {
190 case IMUType::IMU_X:
191 last_accel_ = -::frc971::imu_values->accelerometer_x;
192 break;
193 case IMUType::IMU_Y:
194 last_accel_ = -::frc971::imu_values->accelerometer_y;
195 break;
196 }
197
Austin Schuh05c5a612016-04-02 15:10:25 -0700198 if (accel_squared > 1.03 || accel_squared < 0.97) {
199 LOG(DEBUG, "New IMU value, rejecting reading\n");
200 } else {
201 // -y is our gyro.
Austin Schuhf0c05762016-04-03 16:06:49 -0700202 // z accel is down
203 // x accel is the front of the robot pointed down.
Austin Schuh05c5a612016-04-02 15:10:25 -0700204 Eigen::Matrix<double, 1, 1> Y;
Austin Schuhdf79d112016-10-15 21:25:32 -0700205 Y(0, 0) = angle;
Austin Schuh05c5a612016-04-02 15:10:25 -0700206 down_estimator_.Correct(Y);
207 }
208
209 LOG(DEBUG,
210 "New IMU value from ADIS16448, rate is %f, angle %f, fused %f, bias "
211 "%f\n",
Austin Schuh3a378462019-01-04 21:48:04 -0800212 rate, angle, down_estimator_.X_hat(0), down_estimator_.X_hat(1));
Austin Schuhdf79d112016-10-15 21:25:32 -0700213 down_U_(0, 0) = rate;
Austin Schuh05c5a612016-04-02 15:10:25 -0700214 }
Austin Schuh3ad5ed82017-02-25 21:36:19 -0800215 down_estimator_.UpdateObserver(down_U_, ::aos::controls::kLoopFrequency);
Austin Schuh05c5a612016-04-02 15:10:25 -0700216
Austin Schuh093535c2016-03-05 23:21:00 -0800217 // TODO(austin): Signal the current gear to both loops.
218
Campbell Crowley2527ed22017-02-17 21:10:02 -0800219 switch (dt_config_.gyro_type) {
220 case GyroType::IMU_X_GYRO:
221 if (is_latest_imu_values) {
222 LOG_STRUCT(DEBUG, "using", *imu_values.get());
223 last_gyro_rate_ = imu_values->gyro_x;
Austin Schuh9993fb32017-03-15 20:17:46 -0700224 last_gyro_time_ = monotonic_now;
Campbell Crowley2527ed22017-02-17 21:10:02 -0800225 }
226 break;
227 case GyroType::IMU_Y_GYRO:
228 if (is_latest_imu_values) {
229 LOG_STRUCT(DEBUG, "using", *imu_values.get());
230 last_gyro_rate_ = imu_values->gyro_y;
Austin Schuh9993fb32017-03-15 20:17:46 -0700231 last_gyro_time_ = monotonic_now;
Campbell Crowley2527ed22017-02-17 21:10:02 -0800232 }
233 break;
234 case GyroType::IMU_Z_GYRO:
235 if (is_latest_imu_values) {
236 LOG_STRUCT(DEBUG, "using", *imu_values.get());
237 last_gyro_rate_ = imu_values->gyro_z;
Austin Schuh9993fb32017-03-15 20:17:46 -0700238 last_gyro_time_ = monotonic_now;
Campbell Crowley2527ed22017-02-17 21:10:02 -0800239 }
240 break;
Austin Schuh90b43b42019-01-04 07:45:05 +1100241 case GyroType::FLIPPED_IMU_Z_GYRO:
242 if (is_latest_imu_values) {
243 LOG_STRUCT(DEBUG, "using", *imu_values.get());
244 last_gyro_rate_ = -imu_values->gyro_z;
245 last_gyro_time_ = monotonic_now;
246 }
247 break;
Campbell Crowley2527ed22017-02-17 21:10:02 -0800248 case GyroType::SPARTAN_GYRO:
249 if (gyro_reading.FetchLatest()) {
250 LOG_STRUCT(DEBUG, "using", *gyro_reading.get());
251 last_gyro_rate_ = gyro_reading->velocity;
Austin Schuh9993fb32017-03-15 20:17:46 -0700252 last_gyro_time_ = monotonic_now;
Campbell Crowley2527ed22017-02-17 21:10:02 -0800253 }
254 break;
255 case GyroType::FLIPPED_SPARTAN_GYRO:
256 if (gyro_reading.FetchLatest()) {
257 LOG_STRUCT(DEBUG, "using", *gyro_reading.get());
258 last_gyro_rate_ = -gyro_reading->velocity;
Austin Schuh9993fb32017-03-15 20:17:46 -0700259 last_gyro_time_ = monotonic_now;
Campbell Crowley2527ed22017-02-17 21:10:02 -0800260 }
261 break;
262 default:
263 LOG(FATAL, "invalid gyro configured");
264 break;
Austin Schuh9ab4d9d2016-02-16 23:55:44 -0800265 }
266
Austin Schuh9993fb32017-03-15 20:17:46 -0700267 if (monotonic_now > last_gyro_time_ + chrono::milliseconds(20)) {
268 last_gyro_rate_ = 0.0;
269 }
270
Austin Schuh6613a072016-01-06 19:54:48 -0800271 {
Diana Burgessd0180f12018-03-21 21:24:17 -0700272 Eigen::Matrix<double, 4, 1> Y;
273 Y << position->left_encoder, position->right_encoder, last_gyro_rate_,
274 last_accel_;
Austin Schuh6613a072016-01-06 19:54:48 -0800275 kf_.Correct(Y);
Austin Schuh3a378462019-01-04 21:48:04 -0800276
277 // We are going to choose to integrate velocity to get position by assuming
278 // that velocity is a linear function of time. For drivetrains with large
279 // amounts of mass, we won't get large changes in acceleration over a 5 ms
280 // timestep. Do note, the only place that this matters is when we are
281 // talking about the curvature errors introduced by integration. The
282 // velocities are scaled such that the distance traveled is correct.
283 //
284 // We want to do this after the kalman filter runs so we take into account
285 // the encoder and gyro corrections.
286 //
287 // Start by computing the beginning and ending linear and angular
288 // velocities.
289 // To handle 0 velocity well, compute the offset required to be added to
290 // both velocities to make the robot travel the correct distance.
291
292 xytheta_state_.block<3, 1>(0, 0) = PredictState(
293 xytheta_state_.block<3, 1>(0, 0), kf_.X_hat(), last_state_);
294
295 // Use trapezoidal integration for the gyro heading since it's more
296 // accurate.
297 const double average_angular_velocity =
298 ((kf_.X_hat(3) - kf_.X_hat(1)) + (last_state_(3) - last_state_(1))) /
299 2.0 / (dt_config_.robot_radius * 2.0);
300
Austin Schuhbb735b72019-01-03 12:58:41 -0800301 integrated_kf_heading_ +=
Austin Schuh3a378462019-01-04 21:48:04 -0800302 ::std::chrono::duration_cast<::std::chrono::duration<double>>(
303 dt_config_.dt)
304 .count() *
305 average_angular_velocity;
306
307 // Copy over the gyro heading.
308 xytheta_state_(2) = integrated_kf_heading_;
309 // Copy over the velocities heading.
310 xytheta_state_(3) = kf_.X_hat(1);
311 xytheta_state_(4) = kf_.X_hat(3);
312 // Copy over the voltage errors.
313 xytheta_state_.block<2, 1>(5, 0) = kf_.X_hat().block<2, 1>(4, 0);
Austin Schuh093535c2016-03-05 23:21:00 -0800314
315 // gyro_heading = (real_right - real_left) / width
316 // wheel_heading = (wheel_right - wheel_left) / width
317 // gyro_heading + offset = wheel_heading
318 // gyro_goal + offset = wheel_goal
319 // offset = wheel_heading - gyro_heading
320
321 // gyro_goal + wheel_heading - gyro_heading = wheel_goal
Austin Schuh6613a072016-01-06 19:54:48 -0800322 }
323
Austin Schuh093535c2016-03-05 23:21:00 -0800324 dt_openloop_.SetPosition(position, left_gear_, right_gear_);
325
Austin Schuh78379ea2019-01-04 20:39:45 -0800326 int controller_type = 0;
Brian Silverman17f503e2015-08-02 18:17:18 -0700327 if (goal) {
Austin Schuh78379ea2019-01-04 20:39:45 -0800328 controller_type = goal->controller_type;
Brian Silverman17f503e2015-08-02 18:17:18 -0700329
Austin Schuh093535c2016-03-05 23:21:00 -0800330 dt_closedloop_.SetGoal(*goal);
331 dt_openloop_.SetGoal(*goal);
Brian Silverman17f503e2015-08-02 18:17:18 -0700332 }
333
Austin Schuheeec74a2019-01-27 20:58:59 -0800334 dt_openloop_.Update(robot_state().voltage_battery);
Brian Silverman17f503e2015-08-02 18:17:18 -0700335
Austin Schuh78379ea2019-01-04 20:39:45 -0800336 dt_closedloop_.Update(output != NULL && controller_type == 1);
337
338 switch (controller_type) {
339 case 0:
340 dt_openloop_.SetOutput(output);
341 break;
342 case 1:
343 dt_closedloop_.SetOutput(output);
344 break;
Brian Silverman17f503e2015-08-02 18:17:18 -0700345 }
346
Austin Schuh093535c2016-03-05 23:21:00 -0800347 // The output should now contain the shift request.
348
Brian Silverman17f503e2015-08-02 18:17:18 -0700349 // set the output status of the control loop state
350 if (status) {
Austin Schuh3a378462019-01-04 21:48:04 -0800351 status->robot_speed = (kf_.X_hat(1) + kf_.X_hat(3)) / 2.0;
Brian Silverman17f503e2015-08-02 18:17:18 -0700352
Austin Schuh093535c2016-03-05 23:21:00 -0800353 Eigen::Matrix<double, 2, 1> linear =
Austin Schuhd91c0d22016-10-15 21:24:28 -0700354 dt_config_.LeftRightToLinear(kf_.X_hat());
Austin Schuh093535c2016-03-05 23:21:00 -0800355 Eigen::Matrix<double, 2, 1> angular =
Austin Schuhd91c0d22016-10-15 21:24:28 -0700356 dt_config_.LeftRightToAngular(kf_.X_hat());
Austin Schuh093535c2016-03-05 23:21:00 -0800357
358 angular(0, 0) = integrated_kf_heading_;
359
360 Eigen::Matrix<double, 4, 1> gyro_left_right =
Austin Schuhd91c0d22016-10-15 21:24:28 -0700361 dt_config_.AngularLinearToLeftRight(linear, angular);
Austin Schuh093535c2016-03-05 23:21:00 -0800362
363 status->estimated_left_position = gyro_left_right(0, 0);
364 status->estimated_right_position = gyro_left_right(2, 0);
365
366 status->estimated_left_velocity = gyro_left_right(1, 0);
367 status->estimated_right_velocity = gyro_left_right(3, 0);
368 status->output_was_capped = dt_closedloop_.output_was_capped();
369 status->uncapped_left_voltage = kf_.U_uncapped(0, 0);
370 status->uncapped_right_voltage = kf_.U_uncapped(1, 0);
371
Austin Schuh3a378462019-01-04 21:48:04 -0800372 status->left_voltage_error = kf_.X_hat(4);
373 status->right_voltage_error = kf_.X_hat(5);
374 status->estimated_angular_velocity_error = kf_.X_hat(6);
Austin Schuh093535c2016-03-05 23:21:00 -0800375 status->estimated_heading = integrated_kf_heading_;
Austin Schuh3a378462019-01-04 21:48:04 -0800376
377 status->x = xytheta_state_(0);
378 status->y = xytheta_state_(1);
379 status->theta = xytheta_state_(2);
380
381 status->ground_angle = down_estimator_.X_hat(0) + dt_config_.down_offset;
Austin Schuh41565602016-02-28 20:10:49 -0800382
383 dt_openloop_.PopulateStatus(status);
Austin Schuh093535c2016-03-05 23:21:00 -0800384 dt_closedloop_.PopulateStatus(status);
Brian Silverman17f503e2015-08-02 18:17:18 -0700385 }
Austin Schuh209f1702015-11-29 17:03:00 -0800386
Austin Schuh209f1702015-11-29 17:03:00 -0800387 double left_voltage = 0.0;
388 double right_voltage = 0.0;
389 if (output) {
390 left_voltage = output->left_voltage;
391 right_voltage = output->right_voltage;
Austin Schuh093535c2016-03-05 23:21:00 -0800392 left_high_requested_ = output->left_high;
393 right_high_requested_ = output->right_high;
Austin Schuh209f1702015-11-29 17:03:00 -0800394 }
395
Austin Schuheeec74a2019-01-27 20:58:59 -0800396 const double scalar = robot_state().voltage_battery / 12.0;
Austin Schuh209f1702015-11-29 17:03:00 -0800397
398 left_voltage *= scalar;
399 right_voltage *= scalar;
400
Austin Schuh209f1702015-11-29 17:03:00 -0800401 // To validate, look at the following:
402
403 // Observed - dx/dt velocity for left, right.
404
405 // Angular velocity error compared to the gyro
406 // Gyro heading vs left-right
407 // Voltage error.
408
409 Eigen::Matrix<double, 2, 1> U;
Austin Schuhdf79d112016-10-15 21:25:32 -0700410 U(0, 0) = last_left_voltage_;
411 U(1, 0) = last_right_voltage_;
Austin Schuh209f1702015-11-29 17:03:00 -0800412 last_left_voltage_ = left_voltage;
413 last_right_voltage_ = right_voltage;
414
Austin Schuh3a378462019-01-04 21:48:04 -0800415 last_state_ = kf_.X_hat();
416 kf_.UpdateObserver(U, dt_config_.dt);
Brian Silverman17f503e2015-08-02 18:17:18 -0700417}
418
Adam Snaiderbc918b62016-02-27 21:03:39 -0800419void DrivetrainLoop::Zero(
420 ::frc971::control_loops::DrivetrainQueue::Output *output) {
421 output->left_voltage = 0;
422 output->right_voltage = 0;
423 output->left_high = dt_config_.default_high_gear;
424 output->right_high = dt_config_.default_high_gear;
425}
426
Austin Schuh6197a182015-11-28 16:04:40 -0800427} // namespace drivetrain
Brian Silverman17f503e2015-08-02 18:17:18 -0700428} // namespace control_loops
Comran Morshed5323ecb2015-12-26 20:50:55 +0000429} // namespace frc971