blob: 61e3d9fe811ea186b79e476430960cf87dee8d15 [file] [log] [blame]
Neil Balchacfca5b2018-01-28 14:04:08 -08001#include <math.h>
2#include <stdio.h>
3#include <string.h>
4#include <unistd.h>
Austin Schuh8d5fff42018-05-30 20:44:12 -07005#include <mutex>
Neil Balchacfca5b2018-01-28 14:04:08 -08006
7#include "aos/common/actions/actions.h"
8#include "aos/common/input/driver_station_data.h"
9#include "aos/common/logging/logging.h"
Austin Schuh8d5fff42018-05-30 20:44:12 -070010#include "aos/common/stl_mutex.h"
Neil Balchacfca5b2018-01-28 14:04:08 -080011#include "aos/common/time.h"
12#include "aos/common/util/log_interval.h"
13#include "aos/input/drivetrain_input.h"
14#include "aos/input/joystick_input.h"
15#include "aos/linux_code/init.h"
Austin Schuh8d5fff42018-05-30 20:44:12 -070016#include "aos/vision/events/udp.h"
Austin Schuha3c148e2018-03-09 21:04:05 -080017#include "frc971/autonomous/auto.q.h"
18#include "frc971/autonomous/base_autonomous_actor.h"
Neil Balchacfca5b2018-01-28 14:04:08 -080019#include "frc971/control_loops/drivetrain/drivetrain.q.h"
20#include "y2018/control_loops/drivetrain/drivetrain_base.h"
Austin Schuhab15c4d2018-03-09 21:21:03 -080021#include "y2018/control_loops/superstructure/arm/generated_graph.h"
Neil Balch07fee582018-01-27 15:46:49 -080022#include "y2018/control_loops/superstructure/superstructure.q.h"
Austin Schuh8d5fff42018-05-30 20:44:12 -070023#include "y2018/vision.pb.h"
Neil Balchacfca5b2018-01-28 14:04:08 -080024
Austin Schuh8d5fff42018-05-30 20:44:12 -070025using ::aos::monotonic_clock;
Neil Balchacfca5b2018-01-28 14:04:08 -080026using ::frc971::control_loops::drivetrain_queue;
Neil Balch07fee582018-01-27 15:46:49 -080027using ::y2018::control_loops::superstructure_queue;
Austin Schuh8d5fff42018-05-30 20:44:12 -070028using ::aos::events::ProtoTXUdpSocket;
29using ::aos::events::RXUdpSocket;
Neil Balchacfca5b2018-01-28 14:04:08 -080030using ::aos::input::driver_station::ButtonLocation;
31using ::aos::input::driver_station::ControlBit;
32using ::aos::input::driver_station::JoystickAxis;
33using ::aos::input::driver_station::POVLocation;
34using ::aos::input::DrivetrainInputReader;
35
Austin Schuh60cdb3e2018-04-06 21:52:32 -070036using ::y2018::control_loops::superstructure::arm::FrontPoints;
37using ::y2018::control_loops::superstructure::arm::BackPoints;
38
Neil Balchacfca5b2018-01-28 14:04:08 -080039namespace y2018 {
40namespace input {
41namespace joysticks {
42
Austin Schuhab15c4d2018-03-09 21:21:03 -080043namespace arm = ::y2018::control_loops::superstructure::arm;
Neil Balch07fee582018-01-27 15:46:49 -080044
Sabina Davis833ccf62018-04-06 20:52:31 -070045const ButtonLocation kIntakeClosed(3, 2);
46const ButtonLocation kDuck(3, 9);
47const ButtonLocation kSmallBox(3, 1);
Austin Schuh47d74942018-03-04 01:15:59 -080048
Sabina Davis833ccf62018-04-06 20:52:31 -070049const ButtonLocation kIntakeIn(3, 4);
50const ButtonLocation kIntakeOut(3, 3);
Neil Balch07fee582018-01-27 15:46:49 -080051
Sabina Davis833ccf62018-04-06 20:52:31 -070052const ButtonLocation kArmFrontHighBox(4, 11);
53const ButtonLocation kArmFrontExtraHighBox(4, 1);
54const ButtonLocation kArmFrontMiddle2Box(4, 9);
55const ButtonLocation kArmFrontMiddle1Box(4, 7);
56const ButtonLocation kArmFrontLowBox(4, 5);
57const ButtonLocation kArmFrontSwitch(3, 7);
Austin Schuhab15c4d2018-03-09 21:21:03 -080058
Sabina Davis833ccf62018-04-06 20:52:31 -070059const ButtonLocation kArmBackHighBox(4, 12);
60const ButtonLocation kArmBackExtraHighBox(3, 14);
61const ButtonLocation kArmBackMiddle2Box(4, 10);
62const ButtonLocation kArmBackMiddle1Box(4, 8);
63const ButtonLocation kArmBackLowBox(4, 6);
64const ButtonLocation kArmBackSwitch(3, 10);
Austin Schuhab15c4d2018-03-09 21:21:03 -080065
Sabina Davis833ccf62018-04-06 20:52:31 -070066const ButtonLocation kArmAboveHang(3, 15);
67const ButtonLocation kArmBelowHang(3, 16);
Austin Schuh17e484e2018-03-11 01:11:36 -080068
Sabina Davis833ccf62018-04-06 20:52:31 -070069const ButtonLocation kWinch(4, 2);
Austin Schuh17e484e2018-03-11 01:11:36 -080070
Sabina Davis833ccf62018-04-06 20:52:31 -070071const ButtonLocation kArmNeutral(3, 8);
72const ButtonLocation kArmUp(3, 11);
Austin Schuhab15c4d2018-03-09 21:21:03 -080073
Sabina Davis833ccf62018-04-06 20:52:31 -070074const ButtonLocation kArmStepUp(3, 13);
75const ButtonLocation kArmStepDown(3, 12);
Austin Schuhab15c4d2018-03-09 21:21:03 -080076
Sabina Davis833ccf62018-04-06 20:52:31 -070077const ButtonLocation kArmPickupBoxFromIntake(4, 3);
78
79const ButtonLocation kClawOpen(4, 4);
Neil Balchba9cbba2018-04-06 22:26:38 -070080const ButtonLocation kDriverClawOpen(2, 4);
Neil Balch07fee582018-01-27 15:46:49 -080081
Neil Balchacfca5b2018-01-28 14:04:08 -080082std::unique_ptr<DrivetrainInputReader> drivetrain_input_reader_;
83
84class Reader : public ::aos::input::JoystickInput {
85 public:
Austin Schuh8d5fff42018-05-30 20:44:12 -070086 Reader() : video_tx_("10.9.71.179", 5000) {
Neil Balchacfca5b2018-01-28 14:04:08 -080087 drivetrain_input_reader_ = DrivetrainInputReader::Make(
Austin Schuh2b1fce02018-03-02 20:05:20 -080088 DrivetrainInputReader::InputType::kPistol,
Neil Balchacfca5b2018-01-28 14:04:08 -080089 ::y2018::control_loops::drivetrain::GetDrivetrainConfig());
90 }
91
92 void RunIteration(const ::aos::input::driver_station::Data &data) override {
93 bool last_auto_running = auto_running_;
94 auto_running_ = data.GetControlBit(ControlBit::kAutonomous) &&
95 data.GetControlBit(ControlBit::kEnabled);
96 if (auto_running_ != last_auto_running) {
97 if (auto_running_) {
98 StartAuto();
99 } else {
100 StopAuto();
101 }
102 }
103
104 if (!auto_running_) {
105 HandleDrivetrain(data);
106 HandleTeleop(data);
107 }
108
109 // Process any pending actions.
110 action_queue_.Tick();
111 was_running_ = action_queue_.Running();
112 }
113
114 void HandleDrivetrain(const ::aos::input::driver_station::Data &data) {
115 drivetrain_input_reader_->HandleDrivetrain(data);
Neil Balchacfca5b2018-01-28 14:04:08 -0800116 }
117
118 void HandleTeleop(const ::aos::input::driver_station::Data &data) {
119 if (!data.GetControlBit(ControlBit::kEnabled)) {
120 action_queue_.CancelAllActions();
121 LOG(DEBUG, "Canceling\n");
122 }
Neil Balch07fee582018-01-27 15:46:49 -0800123
Austin Schuhab15c4d2018-03-09 21:21:03 -0800124 superstructure_queue.position.FetchLatest();
Neil Balch07fee582018-01-27 15:46:49 -0800125 superstructure_queue.status.FetchLatest();
Austin Schuhab15c4d2018-03-09 21:21:03 -0800126 if (!superstructure_queue.status.get() ||
127 !superstructure_queue.position.get()) {
Neil Balch07fee582018-01-27 15:46:49 -0800128 LOG(ERROR, "Got no superstructure status packet.\n");
129 return;
130 }
131
Neil Balch07fee582018-01-27 15:46:49 -0800132 auto new_superstructure_goal = superstructure_queue.goal.MakeMessage();
133
Sabina Davisfdd7a112018-02-04 16:16:23 -0800134 new_superstructure_goal->intake.left_intake_angle = intake_goal_;
135 new_superstructure_goal->intake.right_intake_angle = intake_goal_;
Neil Balch07fee582018-01-27 15:46:49 -0800136
Austin Schuh8d5fff42018-05-30 20:44:12 -0700137 if (data.PosEdge(kIntakeIn) || data.PosEdge(kSmallBox) ||
138 data.PosEdge(kIntakeClosed)) {
139 vision_control_.set_high_video(false);
140 }
141
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700142 if (data.IsPressed(kIntakeIn)) {
Neil Balch07fee582018-01-27 15:46:49 -0800143 // Turn on the rollers.
Neil Balchba9cbba2018-04-06 22:26:38 -0700144 new_superstructure_goal->intake.roller_voltage = 8.0;
Neil Balch07fee582018-01-27 15:46:49 -0800145 } else if (data.IsPressed(kIntakeOut)) {
146 // Turn off the rollers.
Austin Schuh17dd0892018-03-02 20:06:31 -0800147 new_superstructure_goal->intake.roller_voltage = -12.0;
Neil Balch07fee582018-01-27 15:46:49 -0800148 } else {
149 // We don't want the rollers on.
150 new_superstructure_goal->intake.roller_voltage = 0.0;
151 }
152
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700153 if (data.IsPressed(kSmallBox)) {
154 // Deploy the intake.
155 if (superstructure_queue.position->box_back_beambreak_triggered) {
156 intake_goal_ = 0.30;
157 } else {
158 if (new_superstructure_goal->intake.roller_voltage > 0.1 &&
159 superstructure_queue.position->box_distance < 0.15) {
160 intake_goal_ = 0.18;
161 } else {
162 intake_goal_ = -0.60;
163 }
164 }
165 } else if (data.IsPressed(kIntakeClosed)) {
166 // Deploy the intake.
167 if (superstructure_queue.position->box_back_beambreak_triggered) {
168 intake_goal_ = 0.30;
169 } else {
170 if (new_superstructure_goal->intake.roller_voltage > 0.1) {
Neil Balchba9cbba2018-04-06 22:26:38 -0700171 if (superstructure_queue.position->box_distance < 0.10) {
172 new_superstructure_goal->intake.roller_voltage -= 3.0;
173 intake_goal_ = 0.22;
174 } else if (superstructure_queue.position->box_distance < 0.17) {
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700175 intake_goal_ = 0.13;
176 } else if (superstructure_queue.position->box_distance < 0.25) {
Neil Balchba9cbba2018-04-06 22:26:38 -0700177 intake_goal_ = 0.05;
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700178 } else {
Neil Balchba9cbba2018-04-06 22:26:38 -0700179 intake_goal_ = -0.10;
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700180 }
Austin Schuhcf96d322018-04-07 15:52:31 -0700181 if (drivetrain_input_reader_->robot_velocity() < -0.1 &&
182 superstructure_queue.position->box_distance > 0.15) {
183 intake_goal_ += 0.10;
184 }
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700185 } else {
186 intake_goal_ = -0.60;
187 }
188 }
189 } else {
190 // Bring in the intake.
Austin Schuhcf96d322018-04-07 15:52:31 -0700191 intake_goal_ = -3.20;
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700192 }
193
Neil Balchba9cbba2018-04-06 22:26:38 -0700194 if (new_superstructure_goal->intake.roller_voltage > 0.1 &&
195 intake_goal_ > 0.0) {
196 if (superstructure_queue.position->box_distance < 0.10) {
197 new_superstructure_goal->intake.roller_voltage -= 3.0;
198 }
199 new_superstructure_goal->intake.roller_voltage += 3.0;
200 }
201
Austin Schuhb874fd32018-03-05 00:27:10 -0800202 // If we are disabled, stay at the node closest to where we start. This
203 // should remove long motions when enabled.
Neil Balchba9cbba2018-04-06 22:26:38 -0700204 if (!data.GetControlBit(ControlBit::kEnabled) || never_disabled_) {
Austin Schuhb874fd32018-03-05 00:27:10 -0800205 arm_goal_position_ = superstructure_queue.status->arm.current_node;
Neil Balchba9cbba2018-04-06 22:26:38 -0700206 never_disabled_ = false;
Austin Schuhb874fd32018-03-05 00:27:10 -0800207 }
208
Austin Schuhab15c4d2018-03-09 21:21:03 -0800209 bool grab_box = false;
210 if (data.IsPressed(kArmPickupBoxFromIntake)) {
Austin Schuhab15c4d2018-03-09 21:21:03 -0800211 grab_box = true;
Neil Balchba9cbba2018-04-06 22:26:38 -0700212 }
Austin Schuh60cdb3e2018-04-06 21:52:32 -0700213 const bool near_goal =
214 superstructure_queue.status->arm.current_node == arm_goal_position_ &&
215 superstructure_queue.status->arm.path_distance_to_go < 1e-3;
Austin Schuh822a1e52018-04-06 22:50:21 -0700216 if (data.IsPressed(kArmStepDown) && near_goal) {
Austin Schuh60cdb3e2018-04-06 21:52:32 -0700217 uint32_t *front_point = ::std::find(
218 front_points_.begin(), front_points_.end(), arm_goal_position_);
219 uint32_t *back_point = ::std::find(
220 back_points_.begin(), back_points_.end(), arm_goal_position_);
Austin Schuh60cdb3e2018-04-06 21:52:32 -0700221 if (front_point != front_points_.end()) {
Austin Schuh60cdb3e2018-04-06 21:52:32 -0700222 ++front_point;
223 if (front_point != front_points_.end()) {
Austin Schuh60cdb3e2018-04-06 21:52:32 -0700224 arm_goal_position_ = *front_point;
225 }
226 } else if (back_point != back_points_.end()) {
Austin Schuh60cdb3e2018-04-06 21:52:32 -0700227 ++back_point;
228 if (back_point != back_points_.end()) {
Austin Schuh60cdb3e2018-04-06 21:52:32 -0700229 arm_goal_position_ = *back_point;
230 }
231 }
Austin Schuh822a1e52018-04-06 22:50:21 -0700232 } else if (data.IsPressed(kArmStepUp) && near_goal) {
Austin Schuh60cdb3e2018-04-06 21:52:32 -0700233 const uint32_t *front_point = ::std::find(
234 front_points_.begin(), front_points_.end(), arm_goal_position_);
235 const uint32_t *back_point = ::std::find(
236 back_points_.begin(), back_points_.end(), arm_goal_position_);
237 if (front_point != front_points_.end()) {
238 if (front_point != front_points_.begin()) {
239 --front_point;
240 arm_goal_position_ = *front_point;
241 }
242 } else if (back_point != back_points_.end()) {
243 if (back_point != back_points_.begin()) {
244 --back_point;
245 arm_goal_position_ = *back_point;
246 }
247 }
248 } else if (data.PosEdge(kArmPickupBoxFromIntake)) {
Austin Schuh8d5fff42018-05-30 20:44:12 -0700249 vision_control_.set_high_video(false);
Neil Balchba9cbba2018-04-06 22:26:38 -0700250 arm_goal_position_ = arm::NeutralIndex();
251 } else if (data.IsPressed(kDuck)) {
Austin Schuh8d5fff42018-05-30 20:44:12 -0700252 vision_control_.set_high_video(false);
Neil Balchba9cbba2018-04-06 22:26:38 -0700253 arm_goal_position_ = arm::DuckIndex();
Austin Schuhab15c4d2018-03-09 21:21:03 -0800254 } else if (data.IsPressed(kArmNeutral)) {
Austin Schuh8d5fff42018-05-30 20:44:12 -0700255 vision_control_.set_high_video(false);
Austin Schuhab15c4d2018-03-09 21:21:03 -0800256 arm_goal_position_ = arm::NeutralIndex();
257 } else if (data.IsPressed(kArmUp)) {
Austin Schuh8d5fff42018-05-30 20:44:12 -0700258 vision_control_.set_high_video(true);
Austin Schuhab15c4d2018-03-09 21:21:03 -0800259 arm_goal_position_ = arm::UpIndex();
260 } else if (data.IsPressed(kArmFrontSwitch)) {
261 arm_goal_position_ = arm::FrontSwitchIndex();
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700262 } else if (data.IsPressed(kArmFrontExtraHighBox)) {
Austin Schuh8d5fff42018-05-30 20:44:12 -0700263 vision_control_.set_high_video(true);
Austin Schuhab15c4d2018-03-09 21:21:03 -0800264 arm_goal_position_ = arm::FrontHighBoxIndex();
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700265 } else if (data.IsPressed(kArmFrontHighBox)) {
Austin Schuh8d5fff42018-05-30 20:44:12 -0700266 vision_control_.set_high_video(true);
Austin Schuhab15c4d2018-03-09 21:21:03 -0800267 arm_goal_position_ = arm::FrontMiddle2BoxIndex();
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700268 } else if (data.IsPressed(kArmFrontMiddle2Box)) {
Austin Schuh8d5fff42018-05-30 20:44:12 -0700269 vision_control_.set_high_video(true);
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700270 arm_goal_position_ = arm::FrontMiddle3BoxIndex();
Austin Schuhab15c4d2018-03-09 21:21:03 -0800271 } else if (data.IsPressed(kArmFrontMiddle1Box)) {
Austin Schuh8d5fff42018-05-30 20:44:12 -0700272 vision_control_.set_high_video(true);
Austin Schuhab15c4d2018-03-09 21:21:03 -0800273 arm_goal_position_ = arm::FrontMiddle1BoxIndex();
274 } else if (data.IsPressed(kArmFrontLowBox)) {
Austin Schuh8d5fff42018-05-30 20:44:12 -0700275 vision_control_.set_high_video(true);
Austin Schuhab15c4d2018-03-09 21:21:03 -0800276 arm_goal_position_ = arm::FrontLowBoxIndex();
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700277 } else if (data.IsPressed(kArmBackExtraHighBox)) {
Austin Schuhab15c4d2018-03-09 21:21:03 -0800278 arm_goal_position_ = arm::BackHighBoxIndex();
Austin Schuh83cdd8a2018-03-21 20:49:02 -0700279 } else if (data.IsPressed(kArmBackHighBox) ||
280 data.IsPressed(kArmBackMiddle2Box)) {
Austin Schuhab15c4d2018-03-09 21:21:03 -0800281 arm_goal_position_ = arm::BackMiddle2BoxIndex();
282 } else if (data.IsPressed(kArmBackMiddle1Box)) {
283 arm_goal_position_ = arm::BackMiddle1BoxIndex();
284 } else if (data.IsPressed(kArmBackLowBox)) {
285 arm_goal_position_ = arm::BackLowBoxIndex();
286 } else if (data.IsPressed(kArmBackSwitch)) {
287 arm_goal_position_ = arm::BackSwitchIndex();
Austin Schuh17e484e2018-03-11 01:11:36 -0800288 } else if (data.IsPressed(kArmAboveHang)) {
289 if (data.IsPressed(kIntakeIn)) {
290 arm_goal_position_ = arm::SelfHangIndex();
291 } else if (data.IsPressed(kIntakeOut)) {
292 arm_goal_position_ = arm::PartnerHangIndex();
293 } else {
294 arm_goal_position_ = arm::AboveHangIndex();
295 }
296 } else if (data.IsPressed(kArmBelowHang)) {
297 arm_goal_position_ = arm::BelowHangIndex();
Neil Balch07fee582018-01-27 15:46:49 -0800298 }
299
Austin Schuh17e484e2018-03-11 01:11:36 -0800300 new_superstructure_goal->deploy_fork =
301 data.IsPressed(kArmAboveHang) && data.IsPressed(kClawOpen);
302
303 if (new_superstructure_goal->deploy_fork) {
304 intake_goal_ = -2.0;
305 }
306
307 if (data.IsPressed(kWinch)) {
Neil Balchba9cbba2018-04-06 22:26:38 -0700308 LOG(INFO, "Winching\n");
Austin Schuh17e484e2018-03-11 01:11:36 -0800309 new_superstructure_goal->voltage_winch = 12.0;
310 } else {
311 new_superstructure_goal->voltage_winch = 0.0;
312 }
313
314 new_superstructure_goal->hook_release = data.IsPressed(kArmBelowHang);
315
Austin Schuhcb091712018-02-21 20:01:55 -0800316 new_superstructure_goal->arm_goal_position = arm_goal_position_;
317
Neil Balchba9cbba2018-04-06 22:26:38 -0700318 if ((data.IsPressed(kClawOpen) && data.IsPressed(kDriverClawOpen)) ||
319 data.PosEdge(kArmPickupBoxFromIntake)) {
Neil Balch07fee582018-01-27 15:46:49 -0800320 new_superstructure_goal->open_claw = true;
Austin Schuhab15c4d2018-03-09 21:21:03 -0800321 } else {
Neil Balch07fee582018-01-27 15:46:49 -0800322 new_superstructure_goal->open_claw = false;
323 }
324
Austin Schuhab15c4d2018-03-09 21:21:03 -0800325 new_superstructure_goal->grab_box = grab_box;
Neil Balch07fee582018-01-27 15:46:49 -0800326
327 LOG_STRUCT(DEBUG, "sending goal", *new_superstructure_goal);
328 if (!new_superstructure_goal.Send()) {
329 LOG(ERROR, "Sending superstructure goal failed.\n");
330 }
Austin Schuh8d5fff42018-05-30 20:44:12 -0700331
332 video_tx_.Send(vision_control_);
Neil Balchacfca5b2018-01-28 14:04:08 -0800333 }
334
335 private:
Austin Schuha3c148e2018-03-09 21:04:05 -0800336 void StartAuto() {
337 LOG(INFO, "Starting auto mode\n");
338
339 ::frc971::autonomous::AutonomousActionParams params;
340 ::frc971::autonomous::auto_mode.FetchLatest();
341 if (::frc971::autonomous::auto_mode.get() != nullptr) {
Austin Schuhc231df42018-03-21 20:43:24 -0700342 params.mode = ::frc971::autonomous::auto_mode->mode << 2;
Austin Schuha3c148e2018-03-09 21:04:05 -0800343 } else {
344 LOG(WARNING, "no auto mode values\n");
345 params.mode = 0;
346 }
Austin Schuhc231df42018-03-21 20:43:24 -0700347 // TODO(austin): use the mode later if we care. We don't care right now.
348 params.mode = static_cast<int>(::aos::joystick_state->switch_left) |
349 (static_cast<int>(::aos::joystick_state->scale_left) << 1);
Austin Schuha3c148e2018-03-09 21:04:05 -0800350 action_queue_.EnqueueAction(
351 ::frc971::autonomous::MakeAutonomousAction(params));
352 }
Neil Balchacfca5b2018-01-28 14:04:08 -0800353
354 void StopAuto() {
355 LOG(INFO, "Stopping auto mode\n");
356 action_queue_.CancelAllActions();
357 }
358
Neil Balch07fee582018-01-27 15:46:49 -0800359 // Current goals to send to the robot.
Austin Schuh17e484e2018-03-11 01:11:36 -0800360 double intake_goal_ = 0.0;
Neil Balch07fee582018-01-27 15:46:49 -0800361
Neil Balchacfca5b2018-01-28 14:04:08 -0800362 bool was_running_ = false;
363 bool auto_running_ = false;
Neil Balchba9cbba2018-04-06 22:26:38 -0700364 bool never_disabled_ = true;
Neil Balchacfca5b2018-01-28 14:04:08 -0800365
Austin Schuh60cdb3e2018-04-06 21:52:32 -0700366 uint32_t arm_goal_position_ = 0;
Austin Schuh8d5fff42018-05-30 20:44:12 -0700367 VisionControl vision_control_;
Austin Schuh60cdb3e2018-04-06 21:52:32 -0700368
369 decltype(FrontPoints()) front_points_ = FrontPoints();
370 decltype(BackPoints()) back_points_ = BackPoints();
Austin Schuhcb091712018-02-21 20:01:55 -0800371
Neil Balchacfca5b2018-01-28 14:04:08 -0800372 ::aos::common::actions::ActionQueue action_queue_;
Austin Schuh8d5fff42018-05-30 20:44:12 -0700373
374 ProtoTXUdpSocket<VisionControl> video_tx_;
Neil Balchacfca5b2018-01-28 14:04:08 -0800375};
376
377} // namespace joysticks
378} // namespace input
379} // namespace y2018
380
381int main() {
382 ::aos::Init(-1);
383 ::y2018::input::joysticks::Reader reader;
384 reader.Run();
385 ::aos::Cleanup();
386}