blob: e005e705286d4934f739250bec7d8f87dbe8ffe9 [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"],
Philipp Schraderdada1072020-11-24 11:34:46 -080018 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermana498bbb2019-03-03 17:18:04 -080019 visibility = ["//visibility:public"],
Parker Schuhe9a549a2019-02-24 16:29:22 -080020)
21
James Kuszmaule2c71ea2019-03-04 08:14:21 -080022cc_binary(
23 name = "constants_formatting",
24 srcs = ["constants_formatting_main.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080025 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaule2c71ea2019-03-04 08:14:21 -080026 deps = [":constants"],
27)
28
29genrule(
30 name = "generate_constants",
31 outs = ["validate_constants.cc"],
32 cmd = "$(location :constants_formatting) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -080033 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaule2c71ea2019-03-04 08:14:21 -080034 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"],
Philipp Schraderdada1072020-11-24 11:34:46 -080041 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh4e2629d2019-03-28 14:44:37 -070042 deps = [
Austin Schuh4e2629d2019-03-28 14:44:37 -070043 "//aos/vision/image:image_types",
Alex Perry670d5ac2019-04-07 14:20:31 -070044 "@com_github_google_glog//:glog",
Austin Schuh4e2629d2019-03-28 14:44:37 -070045 ],
46)
47
James Kuszmaule2c71ea2019-03-04 08:14:21 -080048sh_test(
49 name = "constants_formatting_test",
50 srcs = ["constants_formatting_test.sh"],
51 args = [
52 "$(location :constants.cc)",
53 "$(location :validate_constants.cc)",
54 ],
55 data = [
56 ":constants.cc",
57 ":validate_constants.cc",
58 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080059 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaule2c71ea2019-03-04 08:14:21 -080060)
61
Parker Schuhe9a549a2019-02-24 16:29:22 -080062cc_library(
Parker Schuh2a1447c2019-02-17 00:25:29 -080063 name = "target_finder",
Brian Silvermance4825f2019-02-17 18:28:39 -080064 srcs = [
65 "target_finder.cc",
66 "target_geometry.cc",
67 ],
68 hdrs = [
69 "target_finder.h",
70 "target_types.h",
71 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080072 target_compatible_with = VISION_TARGETS,
Parker Schuh2a1447c2019-02-17 00:25:29 -080073 deps = [
Parker Schuhe9a549a2019-02-24 16:29:22 -080074 ":constants",
Alex Perryb6f334d2019-03-23 13:10:45 -070075 "//aos/util:math",
Brian Silvermance4825f2019-02-17 18:28:39 -080076 "//aos/vision/blob:contour",
Parker Schuh2a1447c2019-02-17 00:25:29 -080077 "//aos/vision/blob:hierarchical_contour_merge",
78 "//aos/vision/blob:region_alloc",
Parker Schuh2a1447c2019-02-17 00:25:29 -080079 "//aos/vision/blob:threshold",
80 "//aos/vision/blob:transpose",
81 "//aos/vision/debug:overlay",
82 "//aos/vision/math:vector",
Brian Silvermance4825f2019-02-17 18:28:39 -080083 "@com_google_ceres_solver//:ceres",
Parker Schuh2a1447c2019-02-17 00:25:29 -080084 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -080085)
86
87gtk_dependent_cc_binary(
88 name = "debug_viewer",
89 srcs = ["debug_viewer.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080090 target_compatible_with = VISION_TARGETS,
Parker Schuh2a1447c2019-02-17 00:25:29 -080091 deps = [
92 ":target_finder",
93 "//aos/vision/blob:move_scale",
94 "//aos/vision/blob:threshold",
95 "//aos/vision/blob:transpose",
96 "//aos/vision/debug:debug_framework",
97 "//aos/vision/math:vector",
Austin Schuh75921532019-03-09 18:46:34 -080098 "@com_github_gflags_gflags//:gflags",
Parker Schuh2a1447c2019-02-17 00:25:29 -080099 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800100)
101
102cc_binary(
103 name = "target_sender",
104 srcs = ["target_sender.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800105 target_compatible_with = VISION_TARGETS,
Brian Silvermance4825f2019-02-17 18:28:39 -0800106 deps = [
Austin Schuh4e2629d2019-03-28 14:44:37 -0700107 ":image_writer",
Brian Silvermance4825f2019-02-17 18:28:39 -0800108 ":target_finder",
Brian Silvermance4825f2019-02-17 18:28:39 -0800109 "//aos/vision/blob:codec",
110 "//aos/vision/blob:find_blob",
111 "//aos/vision/events:epoll_events",
112 "//aos/vision/events:socket_types",
113 "//aos/vision/events:udp",
Brian Silvermance4825f2019-02-17 18:28:39 -0800114 "//y2019/jevois:serial",
115 "//y2019/jevois:structures",
116 "//y2019/jevois:uart",
Parker Schuh5e8e3a52019-02-24 13:36:19 -0800117 "//y2019/jevois/camera:image_stream",
Austin Schuh29b6be02019-03-02 22:12:58 -0800118 "//y2019/jevois/camera:reader",
Brian Silverman58899fd2019-03-24 11:03:11 -0700119 "@com_github_google_glog//:glog",
Brian Silvermance4825f2019-02-17 18:28:39 -0800120 "@com_google_ceres_solver//:ceres",
121 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800122)
123
Parker Schuh41d72732019-02-22 22:28:04 -0800124cc_binary(
Austin Schuh29b6be02019-03-02 22:12:58 -0800125 name = "serial_waiter",
126 srcs = ["serial_waiter.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800127 target_compatible_with = VISION_TARGETS,
Austin Schuh29b6be02019-03-02 22:12:58 -0800128 deps = [
129 "//aos/time",
130 "//y2019/jevois:serial",
131 ],
132)
133
134cc_binary(
Parker Schuh41d72732019-02-22 22:28:04 -0800135 name = "debug_serial",
136 srcs = ["debug_serial.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800137 target_compatible_with = ["@platforms//os:linux"],
Parker Schuh41d72732019-02-22 22:28:04 -0800138 deps = [
Austin Schuh29b6be02019-03-02 22:12:58 -0800139 "//aos/logging",
140 "//aos/logging:implementations",
Parker Schuh41d72732019-02-22 22:28:04 -0800141 "//y2019/jevois:serial",
142 "//y2019/jevois:structures",
143 "//y2019/jevois:uart",
Parker Schuh41d72732019-02-22 22:28:04 -0800144 ],
145)
146
Parker Schuh2a1447c2019-02-17 00:25:29 -0800147cc_binary(
Parker Schuh9e1d1692019-02-24 14:34:04 -0800148 name = "global_calibration",
Austin Schuh29b6be02019-03-02 22:12:58 -0800149 srcs = [
Austin Schuh29b6be02019-03-02 22:12:58 -0800150 "global_calibration.cc",
Parker Schuh2a1447c2019-02-17 00:25:29 -0800151 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800152 target_compatible_with = VISION_TARGETS,
Austin Schuh29b6be02019-03-02 22:12:58 -0800153 deps = [
154 ":target_finder",
155 "//aos/logging",
156 "//aos/logging:implementations",
157 "//aos/vision/blob:codec",
158 "//aos/vision/blob:find_blob",
159 "//aos/vision/events:epoll_events",
160 "//aos/vision/events:socket_types",
161 "//aos/vision/events:udp",
162 "//aos/vision/image:image_dataset",
163 "//aos/vision/image:image_stream",
164 "//aos/vision/image:reader",
165 "@com_google_ceres_solver//:ceres",
166 ],
Parker Schuh2a1447c2019-02-17 00:25:29 -0800167)