blob: c7f000979e89146246360a4ff219b370ab3e2b5b [file] [log] [blame]
Parker Schuh2a1447c2019-02-17 00:25:29 -08001load("//aos/build:queues.bzl", "queue_library")
2load("//tools/build_rules:gtk_dependent.bzl", "gtk_dependent_cc_binary", "gtk_dependent_cc_library")
3load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
Brian Silvermana498bbb2019-03-03 17:18:04 -08004load("//tools:environments.bzl", "mcu_cpus")
Parker Schuh2a1447c2019-02-17 00:25:29 -08005
6package(default_visibility = ["//visibility:public"])
7
Brian Silvermance4825f2019-02-17 18:28:39 -08008VISION_TARGETS = [
9 "//tools:k8",
10 "//tools:armhf-debian",
11]
Parker Schuh2a1447c2019-02-17 00:25:29 -080012
13cc_library(
Parker Schuhe9a549a2019-02-24 16:29:22 -080014 name = "constants",
James Kuszmaule2c71ea2019-03-04 08:14:21 -080015 srcs = [
16 "constants.cc",
17 "constants_formatting.cc",
18 ],
Austin Schuh29b6be02019-03-02 22:12:58 -080019 hdrs = ["constants.h"],
Brian Silvermana498bbb2019-03-03 17:18:04 -080020 compatible_with = mcu_cpus,
21 visibility = ["//visibility:public"],
Parker Schuhe9a549a2019-02-24 16:29:22 -080022)
23
James Kuszmaule2c71ea2019-03-04 08:14:21 -080024cc_binary(
25 name = "constants_formatting",
26 srcs = ["constants_formatting_main.cc"],
27 deps = [":constants"],
28)
29
30genrule(
31 name = "generate_constants",
32 outs = ["validate_constants.cc"],
33 cmd = "$(location :constants_formatting) $(OUTS)",
34 tools = [":constants_formatting"],
35)
36
Austin Schuh4e2629d2019-03-28 14:44:37 -070037cc_library(
38 name = "image_writer",
39 srcs = ["image_writer.cc"],
40 hdrs = ["image_writer.h"],
41 deps = [
Austin Schuh4e2629d2019-03-28 14:44:37 -070042 "//aos/vision/image:image_types",
Alex Perry670d5ac2019-04-07 14:20:31 -070043 "@com_github_google_glog//:glog",
Austin Schuh4e2629d2019-03-28 14:44:37 -070044 ],
45)
46
James Kuszmaule2c71ea2019-03-04 08:14:21 -080047sh_test(
48 name = "constants_formatting_test",
49 srcs = ["constants_formatting_test.sh"],
50 args = [
51 "$(location :constants.cc)",
52 "$(location :validate_constants.cc)",
53 ],
54 data = [
55 ":constants.cc",
56 ":validate_constants.cc",
57 ],
58)
59
Parker Schuhe9a549a2019-02-24 16:29:22 -080060cc_library(
Parker Schuh2a1447c2019-02-17 00:25:29 -080061 name = "target_finder",
Brian Silvermance4825f2019-02-17 18:28:39 -080062 srcs = [
63 "target_finder.cc",
64 "target_geometry.cc",
65 ],
66 hdrs = [
67 "target_finder.h",
68 "target_types.h",
69 ],
70 restricted_to = VISION_TARGETS,
Parker Schuh2a1447c2019-02-17 00:25:29 -080071 deps = [
Parker Schuhe9a549a2019-02-24 16:29:22 -080072 ":constants",
Alex Perryb6f334d2019-03-23 13:10:45 -070073 "//aos/util:math",
Brian Silvermance4825f2019-02-17 18:28:39 -080074 "//aos/vision/blob:contour",
Parker Schuh2a1447c2019-02-17 00:25:29 -080075 "//aos/vision/blob:hierarchical_contour_merge",
76 "//aos/vision/blob:region_alloc",
Parker Schuh2a1447c2019-02-17 00:25:29 -080077 "//aos/vision/blob:threshold",
78 "//aos/vision/blob:transpose",
79 "//aos/vision/debug:overlay",
80 "//aos/vision/math:vector",
Brian Silvermance4825f2019-02-17 18:28:39 -080081 "@com_google_ceres_solver//:ceres",
Parker Schuh2a1447c2019-02-17 00:25:29 -080082 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -080083)
84
85gtk_dependent_cc_binary(
86 name = "debug_viewer",
87 srcs = ["debug_viewer.cc"],
Brian Silvermance4825f2019-02-17 18:28:39 -080088 restricted_to = VISION_TARGETS,
Parker Schuh2a1447c2019-02-17 00:25:29 -080089 deps = [
90 ":target_finder",
91 "//aos/vision/blob:move_scale",
92 "//aos/vision/blob:threshold",
93 "//aos/vision/blob:transpose",
94 "//aos/vision/debug:debug_framework",
95 "//aos/vision/math:vector",
Austin Schuh75921532019-03-09 18:46:34 -080096 "@com_github_gflags_gflags//:gflags",
Parker Schuh2a1447c2019-02-17 00:25:29 -080097 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -080098)
99
100cc_binary(
101 name = "target_sender",
102 srcs = ["target_sender.cc"],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800103 restricted_to = VISION_TARGETS,
Brian Silvermance4825f2019-02-17 18:28:39 -0800104 deps = [
Austin Schuh4e2629d2019-03-28 14:44:37 -0700105 ":image_writer",
Brian Silvermance4825f2019-02-17 18:28:39 -0800106 ":target_finder",
Brian Silvermance4825f2019-02-17 18:28:39 -0800107 "//aos/vision/blob:codec",
108 "//aos/vision/blob:find_blob",
109 "//aos/vision/events:epoll_events",
110 "//aos/vision/events:socket_types",
111 "//aos/vision/events:udp",
Brian Silvermance4825f2019-02-17 18:28:39 -0800112 "//y2019/jevois:serial",
113 "//y2019/jevois:structures",
114 "//y2019/jevois:uart",
Parker Schuh5e8e3a52019-02-24 13:36:19 -0800115 "//y2019/jevois/camera:image_stream",
Austin Schuh29b6be02019-03-02 22:12:58 -0800116 "//y2019/jevois/camera:reader",
Brian Silverman58899fd2019-03-24 11:03:11 -0700117 "@com_github_google_glog//:glog",
Brian Silvermance4825f2019-02-17 18:28:39 -0800118 "@com_google_ceres_solver//:ceres",
119 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800120)
121
Parker Schuh41d72732019-02-22 22:28:04 -0800122cc_binary(
Austin Schuh29b6be02019-03-02 22:12:58 -0800123 name = "serial_waiter",
124 srcs = ["serial_waiter.cc"],
125 restricted_to = VISION_TARGETS,
126 deps = [
127 "//aos/time",
128 "//y2019/jevois:serial",
129 ],
130)
131
132cc_binary(
Parker Schuh41d72732019-02-22 22:28:04 -0800133 name = "debug_serial",
134 srcs = ["debug_serial.cc"],
135 deps = [
Austin Schuh29b6be02019-03-02 22:12:58 -0800136 "//aos/logging",
137 "//aos/logging:implementations",
Parker Schuh41d72732019-02-22 22:28:04 -0800138 "//y2019/jevois:serial",
139 "//y2019/jevois:structures",
140 "//y2019/jevois:uart",
Parker Schuh41d72732019-02-22 22:28:04 -0800141 ],
142)
143
Parker Schuh2a1447c2019-02-17 00:25:29 -0800144cc_binary(
Parker Schuh9e1d1692019-02-24 14:34:04 -0800145 name = "global_calibration",
Austin Schuh29b6be02019-03-02 22:12:58 -0800146 srcs = [
Austin Schuh29b6be02019-03-02 22:12:58 -0800147 "global_calibration.cc",
Parker Schuh2a1447c2019-02-17 00:25:29 -0800148 ],
149 restricted_to = VISION_TARGETS,
Austin Schuh29b6be02019-03-02 22:12:58 -0800150 deps = [
151 ":target_finder",
152 "//aos/logging",
153 "//aos/logging:implementations",
154 "//aos/vision/blob:codec",
155 "//aos/vision/blob:find_blob",
156 "//aos/vision/events:epoll_events",
157 "//aos/vision/events:socket_types",
158 "//aos/vision/events:udp",
159 "//aos/vision/image:image_dataset",
160 "//aos/vision/image:image_stream",
161 "//aos/vision/image:reader",
162 "@com_google_ceres_solver//:ceres",
163 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800164)