blob: 831c0e8f9871d08c62e4748897a2d32b1a48ba2d [file] [log] [blame]
Comran Morshed0d6cf9b2015-06-17 19:29:57 +00001#include <stdio.h>
2#include <string.h>
3#include <unistd.h>
4#include <inttypes.h>
5
6#include <thread>
7#include <mutex>
8#include <functional>
9
10#include "aos/common/logging/logging.h"
11#include "aos/common/logging/queue_logging.h"
12#include "aos/common/time.h"
13#include "aos/common/util/log_interval.h"
14#include "aos/common/util/phased_loop.h"
15#include "aos/common/util/wrapping_counter.h"
16#include "aos/common/stl_mutex.h"
17#include "aos/linux_code/init.h"
18#include "aos/common/messages/robot_state.q.h"
19
20#include "frc971/control_loops/control_loops.q.h"
21#include "bot3/control_loops/drivetrain/drivetrain.q.h"
Comran Morshede140e382015-08-19 20:35:25 +000022#include "bot3/control_loops/elevator/elevator.q.h"
23#include "bot3/control_loops/intake/intake.q.h"
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000024
25#include "frc971/wpilib/hall_effect.h"
26#include "frc971/wpilib/joystick_sender.h"
27#include "frc971/wpilib/loop_output_handler.h"
28#include "frc971/wpilib/buffered_solenoid.h"
29#include "frc971/wpilib/buffered_pcm.h"
30#include "frc971/wpilib/gyro_sender.h"
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000031#include "frc971/wpilib/logging.q.h"
32#include "bot3/control_loops/drivetrain/drivetrain.h"
Comran Morshede140e382015-08-19 20:35:25 +000033#include "bot3/control_loops/elevator/elevator.h"
34#include "bot3/control_loops/intake/intake.h"
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000035
36#include "Encoder.h"
37#include "Talon.h"
38#include "DriverStation.h"
39#include "AnalogInput.h"
40#include "Compressor.h"
41#include "Relay.h"
42#include "RobotBase.h"
43#include "dma.h"
44#include "ControllerPower.h"
45
46#ifndef M_PI
47#define M_PI 3.14159265358979323846
48#endif
49
50using ::aos::util::SimpleLogInterval;
51using ::bot3::control_loops::drivetrain_queue;
Comran Morshede140e382015-08-19 20:35:25 +000052using ::bot3::control_loops::elevator_queue;
53using ::bot3::control_loops::intake_queue;
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000054using ::frc971::wpilib::BufferedPcm;
Comran Morshede140e382015-08-19 20:35:25 +000055using ::frc971::wpilib::BufferedSolenoid;
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000056using ::frc971::wpilib::LoopOutputHandler;
57using ::frc971::wpilib::JoystickSender;
58using ::frc971::wpilib::GyroSender;
Comran Morshede140e382015-08-19 20:35:25 +000059using ::frc971::wpilib::HallEffect;
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000060
61namespace bot3 {
62namespace wpilib {
63
64double drivetrain_translate(int32_t in) {
Austin Schuh316ab462015-09-13 04:44:40 +000065 return static_cast<double>(in) / (256.0 /*cpr*/ * 4.0 /*4x*/) *
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000066 ::bot3::control_loops::kDrivetrainEncoderRatio *
67 (4 /*wheel diameter*/ * 2.54 / 100.0 * M_PI);
68}
69
Comran Morshede140e382015-08-19 20:35:25 +000070double elevator_translate(int32_t in) {
71 return static_cast<double>(in) / (512.0 /*cpr*/ * 4.0 /*4x*/) *
72 ::bot3::control_loops::kElevEncoderRatio * (2 * M_PI /*radians*/) *
Austin Schuh316ab462015-09-13 04:44:40 +000073 ::bot3::control_loops::kElevChainReduction *
Comran Morshede140e382015-08-19 20:35:25 +000074 ::bot3::control_loops::kElevGearboxOutputRadianDistance;
75}
76
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000077static const double kMaximumEncoderPulsesPerSecond =
Comran Morshede140e382015-08-19 20:35:25 +000078 4650.0 /* free speed RPM */ * 18.0 / 48.0 /* belt reduction */ /
79 60.0 /* seconds / minute */ * 512.0 /* CPR */ *
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000080 4.0 /* index pulse = 1/4 cycle */;
81
Comran Morshede140e382015-08-19 20:35:25 +000082// Reads in our inputs. (sensors, voltages, etc.)
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000083class SensorReader {
84 public:
85 SensorReader() {
86 // Set it to filter out anything shorter than 1/4 of the minimum pulse width
87 // we should ever see.
88 filter_.SetPeriodNanoSeconds(
89 static_cast<int>(1 / 4.0 / kMaximumEncoderPulsesPerSecond * 1e9 + 0.5));
90 }
91
Comran Morshede140e382015-08-19 20:35:25 +000092 // Drivetrain setters.
Comran Morshed0d6cf9b2015-06-17 19:29:57 +000093 void set_left_encoder(::std::unique_ptr<Encoder> left_encoder) {
94 left_encoder_ = ::std::move(left_encoder);
95 }
96
97 void set_right_encoder(::std::unique_ptr<Encoder> right_encoder) {
98 right_encoder_ = ::std::move(right_encoder);
99 }
100
Comran Morshede140e382015-08-19 20:35:25 +0000101 // Elevator setters.
102 void set_elevator_encoder(::std::unique_ptr<Encoder> encoder) {
103 filter_.Add(encoder.get());
104 elevator_encoder_ = ::std::move(encoder);
105 }
106
107 void set_elevator_zeroing_hall_effect(::std::unique_ptr<HallEffect> hall) {
108 zeroing_hall_effect_ = ::std::move(hall);
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000109 }
110
111 void operator()() {
112 LOG(INFO, "In sensor reader thread\n");
113 ::aos::SetCurrentThreadName("SensorReader");
114
115 my_pid_ = getpid();
116 ds_ = DriverStation::GetInstance();
117
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000118 LOG(INFO, "Things are now started\n");
119
120 ::aos::SetCurrentThreadRealtimePriority(kPriority);
121 while (run_) {
122 ::aos::time::PhasedLoopXMS(5, 4000);
123 RunIteration();
124 }
125 }
126
127 void RunIteration() {
Comran Morshede140e382015-08-19 20:35:25 +0000128 // General
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000129 {
130 auto new_state = ::aos::robot_state.MakeMessage();
131
132 new_state->reader_pid = my_pid_;
133 new_state->outputs_enabled = ds_->IsSysActive();
134 new_state->browned_out = ds_->IsSysBrownedOut();
135
136 new_state->is_3v3_active = ControllerPower::GetEnabled3V3();
137 new_state->is_5v_active = ControllerPower::GetEnabled5V();
138 new_state->voltage_3v3 = ControllerPower::GetVoltage3V3();
139 new_state->voltage_5v = ControllerPower::GetVoltage5V();
140
141 new_state->voltage_roborio_in = ControllerPower::GetInputVoltage();
142 new_state->voltage_battery = ds_->GetBatteryVoltage();
143
144 LOG_STRUCT(DEBUG, "robot_state", *new_state);
145
146 new_state.Send();
147 }
148
Comran Morshede140e382015-08-19 20:35:25 +0000149 // Drivetrain
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000150 {
151 auto drivetrain_message = drivetrain_queue.position.MakeMessage();
152 drivetrain_message->right_encoder =
153 -drivetrain_translate(right_encoder_->GetRaw());
154 drivetrain_message->left_encoder =
155 drivetrain_translate(left_encoder_->GetRaw());
156
157 drivetrain_message.Send();
158 }
159
Comran Morshede140e382015-08-19 20:35:25 +0000160 // Elevator
161 {
162 // Update control loop positions.
163 auto elevator_message = elevator_queue.position.MakeMessage();
164 elevator_message->encoder =
165 elevator_translate(elevator_encoder_->GetRaw());
166 elevator_message->bottom_hall_effect =
167 zeroing_hall_effect_->Get();
168
169 elevator_message.Send();
170 }
Austin Schuha3b2eef2015-09-13 07:52:02 +0000171
172 // Intake
173 {
174 auto intake_message = intake_queue.position.MakeMessage();
175 intake_message.Send();
176 }
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000177 }
178
179 void Quit() { run_ = false; }
180
181 private:
182 static const int kPriority = 30;
183 static const int kInterruptPriority = 55;
184
185 int32_t my_pid_;
186 DriverStation *ds_;
187
Comran Morshede140e382015-08-19 20:35:25 +0000188 ::std::unique_ptr<Encoder> left_encoder_, right_encoder_, elevator_encoder_;
189 ::std::unique_ptr<HallEffect> zeroing_hall_effect_;
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000190
191 ::std::atomic<bool> run_{true};
192 DigitalGlitchFilter filter_;
193};
194
Comran Morshede140e382015-08-19 20:35:25 +0000195// Writes out our pneumatic outputs.
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000196class SolenoidWriter {
197 public:
198 SolenoidWriter(const ::std::unique_ptr<::frc971::wpilib::BufferedPcm> &pcm)
Jasmine Zhouda77c5f2015-09-12 15:16:10 -0700199 : pcm_(pcm),
200 elevator_(".bot3.control_loops.elevator_queue.output"),
201 intake_(".bot3.control_loops.intake_queue.output") {}
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000202
203 void set_pressure_switch(::std::unique_ptr<DigitalSource> pressure_switch) {
204 pressure_switch_ = ::std::move(pressure_switch);
205 }
206
207 void set_compressor_relay(::std::unique_ptr<Relay> compressor_relay) {
208 compressor_relay_ = ::std::move(compressor_relay);
209 }
210
Comran Morshede140e382015-08-19 20:35:25 +0000211 void set_elevator_passive_support(
212 ::std::unique_ptr<BufferedSolenoid> elevator_passive_support) {
213 elevator_passive_support_ = ::std::move(elevator_passive_support);
214 }
215
Jasmine Zhouda77c5f2015-09-12 15:16:10 -0700216 void set_elevator_can_support(
217 ::std::unique_ptr<BufferedSolenoid> elevator_can_support) {
218 elevator_can_support_ = ::std::move(elevator_can_support);
219 }
220
221 void set_intake_claw(::std::unique_ptr<BufferedSolenoid> intake_claw) {
222 intake_claw_ = ::std::move(intake_claw);
223 }
224
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000225 void operator()() {
226 ::aos::SetCurrentThreadName("Solenoids");
227 ::aos::SetCurrentThreadRealtimePriority(30);
228
229 while (run_) {
230 ::aos::time::PhasedLoopXMS(20, 1000);
231
Comran Morshede140e382015-08-19 20:35:25 +0000232 // Elevator
233 {
234 elevator_.FetchLatest();
235 if (elevator_.get()) {
236 LOG_STRUCT(DEBUG, "solenoids", *elevator_);
Austin Schuha3b2eef2015-09-13 07:52:02 +0000237 elevator_passive_support_->Set(!elevator_->passive_support);
238 elevator_can_support_->Set(!elevator_->can_support);
Jasmine Zhouda77c5f2015-09-12 15:16:10 -0700239 }
240 }
241
242 // Intake
243 {
244 intake_.FetchLatest();
245 if (intake_.get()) {
246 LOG_STRUCT(DEBUG, "solenoids", *intake_);
247 intake_claw_->Set(intake_->claw_closed);
Comran Morshede140e382015-08-19 20:35:25 +0000248 }
249 }
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000250
Comran Morshede140e382015-08-19 20:35:25 +0000251 // Compressor
252 ::aos::joystick_state.FetchLatest();
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000253 {
254 ::frc971::wpilib::PneumaticsToLog to_log;
255 {
Comran Morshede140e382015-08-19 20:35:25 +0000256 // Refill if pneumatic pressure goes too low.
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000257 const bool compressor_on = !pressure_switch_->Get();
258 to_log.compressor_on = compressor_on;
259 if (compressor_on) {
260 compressor_relay_->Set(Relay::kForward);
261 } else {
262 compressor_relay_->Set(Relay::kOff);
263 }
264 }
265
266 pcm_->Flush();
267 to_log.read_solenoids = pcm_->GetAll();
268 LOG_STRUCT(DEBUG, "pneumatics info", to_log);
269 }
270 }
271 }
272
273 void Quit() { run_ = false; }
274
275 private:
276 const ::std::unique_ptr<BufferedPcm> &pcm_;
Comran Morshede140e382015-08-19 20:35:25 +0000277
278 ::std::unique_ptr<BufferedSolenoid> elevator_passive_support_;
Jasmine Zhouda77c5f2015-09-12 15:16:10 -0700279 ::std::unique_ptr<BufferedSolenoid> elevator_can_support_;
280 ::std::unique_ptr<BufferedSolenoid> intake_claw_;
Comran Morshede140e382015-08-19 20:35:25 +0000281
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000282 ::std::unique_ptr<DigitalSource> pressure_switch_;
283 ::std::unique_ptr<Relay> compressor_relay_;
284
Comran Morshede140e382015-08-19 20:35:25 +0000285 ::aos::Queue<::bot3::control_loops::ElevatorQueue::Output> elevator_;
Jasmine Zhouda77c5f2015-09-12 15:16:10 -0700286 ::aos::Queue<::bot3::control_loops::IntakeQueue::Output> intake_;
Comran Morshede140e382015-08-19 20:35:25 +0000287
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000288 ::std::atomic<bool> run_{true};
289};
290
Comran Morshede140e382015-08-19 20:35:25 +0000291// Writes out drivetrain voltages.
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000292class DrivetrainWriter : public LoopOutputHandler {
293 public:
294 void set_left_drivetrain_talon(::std::unique_ptr<Talon> t) {
295 left_drivetrain_talon_ = ::std::move(t);
296 }
297
298 void set_right_drivetrain_talon(::std::unique_ptr<Talon> t) {
299 right_drivetrain_talon_ = ::std::move(t);
300 }
301
302 private:
303 virtual void Read() override {
304 ::bot3::control_loops::drivetrain_queue.output.FetchAnother();
305 }
306
307 virtual void Write() override {
308 auto &queue = ::bot3::control_loops::drivetrain_queue.output;
309 LOG_STRUCT(DEBUG, "will output", *queue);
310 left_drivetrain_talon_->Set(queue->left_voltage / 12.0);
311 right_drivetrain_talon_->Set(-queue->right_voltage / 12.0);
312 }
313
314 virtual void Stop() override {
315 LOG(WARNING, "drivetrain output too old\n");
316 left_drivetrain_talon_->Disable();
317 right_drivetrain_talon_->Disable();
318 }
319
320 ::std::unique_ptr<Talon> left_drivetrain_talon_;
321 ::std::unique_ptr<Talon> right_drivetrain_talon_;
322};
323
Comran Morshede140e382015-08-19 20:35:25 +0000324// Writes out elevator voltages.
325class ElevatorWriter : public LoopOutputHandler {
326 public:
Jasmine Zhou954419a2015-09-12 18:31:31 -0700327 void set_elevator_talon1(::std::unique_ptr<Talon> t) {
328 elevator_talon1_ = ::std::move(t);
329 }
330 void set_elevator_talon2(::std::unique_ptr<Talon> t) {
331 elevator_talon2_ = ::std::move(t);
Comran Morshede140e382015-08-19 20:35:25 +0000332 }
333
334 private:
335 virtual void Read() override {
336 ::bot3::control_loops::elevator_queue.output.FetchAnother();
337 }
338
339 virtual void Write() override {
340 auto &queue = ::bot3::control_loops::elevator_queue.output;
341 LOG_STRUCT(DEBUG, "will output", *queue);
Jasmine Zhou954419a2015-09-12 18:31:31 -0700342 elevator_talon1_->Set(queue->elevator / 12.0);
Austin Schuha3b2eef2015-09-13 07:52:02 +0000343 elevator_talon2_->Set(-queue->elevator / 12.0);
Comran Morshede140e382015-08-19 20:35:25 +0000344 }
345
346 virtual void Stop() override {
347 LOG(WARNING, "Elevator output too old.\n");
Jasmine Zhou954419a2015-09-12 18:31:31 -0700348 elevator_talon1_->Disable();
349 elevator_talon2_->Disable();
Comran Morshede140e382015-08-19 20:35:25 +0000350 }
351
Jasmine Zhou954419a2015-09-12 18:31:31 -0700352 ::std::unique_ptr<Talon> elevator_talon1_;
353 ::std::unique_ptr<Talon> elevator_talon2_;
Comran Morshede140e382015-08-19 20:35:25 +0000354};
355
356// Writes out intake voltages.
357class IntakeWriter : public LoopOutputHandler {
358 public:
Jasmine Zhou954419a2015-09-12 18:31:31 -0700359 void set_intake_talon1(::std::unique_ptr<Talon> t) {
360 intake_talon1_ = ::std::move(t);
Comran Morshede140e382015-08-19 20:35:25 +0000361 }
Jasmine Zhou954419a2015-09-12 18:31:31 -0700362 void set_intake_talon2(::std::unique_ptr<Talon> t) {
363 intake_talon2_ = ::std::move(t);
364 }
365
Comran Morshede140e382015-08-19 20:35:25 +0000366
367 private:
368 virtual void Read() override {
369 ::bot3::control_loops::intake_queue.output.FetchAnother();
370 }
371
372 virtual void Write() override {
373 auto &queue = ::bot3::control_loops::intake_queue.output;
374 LOG_STRUCT(DEBUG, "will output", *queue);
Jasmine Zhou954419a2015-09-12 18:31:31 -0700375 intake_talon1_->Set(queue->intake / 12.0);
Austin Schuha3b2eef2015-09-13 07:52:02 +0000376 intake_talon2_->Set(-queue->intake / 12.0);
Comran Morshede140e382015-08-19 20:35:25 +0000377 }
378
379 virtual void Stop() override {
380 LOG(WARNING, "Intake output too old.\n");
Jasmine Zhou954419a2015-09-12 18:31:31 -0700381 intake_talon1_->Disable();
382 intake_talon2_->Disable();
Comran Morshede140e382015-08-19 20:35:25 +0000383 }
384
Jasmine Zhou954419a2015-09-12 18:31:31 -0700385 ::std::unique_ptr<Talon> intake_talon1_;
386 ::std::unique_ptr<Talon> intake_talon2_;
Comran Morshede140e382015-08-19 20:35:25 +0000387};
388
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000389// TODO(brian): Replace this with ::std::make_unique once all our toolchains
390// have support.
391template <class T, class... U>
392std::unique_ptr<T> make_unique(U &&... u) {
393 return std::unique_ptr<T>(new T(std::forward<U>(u)...));
394}
395
396class WPILibRobot : public RobotBase {
397 public:
398 ::std::unique_ptr<Encoder> encoder(int index) {
399 return make_unique<Encoder>(10 + index * 2, 11 + index * 2, false,
400 Encoder::k4X);
401 }
402 virtual void StartCompetition() {
403 ::aos::InitNRT();
404 ::aos::SetCurrentThreadName("StartCompetition");
405
406 JoystickSender joystick_sender;
407 ::std::thread joystick_thread(::std::ref(joystick_sender));
408
409 SensorReader reader;
410 LOG(INFO, "Creating the reader\n");
411
Jasmine Zhou954419a2015-09-12 18:31:31 -0700412 reader.set_elevator_encoder(encoder(6));
Comran Morshede140e382015-08-19 20:35:25 +0000413 reader.set_elevator_zeroing_hall_effect(
414 make_unique<HallEffect>(6));
415
Jasmine Zhou954419a2015-09-12 18:31:31 -0700416 reader.set_left_encoder(encoder(0));
417 reader.set_right_encoder(encoder(1));
Comran Morshede140e382015-08-19 20:35:25 +0000418
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000419 ::std::thread reader_thread(::std::ref(reader));
420 GyroSender gyro_sender;
421 ::std::thread gyro_thread(::std::ref(gyro_sender));
422
423 DrivetrainWriter drivetrain_writer;
424 drivetrain_writer.set_left_drivetrain_talon(
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000425 ::std::unique_ptr<Talon>(new Talon(0)));
Jasmine Zhou954419a2015-09-12 18:31:31 -0700426 drivetrain_writer.set_right_drivetrain_talon(
427 ::std::unique_ptr<Talon>(new Talon(7)));
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000428 ::std::thread drivetrain_writer_thread(::std::ref(drivetrain_writer));
429
Comran Morshede140e382015-08-19 20:35:25 +0000430 ElevatorWriter elevator_writer;
Jasmine Zhou954419a2015-09-12 18:31:31 -0700431 elevator_writer.set_elevator_talon1(::std::unique_ptr<Talon>(new Talon(1)));
432 elevator_writer.set_elevator_talon2(::std::unique_ptr<Talon>(new Talon(6)));
Austin Schuha3b2eef2015-09-13 07:52:02 +0000433 ::std::thread elevator_writer_thread(::std::ref(elevator_writer));
Comran Morshede140e382015-08-19 20:35:25 +0000434
435 IntakeWriter intake_writer;
Jasmine Zhou954419a2015-09-12 18:31:31 -0700436 intake_writer.set_intake_talon1(::std::unique_ptr<Talon>(new Talon(2)));
437 intake_writer.set_intake_talon2(::std::unique_ptr<Talon>(new Talon(5)));
Austin Schuha3b2eef2015-09-13 07:52:02 +0000438 ::std::thread intake_writer_thread(::std::ref(intake_writer));
Comran Morshede140e382015-08-19 20:35:25 +0000439
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000440 ::std::unique_ptr<::frc971::wpilib::BufferedPcm> pcm(
441 new ::frc971::wpilib::BufferedPcm());
442 SolenoidWriter solenoid_writer(pcm);
443 solenoid_writer.set_pressure_switch(make_unique<DigitalInput>(9));
444 solenoid_writer.set_compressor_relay(make_unique<Relay>(0));
Jasmine Zhouda77c5f2015-09-12 15:16:10 -0700445 // TODO (jasmine): Find solenoid numbers
446 solenoid_writer.set_elevator_passive_support(pcm->MakeSolenoid(0));
447 solenoid_writer.set_elevator_can_support(pcm->MakeSolenoid(1));
448 solenoid_writer.set_intake_claw(pcm->MakeSolenoid(2));
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000449 ::std::thread solenoid_thread(::std::ref(solenoid_writer));
Comran Morshede140e382015-08-19 20:35:25 +0000450 // TODO(comran): Find talon/encoder numbers ^^^
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000451
452 // Wait forever. Not much else to do...
453 PCHECK(select(0, nullptr, nullptr, nullptr, nullptr));
454
455 LOG(ERROR, "Exiting WPILibRobot\n");
456
457 joystick_sender.Quit();
458 joystick_thread.join();
459 reader.Quit();
460 reader_thread.join();
461 gyro_sender.Quit();
462 gyro_thread.join();
463
464 drivetrain_writer.Quit();
465 drivetrain_writer_thread.join();
Austin Schuha3b2eef2015-09-13 07:52:02 +0000466
467 elevator_writer.Quit();
468 elevator_writer_thread.join();
469
470 intake_writer.Quit();
471 intake_writer_thread.join();
472
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000473 solenoid_writer.Quit();
474 solenoid_thread.join();
475
476 ::aos::Cleanup();
477 }
478};
479
480} // namespace wpilib
481} // namespace bot3
482
Comran Morshed0d6cf9b2015-06-17 19:29:57 +0000483START_ROBOT_CLASS(::bot3::wpilib::WPILibRobot);