blob: 22b973a46e213d682b3148b58580e38f6a78435c [file] [log] [blame]
Parker Schuh2a1447c2019-02-17 00:25:29 -08001load("//tools/build_rules:gtk_dependent.bzl", "gtk_dependent_cc_binary", "gtk_dependent_cc_library")
2load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
Brian Silvermana498bbb2019-03-03 17:18:04 -08003load("//tools:environments.bzl", "mcu_cpus")
Parker Schuh2a1447c2019-02-17 00:25:29 -08004
5package(default_visibility = ["//visibility:public"])
6
Brian Silvermance4825f2019-02-17 18:28:39 -08007VISION_TARGETS = [
8 "//tools:k8",
9 "//tools:armhf-debian",
10]
Parker Schuh2a1447c2019-02-17 00:25:29 -080011
12cc_library(
Parker Schuhe9a549a2019-02-24 16:29:22 -080013 name = "constants",
James Kuszmaule2c71ea2019-03-04 08:14:21 -080014 srcs = [
15 "constants.cc",
16 "constants_formatting.cc",
17 ],
Austin Schuh29b6be02019-03-02 22:12:58 -080018 hdrs = ["constants.h"],
Brian Silvermana498bbb2019-03-03 17:18:04 -080019 compatible_with = mcu_cpus,
20 visibility = ["//visibility:public"],
Parker Schuhe9a549a2019-02-24 16:29:22 -080021)
22
James Kuszmaule2c71ea2019-03-04 08:14:21 -080023cc_binary(
24 name = "constants_formatting",
25 srcs = ["constants_formatting_main.cc"],
26 deps = [":constants"],
27)
28
29genrule(
30 name = "generate_constants",
31 outs = ["validate_constants.cc"],
32 cmd = "$(location :constants_formatting) $(OUTS)",
33 tools = [":constants_formatting"],
34)
35
Austin Schuh4e2629d2019-03-28 14:44:37 -070036cc_library(
37 name = "image_writer",
38 srcs = ["image_writer.cc"],
39 hdrs = ["image_writer.h"],
40 deps = [
Austin Schuh4e2629d2019-03-28 14:44:37 -070041 "//aos/vision/image:image_types",
Alex Perry670d5ac2019-04-07 14:20:31 -070042 "@com_github_google_glog//:glog",
Austin Schuh4e2629d2019-03-28 14:44:37 -070043 ],
44)
45
James Kuszmaule2c71ea2019-03-04 08:14:21 -080046sh_test(
47 name = "constants_formatting_test",
48 srcs = ["constants_formatting_test.sh"],
49 args = [
50 "$(location :constants.cc)",
51 "$(location :validate_constants.cc)",
52 ],
53 data = [
54 ":constants.cc",
55 ":validate_constants.cc",
56 ],
57)
58
Parker Schuhe9a549a2019-02-24 16:29:22 -080059cc_library(
Parker Schuh2a1447c2019-02-17 00:25:29 -080060 name = "target_finder",
Brian Silvermance4825f2019-02-17 18:28:39 -080061 srcs = [
62 "target_finder.cc",
63 "target_geometry.cc",
64 ],
65 hdrs = [
66 "target_finder.h",
67 "target_types.h",
68 ],
69 restricted_to = VISION_TARGETS,
Parker Schuh2a1447c2019-02-17 00:25:29 -080070 deps = [
Parker Schuhe9a549a2019-02-24 16:29:22 -080071 ":constants",
Alex Perryb6f334d2019-03-23 13:10:45 -070072 "//aos/util:math",
Brian Silvermance4825f2019-02-17 18:28:39 -080073 "//aos/vision/blob:contour",
Parker Schuh2a1447c2019-02-17 00:25:29 -080074 "//aos/vision/blob:hierarchical_contour_merge",
75 "//aos/vision/blob:region_alloc",
Parker Schuh2a1447c2019-02-17 00:25:29 -080076 "//aos/vision/blob:threshold",
77 "//aos/vision/blob:transpose",
78 "//aos/vision/debug:overlay",
79 "//aos/vision/math:vector",
Brian Silvermance4825f2019-02-17 18:28:39 -080080 "@com_google_ceres_solver//:ceres",
Parker Schuh2a1447c2019-02-17 00:25:29 -080081 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -080082)
83
84gtk_dependent_cc_binary(
85 name = "debug_viewer",
86 srcs = ["debug_viewer.cc"],
Brian Silvermance4825f2019-02-17 18:28:39 -080087 restricted_to = VISION_TARGETS,
Parker Schuh2a1447c2019-02-17 00:25:29 -080088 deps = [
89 ":target_finder",
90 "//aos/vision/blob:move_scale",
91 "//aos/vision/blob:threshold",
92 "//aos/vision/blob:transpose",
93 "//aos/vision/debug:debug_framework",
94 "//aos/vision/math:vector",
Austin Schuh75921532019-03-09 18:46:34 -080095 "@com_github_gflags_gflags//:gflags",
Parker Schuh2a1447c2019-02-17 00:25:29 -080096 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -080097)
98
99cc_binary(
100 name = "target_sender",
101 srcs = ["target_sender.cc"],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800102 restricted_to = VISION_TARGETS,
Brian Silvermance4825f2019-02-17 18:28:39 -0800103 deps = [
Austin Schuh4e2629d2019-03-28 14:44:37 -0700104 ":image_writer",
Brian Silvermance4825f2019-02-17 18:28:39 -0800105 ":target_finder",
Brian Silvermance4825f2019-02-17 18:28:39 -0800106 "//aos/vision/blob:codec",
107 "//aos/vision/blob:find_blob",
108 "//aos/vision/events:epoll_events",
109 "//aos/vision/events:socket_types",
110 "//aos/vision/events:udp",
Brian Silvermance4825f2019-02-17 18:28:39 -0800111 "//y2019/jevois:serial",
112 "//y2019/jevois:structures",
113 "//y2019/jevois:uart",
Parker Schuh5e8e3a52019-02-24 13:36:19 -0800114 "//y2019/jevois/camera:image_stream",
Austin Schuh29b6be02019-03-02 22:12:58 -0800115 "//y2019/jevois/camera:reader",
Brian Silverman58899fd2019-03-24 11:03:11 -0700116 "@com_github_google_glog//:glog",
Brian Silvermance4825f2019-02-17 18:28:39 -0800117 "@com_google_ceres_solver//:ceres",
118 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800119)
120
Parker Schuh41d72732019-02-22 22:28:04 -0800121cc_binary(
Austin Schuh29b6be02019-03-02 22:12:58 -0800122 name = "serial_waiter",
123 srcs = ["serial_waiter.cc"],
124 restricted_to = VISION_TARGETS,
125 deps = [
126 "//aos/time",
127 "//y2019/jevois:serial",
128 ],
129)
130
131cc_binary(
Parker Schuh41d72732019-02-22 22:28:04 -0800132 name = "debug_serial",
133 srcs = ["debug_serial.cc"],
134 deps = [
Austin Schuh29b6be02019-03-02 22:12:58 -0800135 "//aos/logging",
136 "//aos/logging:implementations",
Parker Schuh41d72732019-02-22 22:28:04 -0800137 "//y2019/jevois:serial",
138 "//y2019/jevois:structures",
139 "//y2019/jevois:uart",
Parker Schuh41d72732019-02-22 22:28:04 -0800140 ],
141)
142
Parker Schuh2a1447c2019-02-17 00:25:29 -0800143cc_binary(
Parker Schuh9e1d1692019-02-24 14:34:04 -0800144 name = "global_calibration",
Austin Schuh29b6be02019-03-02 22:12:58 -0800145 srcs = [
Austin Schuh29b6be02019-03-02 22:12:58 -0800146 "global_calibration.cc",
Parker Schuh2a1447c2019-02-17 00:25:29 -0800147 ],
148 restricted_to = VISION_TARGETS,
Austin Schuh29b6be02019-03-02 22:12:58 -0800149 deps = [
150 ":target_finder",
151 "//aos/logging",
152 "//aos/logging:implementations",
153 "//aos/vision/blob:codec",
154 "//aos/vision/blob:find_blob",
155 "//aos/vision/events:epoll_events",
156 "//aos/vision/events:socket_types",
157 "//aos/vision/events:udp",
158 "//aos/vision/image:image_dataset",
159 "//aos/vision/image:image_stream",
160 "//aos/vision/image:reader",
161 "@com_google_ceres_solver//:ceres",
162 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800163)