blob: 87ce17e8d017bc8237d8a320b05f16506d326550 [file] [log] [blame]
Philipp Schraderdada1072020-11-24 11:34:46 -08001load("//tools:platforms.bzl", "platforms")
2load("//tools/build_rules:gtk_dependent.bzl", "gtk_dependent_cc_binary")
Parker Schuh2a1447c2019-02-17 00:25:29 -08003
4package(default_visibility = ["//visibility:public"])
5
Philipp Schraderdada1072020-11-24 11:34:46 -08006VISION_TARGETS = platforms.any_of([
7 "@platforms//cpu:x86_64",
8 "//tools/platforms/hardware:raspberry_pi",
9])
Parker Schuh2a1447c2019-02-17 00:25:29 -080010
11cc_library(
Parker Schuhe9a549a2019-02-24 16:29:22 -080012 name = "constants",
James Kuszmaule2c71ea2019-03-04 08:14:21 -080013 srcs = [
14 "constants.cc",
15 "constants_formatting.cc",
16 ],
Austin Schuh29b6be02019-03-02 22:12:58 -080017 hdrs = ["constants.h"],
Brian Silvermana498bbb2019-03-03 17:18:04 -080018 visibility = ["//visibility:public"],
Parker Schuhe9a549a2019-02-24 16:29:22 -080019)
20
James Kuszmaule2c71ea2019-03-04 08:14:21 -080021cc_binary(
22 name = "constants_formatting",
23 srcs = ["constants_formatting_main.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080024 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaule2c71ea2019-03-04 08:14:21 -080025 deps = [":constants"],
26)
27
28genrule(
29 name = "generate_constants",
30 outs = ["validate_constants.cc"],
31 cmd = "$(location :constants_formatting) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -080032 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaule2c71ea2019-03-04 08:14:21 -080033 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"],
Philipp Schraderdada1072020-11-24 11:34:46 -080040 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh4e2629d2019-03-28 14:44:37 -070041 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 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080058 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaule2c71ea2019-03-04 08:14:21 -080059)
60
Parker Schuhe9a549a2019-02-24 16:29:22 -080061cc_library(
Parker Schuh2a1447c2019-02-17 00:25:29 -080062 name = "target_finder",
Brian Silvermance4825f2019-02-17 18:28:39 -080063 srcs = [
64 "target_finder.cc",
65 "target_geometry.cc",
66 ],
67 hdrs = [
68 "target_finder.h",
69 "target_types.h",
70 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080071 target_compatible_with = VISION_TARGETS,
Parker Schuh2a1447c2019-02-17 00:25:29 -080072 deps = [
Parker Schuhe9a549a2019-02-24 16:29:22 -080073 ":constants",
Alex Perryb6f334d2019-03-23 13:10:45 -070074 "//aos/util:math",
Brian Silvermance4825f2019-02-17 18:28:39 -080075 "//aos/vision/blob:contour",
Parker Schuh2a1447c2019-02-17 00:25:29 -080076 "//aos/vision/blob:hierarchical_contour_merge",
77 "//aos/vision/blob:region_alloc",
Parker Schuh2a1447c2019-02-17 00:25:29 -080078 "//aos/vision/blob:threshold",
79 "//aos/vision/blob:transpose",
80 "//aos/vision/debug:overlay",
81 "//aos/vision/math:vector",
Brian Silvermance4825f2019-02-17 18:28:39 -080082 "@com_google_ceres_solver//:ceres",
Parker Schuh2a1447c2019-02-17 00:25:29 -080083 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -080084)
85
86gtk_dependent_cc_binary(
87 name = "debug_viewer",
88 srcs = ["debug_viewer.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080089 target_compatible_with = VISION_TARGETS,
Parker Schuh2a1447c2019-02-17 00:25:29 -080090 deps = [
91 ":target_finder",
92 "//aos/vision/blob:move_scale",
93 "//aos/vision/blob:threshold",
94 "//aos/vision/blob:transpose",
95 "//aos/vision/debug:debug_framework",
96 "//aos/vision/math:vector",
Austin Schuh75921532019-03-09 18:46:34 -080097 "@com_github_gflags_gflags//:gflags",
Parker Schuh2a1447c2019-02-17 00:25:29 -080098 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -080099)
100
101cc_binary(
102 name = "target_sender",
103 srcs = ["target_sender.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800104 target_compatible_with = VISION_TARGETS,
Brian Silvermance4825f2019-02-17 18:28:39 -0800105 deps = [
Austin Schuh4e2629d2019-03-28 14:44:37 -0700106 ":image_writer",
Brian Silvermance4825f2019-02-17 18:28:39 -0800107 ":target_finder",
Brian Silvermance4825f2019-02-17 18:28:39 -0800108 "//aos/vision/blob:codec",
109 "//aos/vision/blob:find_blob",
110 "//aos/vision/events:epoll_events",
111 "//aos/vision/events:socket_types",
112 "//aos/vision/events:udp",
Brian Silvermance4825f2019-02-17 18:28:39 -0800113 "//y2019/jevois:serial",
114 "//y2019/jevois:structures",
115 "//y2019/jevois:uart",
Parker Schuh5e8e3a52019-02-24 13:36:19 -0800116 "//y2019/jevois/camera:image_stream",
Austin Schuh29b6be02019-03-02 22:12:58 -0800117 "//y2019/jevois/camera:reader",
Brian Silverman58899fd2019-03-24 11:03:11 -0700118 "@com_github_google_glog//:glog",
Brian Silvermance4825f2019-02-17 18:28:39 -0800119 "@com_google_ceres_solver//:ceres",
120 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800121)
122
Parker Schuh41d72732019-02-22 22:28:04 -0800123cc_binary(
Austin Schuh29b6be02019-03-02 22:12:58 -0800124 name = "serial_waiter",
125 srcs = ["serial_waiter.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800126 target_compatible_with = VISION_TARGETS,
Austin Schuh29b6be02019-03-02 22:12:58 -0800127 deps = [
128 "//aos/time",
129 "//y2019/jevois:serial",
130 ],
131)
132
133cc_binary(
Parker Schuh41d72732019-02-22 22:28:04 -0800134 name = "debug_serial",
135 srcs = ["debug_serial.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800136 target_compatible_with = ["@platforms//os:linux"],
Parker Schuh41d72732019-02-22 22:28:04 -0800137 deps = [
Austin Schuh29b6be02019-03-02 22:12:58 -0800138 "//aos/logging",
139 "//aos/logging:implementations",
Parker Schuh41d72732019-02-22 22:28:04 -0800140 "//y2019/jevois:serial",
141 "//y2019/jevois:structures",
142 "//y2019/jevois:uart",
Parker Schuh41d72732019-02-22 22:28:04 -0800143 ],
144)
145
Parker Schuh2a1447c2019-02-17 00:25:29 -0800146cc_binary(
Parker Schuh9e1d1692019-02-24 14:34:04 -0800147 name = "global_calibration",
Austin Schuh29b6be02019-03-02 22:12:58 -0800148 srcs = [
Austin Schuh29b6be02019-03-02 22:12:58 -0800149 "global_calibration.cc",
Parker Schuh2a1447c2019-02-17 00:25:29 -0800150 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800151 target_compatible_with = VISION_TARGETS,
Austin Schuh29b6be02019-03-02 22:12:58 -0800152 deps = [
153 ":target_finder",
154 "//aos/logging",
155 "//aos/logging:implementations",
156 "//aos/vision/blob:codec",
157 "//aos/vision/blob:find_blob",
158 "//aos/vision/events:epoll_events",
159 "//aos/vision/events:socket_types",
160 "//aos/vision/events:udp",
161 "//aos/vision/image:image_dataset",
162 "//aos/vision/image:image_stream",
163 "//aos/vision/image:reader",
164 "@com_google_ceres_solver//:ceres",
165 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800166)