blob: a66be5985231447de39ca48d0534e9fb9f64eb45 [file] [log] [blame]
Brian Silverman2ccf8c52016-03-15 00:22:26 -04001#include <netdb.h>
Parker Schuh2cd173d2017-01-28 00:12:01 -08002#include <stdlib.h>
Brian Silverman2ccf8c52016-03-15 00:22:26 -04003#include <unistd.h>
4
Brian Silvermanbc831182016-04-16 02:06:09 -04005#include <array>
Brian Silvermanbc831182016-04-16 02:06:09 -04006#include <atomic>
Austin Schuhfb5f7de2016-11-26 15:15:19 -08007#include <chrono>
Brian Silvermanbc831182016-04-16 02:06:09 -04008#include <limits>
Austin Schuhfb5f7de2016-11-26 15:15:19 -08009#include <memory>
10#include <thread>
11#include <vector>
Brian Silverman2ccf8c52016-03-15 00:22:26 -040012
Austin Schuh1bf8a212019-05-26 22:13:14 -070013#include "aos/events/event-loop.h"
14#include "aos/events/shm-event-loop.h"
James Kuszmaul651fc3f2019-05-15 21:14:25 -070015#include "aos/init.h"
John Park33858a32018-09-28 23:05:48 -070016#include "aos/logging/logging.h"
17#include "aos/logging/queue_logging.h"
18#include "aos/mutex/mutex.h"
19#include "aos/time/time.h"
Parker Schuh2cd173d2017-01-28 00:12:01 -080020#include "aos/vision/events/udp.h"
Brian Silvermanbc831182016-04-16 02:06:09 -040021#include "frc971/control_loops/drivetrain/drivetrain.q.h"
Parker Schuh2cd173d2017-01-28 00:12:01 -080022#include "y2016/constants.h"
23#include "y2016/vision/stereo_geometry.h"
Brian Silverman2ccf8c52016-03-15 00:22:26 -040024#include "y2016/vision/vision.q.h"
25#include "y2016/vision/vision_data.pb.h"
Brian Silverman2ccf8c52016-03-15 00:22:26 -040026
27namespace y2016 {
28namespace vision {
29
Austin Schuhfb5f7de2016-11-26 15:15:19 -080030namespace chrono = ::std::chrono;
31using ::aos::monotonic_clock;
32
Austin Schuh11945742016-04-13 22:18:36 -070033::aos::vision::Vector<2> CreateCenterFromTarget(double lx, double ly, double rx,
34 double ry) {
ben54dbccb2016-03-20 14:42:28 -070035 return ::aos::vision::Vector<2>((lx + rx) / 2.0, (ly + ry) / 2.0);
36}
37
38double TargetWidth(double lx, double ly, double rx, double ry) {
39 double dx = lx - rx;
40 double dy = ly - ry;
Austin Schuh098e4872016-03-20 16:51:24 -070041 return ::std::hypot(dx, dy);
ben54dbccb2016-03-20 14:42:28 -070042}
43
44void SelectTargets(const VisionData &left_target,
45 const VisionData &right_target,
46 ::aos::vision::Vector<2> *center_left,
Austin Schuh6bf73052016-04-20 20:20:25 -070047 ::aos::vision::Vector<2> *center_right, double *angle_left,
48 double *angle_right) {
ben54dbccb2016-03-20 14:42:28 -070049 // No good targets. Let the caller decide defaults.
50 if (right_target.target_size() == 0 || left_target.target_size() == 0) {
51 return;
52 }
53
54 // Only one option, we have to go with it.
55 if (right_target.target_size() == 1 && left_target.target_size() == 1) {
56 *center_left =
57 CreateCenterFromTarget(left_target.target(0).left_corner_x(),
58 left_target.target(0).left_corner_y(),
59 left_target.target(0).right_corner_x(),
60 left_target.target(0).right_corner_y());
61 *center_right =
62 CreateCenterFromTarget(right_target.target(0).left_corner_x(),
63 right_target.target(0).left_corner_y(),
64 right_target.target(0).right_corner_x(),
65 right_target.target(0).right_corner_y());
66 return;
67 }
68
69 // Now we have to make a decision.
Austin Schuh9f59c8a2016-03-20 21:09:05 -070070 double min_angle = -1.0;
ben54dbccb2016-03-20 14:42:28 -070071 int left_index = 0;
72 // First pick the widest target from the left.
73 for (int i = 0; i < left_target.target_size(); i++) {
Austin Schuh9f59c8a2016-03-20 21:09:05 -070074 const double h = left_target.target(i).left_corner_y() -
75 left_target.target(i).right_corner_y();
76 const double wid1 = TargetWidth(left_target.target(i).left_corner_x(),
77 left_target.target(i).left_corner_y(),
78 left_target.target(i).right_corner_x(),
79 left_target.target(i).right_corner_y());
80 const double angle = h / wid1;
81 if (min_angle == -1.0 || ::std::abs(angle) < ::std::abs(min_angle)) {
82 min_angle = angle;
Austin Schuh6bf73052016-04-20 20:20:25 -070083 *angle_left = angle;
ben54dbccb2016-03-20 14:42:28 -070084 left_index = i;
85 }
86 }
87 // Calculate the angle of the bottom edge for the left.
88 double h = left_target.target(left_index).left_corner_y() -
89 left_target.target(left_index).right_corner_y();
Austin Schuh9f59c8a2016-03-20 21:09:05 -070090
91 double good_ang = min_angle;
ben54dbccb2016-03-20 14:42:28 -070092 double min_ang_err = -1.0;
93 int right_index = -1;
Austin Schuh11945742016-04-13 22:18:36 -070094 // Now pick the bottom edge angle from the right that lines up best with the
95 // left.
ben54dbccb2016-03-20 14:42:28 -070096 for (int j = 0; j < right_target.target_size(); j++) {
97 double wid2 = TargetWidth(right_target.target(j).left_corner_x(),
Austin Schuh11945742016-04-13 22:18:36 -070098 right_target.target(j).left_corner_y(),
99 right_target.target(j).right_corner_x(),
100 right_target.target(j).right_corner_y());
ben54dbccb2016-03-20 14:42:28 -0700101 h = right_target.target(j).left_corner_y() -
102 right_target.target(j).right_corner_y();
Austin Schuh11945742016-04-13 22:18:36 -0700103 double ang = h / wid2;
ben54dbccb2016-03-20 14:42:28 -0700104 double ang_err = ::std::abs(good_ang - ang);
105 if (min_ang_err == -1.0 || min_ang_err > ang_err) {
106 min_ang_err = ang_err;
107 right_index = j;
Austin Schuh6bf73052016-04-20 20:20:25 -0700108 *angle_right = ang;
ben54dbccb2016-03-20 14:42:28 -0700109 }
110 }
111
112 *center_left =
113 CreateCenterFromTarget(left_target.target(left_index).left_corner_x(),
114 left_target.target(left_index).left_corner_y(),
115 left_target.target(left_index).right_corner_x(),
116 left_target.target(left_index).right_corner_y());
117 *center_right =
118 CreateCenterFromTarget(right_target.target(right_index).left_corner_x(),
119 right_target.target(right_index).left_corner_y(),
120 right_target.target(right_index).right_corner_x(),
121 right_target.target(right_index).right_corner_y());
122}
123
Austin Schuh11945742016-04-13 22:18:36 -0700124class CameraHandler {
125 public:
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800126 void Received(const VisionData &target, monotonic_clock::time_point now) {
Austin Schuh11945742016-04-13 22:18:36 -0700127 if (current_.received) {
128 last_ = current_;
129 }
130 current_.target = target;
131 current_.rx_time = now;
Austin Schuh6fe1d512016-04-24 19:12:04 -0700132 current_.capture_time = now -
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800133 chrono::nanoseconds(target.send_timestamp() -
134 target.image_timestamp()) +
Austin Schuh6fe1d512016-04-24 19:12:04 -0700135 // It takes a bit to shoot a frame. Push the frame
136 // further back in time.
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800137 chrono::milliseconds(10);
Austin Schuh11945742016-04-13 22:18:36 -0700138 current_.received = true;
139 }
140
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800141 void CheckStale(monotonic_clock::time_point now) {
142 if (now > current_.rx_time + chrono::milliseconds(50)) {
Austin Schuh11945742016-04-13 22:18:36 -0700143 current_.received = false;
144 last_.received = false;
145 }
146 }
147
148 bool received_both() const { return current_.received && last_.received; }
149
150 bool is_valid() const {
151 return current_.target.target_size() > 0 && last_.target.target_size() > 0;
152 }
153
154 const VisionData &target() const { return current_.target; }
155 const VisionData &last_target() const { return last_.target; }
156
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800157 monotonic_clock::time_point capture_time() const {
158 return current_.capture_time;
159 }
160 monotonic_clock::time_point last_capture_time() const {
161 return last_.capture_time;
162 }
Austin Schuh11945742016-04-13 22:18:36 -0700163
164 private:
165 struct TargetWithTimes {
166 VisionData target;
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800167 monotonic_clock::time_point rx_time{monotonic_clock::epoch()};
168 monotonic_clock::time_point capture_time{monotonic_clock::epoch()};
Austin Schuh11945742016-04-13 22:18:36 -0700169 bool received = false;
170 };
171
172 TargetWithTimes current_;
173 TargetWithTimes last_;
174};
175
Austin Schuh6bf73052016-04-20 20:20:25 -0700176void CalculateFiltered(const CameraHandler &older, const CameraHandler &newer,
177 const ::aos::vision::Vector<2> &newer_center,
178 const ::aos::vision::Vector<2> &last_newer_center,
179 double angle, double last_angle,
180 ::aos::vision::Vector<2> *interpolated_result,
181 double *interpolated_angle) {
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700182 const double age_ratio =
183 ::aos::time::DurationInSeconds(older.capture_time() -
184 newer.last_capture_time()) /
185 ::aos::time::DurationInSeconds(newer.capture_time() -
186 newer.last_capture_time());
Austin Schuh6bf73052016-04-20 20:20:25 -0700187 interpolated_result->Set(
Austin Schuh11945742016-04-13 22:18:36 -0700188 newer_center.x() * age_ratio + (1 - age_ratio) * last_newer_center.x(),
189 newer_center.y() * age_ratio + (1 - age_ratio) * last_newer_center.y());
Austin Schuh6bf73052016-04-20 20:20:25 -0700190
191 *interpolated_angle = angle * age_ratio + (1 - age_ratio) * last_angle;
Austin Schuh11945742016-04-13 22:18:36 -0700192}
ben54dbccb2016-03-20 14:42:28 -0700193
Brian Silvermanbc831182016-04-16 02:06:09 -0400194// Handles calculating drivetrain offsets.
195class DrivetrainOffsetCalculator {
196 public:
Austin Schuhbd0a40f2019-06-30 14:56:31 -0700197 DrivetrainOffsetCalculator(::aos::EventLoop *event_loop)
198 : drivetrain_status_fetcher_(
199 event_loop
200 ->MakeFetcher<::frc971::control_loops::DrivetrainQueue::Status>(
201 ".frc971.control_loops.drivetrain_queue.status")) {}
Brian Silvermanbc831182016-04-16 02:06:09 -0400202
203 // Takes a vision status message with everything except
204 // drivetrain_{left,right}_position set and sets those.
205 // Returns false if it doesn't have enough data to fill them out.
206 bool CompleteVisionStatus(::y2016::vision::VisionStatus *status) {
Austin Schuhbd0a40f2019-06-30 14:56:31 -0700207 while (drivetrain_status_fetcher_.FetchNext()) {
208 data_[data_index_].time = drivetrain_status_fetcher_->sent_time;
209 data_[data_index_].left = drivetrain_status_fetcher_->estimated_left_position;
210 data_[data_index_].right = drivetrain_status_fetcher_->estimated_right_position;
211 ++data_index_;
212 if (data_index_ == data_.size()) data_index_ = 0;
213 if (valid_data_ < data_.size()) ++valid_data_;
214 }
215
Brian Silvermanbc831182016-04-16 02:06:09 -0400216 if (valid_data_ == 0) return false;
217
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800218 const monotonic_clock::time_point capture_time =
219 monotonic_clock::time_point(chrono::nanoseconds(status->target_time));
Brian Silvermanbc831182016-04-16 02:06:09 -0400220 DrivetrainData before, after;
221 FindBeforeAfter(&before, &after, capture_time);
222
223 if (before.time == after.time) {
224 status->drivetrain_left_position = before.left;
225 status->drivetrain_right_position = before.right;
226 } else {
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700227 const double age_ratio =
228 ::aos::time::DurationInSeconds(capture_time - before.time) /
229 ::aos::time::DurationInSeconds(after.time - before.time);
Brian Silvermanbc831182016-04-16 02:06:09 -0400230 status->drivetrain_left_position =
231 before.left * (1 - age_ratio) + after.left * age_ratio;
232 status->drivetrain_right_position =
233 before.right * (1 - age_ratio) + after.right * age_ratio;
234 }
235
236 return true;
237 }
238
Brian Silvermanbc831182016-04-16 02:06:09 -0400239 private:
240 struct DrivetrainData {
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800241 monotonic_clock::time_point time;
Brian Silvermanbc831182016-04-16 02:06:09 -0400242 double left, right;
243 };
244
245 // Fills out before and after with the data surrounding capture_time.
246 // They might be identical if that's the closest approximation.
247 // Do not call this if valid_data_ is 0.
248 void FindBeforeAfter(DrivetrainData *before, DrivetrainData *after,
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800249 monotonic_clock::time_point capture_time) {
Brian Silvermanbc831182016-04-16 02:06:09 -0400250 size_t location = 0;
251 while (true) {
252 // We hit the end of our data. Just fill them both out as the last data
253 // point.
254 if (location >= valid_data_) {
255 *before = *after =
256 data_[previous_index((valid_data_ + data_index_) % data_.size())];
257 return;
258 }
259
260 // The index into data_ corresponding to location positions after
261 // (data_index_ - 1).
262 const size_t index = previous_index(location + data_index_);
263
264 // If we've found the one we want.
265 if (data_[index].time > capture_time) {
266 *after = data_[index];
267 if (location == 0) {
268 // If this is the first one and it's already after, just return the
269 // same thing for both.
270 *before = data_[index];
271 } else {
272 *before = data_[previous_index(index)];
273 }
274 return;
275 }
276
277 ++location;
278 }
279 }
280
281 size_t previous_index(size_t index) const {
282 if (index == 0) {
283 return data_.size() - 1;
284 } else {
285 return index - 1;
286 }
287 }
288
Austin Schuhbd0a40f2019-06-30 14:56:31 -0700289 ::aos::Fetcher<::frc971::control_loops::DrivetrainQueue::Status>
290 drivetrain_status_fetcher_;
291
Brian Silvermanbc831182016-04-16 02:06:09 -0400292 ::std::array<DrivetrainData, 200> data_;
293 // The index into data_ the next data point is going at.
294 size_t data_index_ = 0;
295 // How many elemets of data_ are valid.
296 size_t valid_data_ = 0;
Brian Silvermanbc831182016-04-16 02:06:09 -0400297};
298
Brian Silverman2ccf8c52016-03-15 00:22:26 -0400299void Main() {
Austin Schuh1bf8a212019-05-26 22:13:14 -0700300 ::aos::ShmEventLoop event_loop;
301
302 ::aos::Sender<::y2016::vision::VisionStatus> vision_status_sender =
303 event_loop.MakeSender<::y2016::vision::VisionStatus>(
304 ".y2016.vision.vision_status");
305
Brian Silverman2ccf8c52016-03-15 00:22:26 -0400306 StereoGeometry stereo(constants::GetValues().vision_name);
Austin Schuhf257f3c2019-10-27 21:00:43 -0700307 AOS_LOG(INFO, "calibration: %s\n",
308 stereo.calibration().ShortDebugString().c_str());
Brian Silverman2ccf8c52016-03-15 00:22:26 -0400309
Austin Schuhbd0a40f2019-06-30 14:56:31 -0700310 DrivetrainOffsetCalculator drivetrain_offset(&event_loop);
Brian Silvermanbc831182016-04-16 02:06:09 -0400311
Austin Schuh11945742016-04-13 22:18:36 -0700312 CameraHandler left;
313 CameraHandler right;
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700314
Parker Schuh2cd173d2017-01-28 00:12:01 -0800315 ::aos::events::RXUdpSocket recv(8080);
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700316 char rawData[65507];
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700317
318 while (true) {
319 // TODO(austin): Don't malloc.
320 VisionData target;
321 int size = recv.Recv(rawData, 65507);
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800322 monotonic_clock::time_point now = monotonic_clock::now();
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700323
324 if (target.ParseFromArray(rawData, size)) {
325 if (target.camera_index() == 0) {
Austin Schuh11945742016-04-13 22:18:36 -0700326 left.Received(target, now);
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700327 } else {
Austin Schuh11945742016-04-13 22:18:36 -0700328 right.Received(target, now);
Brian Silverman2ccf8c52016-03-15 00:22:26 -0400329 }
330 } else {
Austin Schuhf257f3c2019-10-27 21:00:43 -0700331 AOS_LOG(ERROR, "oh noes: parse error\n");
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700332 continue;
333 }
334
Austin Schuh11945742016-04-13 22:18:36 -0700335 left.CheckStale(now);
336 right.CheckStale(now);
Brian Silverman2ccf8c52016-03-15 00:22:26 -0400337
Austin Schuh11945742016-04-13 22:18:36 -0700338 if (left.received_both() && right.received_both()) {
339 const bool left_image_valid = left.is_valid();
340 const bool right_image_valid = right.is_valid();
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700341
Austin Schuh1bf8a212019-05-26 22:13:14 -0700342 auto new_vision_status = vision_status_sender.MakeMessage();
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700343 new_vision_status->left_image_valid = left_image_valid;
344 new_vision_status->right_image_valid = right_image_valid;
345 if (left_image_valid && right_image_valid) {
Austin Schuh11945742016-04-13 22:18:36 -0700346 ::aos::vision::Vector<2> center_left(0.0, 0.0);
347 ::aos::vision::Vector<2> center_right(0.0, 0.0);
Austin Schuh6bf73052016-04-20 20:20:25 -0700348 double angle_left;
349 double angle_right;
Austin Schuh11945742016-04-13 22:18:36 -0700350 SelectTargets(left.target(), right.target(), &center_left,
Austin Schuh6bf73052016-04-20 20:20:25 -0700351 &center_right, &angle_left, &angle_right);
Austin Schuh11945742016-04-13 22:18:36 -0700352
353 // TODO(Ben): Remember this from last time instead of recalculating it
354 // each time.
355 ::aos::vision::Vector<2> last_center_left(0.0, 0.0);
356 ::aos::vision::Vector<2> last_center_right(0.0, 0.0);
Austin Schuh6bf73052016-04-20 20:20:25 -0700357 double last_angle_left;
358 double last_angle_right;
Austin Schuh11945742016-04-13 22:18:36 -0700359 SelectTargets(left.last_target(), right.last_target(),
Parker Schuh2cd173d2017-01-28 00:12:01 -0800360 &last_center_left, &last_center_right, &last_angle_left,
361 &last_angle_right);
Austin Schuh11945742016-04-13 22:18:36 -0700362
363 ::aos::vision::Vector<2> filtered_center_left(0.0, 0.0);
364 ::aos::vision::Vector<2> filtered_center_right(0.0, 0.0);
Austin Schuh6bf73052016-04-20 20:20:25 -0700365 double filtered_angle_left;
366 double filtered_angle_right;
Austin Schuh11945742016-04-13 22:18:36 -0700367 if (left.capture_time() < right.capture_time()) {
368 filtered_center_left = center_left;
Austin Schuh6bf73052016-04-20 20:20:25 -0700369 filtered_angle_left = angle_left;
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800370 new_vision_status->target_time =
371 chrono::duration_cast<chrono::nanoseconds>(
Parker Schuh2cd173d2017-01-28 00:12:01 -0800372 left.capture_time().time_since_epoch())
373 .count();
Austin Schuh6bf73052016-04-20 20:20:25 -0700374 CalculateFiltered(left, right, center_right, last_center_right,
375 angle_right, last_angle_right,
376 &filtered_center_right, &filtered_angle_right);
Austin Schuh11945742016-04-13 22:18:36 -0700377 } else {
378 filtered_center_right = center_right;
Austin Schuh6bf73052016-04-20 20:20:25 -0700379 filtered_angle_right = angle_right;
Austin Schuhfb5f7de2016-11-26 15:15:19 -0800380 new_vision_status->target_time =
381 chrono::duration_cast<chrono::nanoseconds>(
Parker Schuh2cd173d2017-01-28 00:12:01 -0800382 right.capture_time().time_since_epoch())
383 .count();
Austin Schuh6bf73052016-04-20 20:20:25 -0700384 CalculateFiltered(right, left, center_left, last_center_left,
385 angle_left, last_angle_left, &filtered_center_left,
386 &filtered_angle_left);
Austin Schuh11945742016-04-13 22:18:36 -0700387 }
388
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700389 double distance, horizontal_angle, vertical_angle;
Austin Schuh11945742016-04-13 22:18:36 -0700390 stereo.Process(filtered_center_left, filtered_center_right, &distance,
391 &horizontal_angle, &vertical_angle);
392 new_vision_status->left_image_timestamp =
393 left.target().image_timestamp();
394 new_vision_status->right_image_timestamp =
395 right.target().image_timestamp();
396 new_vision_status->left_send_timestamp = left.target().send_timestamp();
Parker Schuh2cd173d2017-01-28 00:12:01 -0800397 new_vision_status->right_send_timestamp =
398 right.target().send_timestamp();
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700399 new_vision_status->horizontal_angle = horizontal_angle;
400 new_vision_status->vertical_angle = vertical_angle;
401 new_vision_status->distance = distance;
Austin Schuh6bf73052016-04-20 20:20:25 -0700402 new_vision_status->angle =
403 (filtered_angle_left + filtered_angle_right) / 2.0;
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700404 }
Brian Silverman2ccf8c52016-03-15 00:22:26 -0400405
Brian Silvermanbc831182016-04-16 02:06:09 -0400406 if (drivetrain_offset.CompleteVisionStatus(new_vision_status.get())) {
Austin Schuhf257f3c2019-10-27 21:00:43 -0700407 AOS_LOG_STRUCT(DEBUG, "vision", *new_vision_status);
Brian Silvermanbc831182016-04-16 02:06:09 -0400408 if (!new_vision_status.Send()) {
Austin Schuhf257f3c2019-10-27 21:00:43 -0700409 AOS_LOG(ERROR, "Failed to send vision information\n");
Brian Silvermanbc831182016-04-16 02:06:09 -0400410 }
411 } else {
Austin Schuhf257f3c2019-10-27 21:00:43 -0700412 AOS_LOG_STRUCT(WARNING, "vision without drivetrain",
413 *new_vision_status);
Brian Silverman2ccf8c52016-03-15 00:22:26 -0400414 }
415 }
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700416
417 if (target.camera_index() == 0) {
Austin Schuhf257f3c2019-10-27 21:00:43 -0700418 AOS_LOG(DEBUG, "left_target: %s\n",
419 left.target().ShortDebugString().c_str());
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700420 } else {
Austin Schuhf257f3c2019-10-27 21:00:43 -0700421 AOS_LOG(DEBUG, "right_target: %s\n",
422 right.target().ShortDebugString().c_str());
Austin Schuhc65b0ea2016-03-16 22:09:19 -0700423 }
Brian Silverman2ccf8c52016-03-15 00:22:26 -0400424 }
Brian Silverman2ccf8c52016-03-15 00:22:26 -0400425}
426
427} // namespace vision
428} // namespace y2016
429
430int main(int /*argc*/, char ** /*argv*/) {
431 ::aos::InitNRT();
432 ::y2016::vision::Main();
433}