blob: c4045b88c04e1a1a66641c360522a76843663edb [file] [log] [blame]
James Kuszmaulf01da392023-12-14 11:22:14 -08001load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Philipp Schraderdada1072020-11-24 11:34:46 -08002load("//tools/build_rules:gtk_dependent.bzl", "gtk_dependent_cc_binary")
Adam Snaider13d48d92023-08-03 12:20:15 -07003load("@rules_cc//cc:defs.bzl", "cc_proto_library")
4load("@rules_proto//proto:defs.bzl", "proto_library")
Parker Schuh4d2978f2017-02-25 11:13:06 -08005
6package(default_visibility = ["//visibility:public"])
7
James Kuszmaulf01da392023-12-14 11:22:14 -08008static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -07009 name = "vision_fbs",
Austin Schuhf9724442018-10-28 20:30:21 -070010 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070011 "vision.fbs",
Austin Schuhf9724442018-10-28 20:30:21 -070012 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080013 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070014 visibility = ["//visibility:public"],
Parker Schuh4d2978f2017-02-25 11:13:06 -080015)
16
Adam Snaider13d48d92023-08-03 12:20:15 -070017proto_library(
18 name = "vision_result_proto",
Austin Schuhf9724442018-10-28 20:30:21 -070019 srcs = ["vision_result.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -080020 target_compatible_with = ["@platforms//os:linux"],
Parker Schuhd497ed62017-03-04 20:11:58 -080021)
22
Adam Snaider13d48d92023-08-03 12:20:15 -070023proto_library(
24 name = "vision_config_proto",
Austin Schuhf9724442018-10-28 20:30:21 -070025 srcs = ["vision_config.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -080026 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070027 deps = [
Adam Snaider13d48d92023-08-03 12:20:15 -070028 "//aos/vision/image:camera_params_proto",
Austin Schuhf9724442018-10-28 20:30:21 -070029 ],
Parker Schuhd497ed62017-03-04 20:11:58 -080030)
31
Adam Snaider13d48d92023-08-03 12:20:15 -070032cc_proto_library(
33 name = "vision_result",
34 target_compatible_with = ["@platforms//os:linux"],
35 deps = ["vision_result_proto"],
36)
37
38cc_proto_library(
39 name = "vision_config",
40 target_compatible_with = ["@platforms//os:linux"],
41 deps = ["vision_config_proto"],
42)
43
Parker Schuhd497ed62017-03-04 20:11:58 -080044cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070045 name = "target_sender",
46 srcs = [
47 "target_sender.cc",
48 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080049 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070050 deps = [
51 ":target_finder",
52 ":vision_config",
53 ":vision_result",
54 "//aos/logging",
Austin Schuhf9724442018-10-28 20:30:21 -070055 "//aos/time",
56 "//aos/vision/blob:codec",
57 "//aos/vision/blob:find_blob",
58 "//aos/vision/blob:range_image",
59 "//aos/vision/blob:threshold",
60 "//aos/vision/events:epoll_events",
61 "//aos/vision/events:socket_types",
62 "//aos/vision/events:udp",
63 "//aos/vision/image:image_stream",
64 "//aos/vision/image:jpeg_routines",
65 "//aos/vision/image:reader",
66 ],
Parker Schuh4d2978f2017-02-25 11:13:06 -080067)
68
69cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070070 name = "target_receiver",
71 srcs = [
72 "target_receiver.cc",
73 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080074 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070075 visibility = ["//visibility:public"],
76 deps = [
77 ":target_finder",
Alex Perrycb7da4b2019-08-28 19:35:56 -070078 ":vision_fbs",
Austin Schuhf9724442018-10-28 20:30:21 -070079 ":vision_result",
80 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -070081 "//aos/events:shm_event_loop",
Austin Schuhf9724442018-10-28 20:30:21 -070082 "//aos/logging",
Austin Schuhf9724442018-10-28 20:30:21 -070083 "//aos/time",
84 "//aos/vision/events:udp",
85 ],
Parker Schuh4d2978f2017-02-25 11:13:06 -080086)
Parker Schuhf7481be2017-03-04 18:24:33 -080087
88cc_library(
Austin Schuhf9724442018-10-28 20:30:21 -070089 name = "target_finder",
90 srcs = ["target_finder.cc"],
91 hdrs = ["target_finder.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080092 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070093 deps = [
94 "//aos/vision/blob:threshold",
95 "//aos/vision/blob:transpose",
96 "//aos/vision/debug:overlay",
97 "//aos/vision/math:vector",
98 ],
Parker Schuhf7481be2017-03-04 18:24:33 -080099)
Parker Schuh9ef66132017-03-05 16:18:36 -0800100
101gtk_dependent_cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -0700102 name = "debug_viewer",
103 srcs = ["debug_viewer.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800104 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -0700105 deps = [
106 ":target_finder",
107 "//aos/vision/blob:move_scale",
108 "//aos/vision/blob:threshold",
109 "//aos/vision/blob:transpose",
110 "//aos/vision/debug:debug_framework",
111 "//aos/vision/math:vector",
112 ],
Parker Schuh9ef66132017-03-05 16:18:36 -0800113)