blob: aa6c96b9e749c1a7ea0a64345958a1f050fb5271 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
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
Alex Perrycb7da4b2019-08-28 19:35:56 -07008flatbuffer_cc_library(
9 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 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070013 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080014 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070015 visibility = ["//visibility:public"],
Parker Schuh4d2978f2017-02-25 11:13:06 -080016)
17
Adam Snaider13d48d92023-08-03 12:20:15 -070018proto_library(
19 name = "vision_result_proto",
Austin Schuhf9724442018-10-28 20:30:21 -070020 srcs = ["vision_result.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -080021 target_compatible_with = ["@platforms//os:linux"],
Parker Schuhd497ed62017-03-04 20:11:58 -080022)
23
Adam Snaider13d48d92023-08-03 12:20:15 -070024proto_library(
25 name = "vision_config_proto",
Austin Schuhf9724442018-10-28 20:30:21 -070026 srcs = ["vision_config.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -080027 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070028 deps = [
Adam Snaider13d48d92023-08-03 12:20:15 -070029 "//aos/vision/image:camera_params_proto",
Austin Schuhf9724442018-10-28 20:30:21 -070030 ],
Parker Schuhd497ed62017-03-04 20:11:58 -080031)
32
Adam Snaider13d48d92023-08-03 12:20:15 -070033cc_proto_library(
34 name = "vision_result",
35 target_compatible_with = ["@platforms//os:linux"],
36 deps = ["vision_result_proto"],
37)
38
39cc_proto_library(
40 name = "vision_config",
41 target_compatible_with = ["@platforms//os:linux"],
42 deps = ["vision_config_proto"],
43)
44
Parker Schuhd497ed62017-03-04 20:11:58 -080045cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070046 name = "target_sender",
47 srcs = [
48 "target_sender.cc",
49 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080050 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070051 deps = [
52 ":target_finder",
53 ":vision_config",
54 ":vision_result",
55 "//aos/logging",
Austin Schuhf9724442018-10-28 20:30:21 -070056 "//aos/time",
57 "//aos/vision/blob:codec",
58 "//aos/vision/blob:find_blob",
59 "//aos/vision/blob:range_image",
60 "//aos/vision/blob:threshold",
61 "//aos/vision/events:epoll_events",
62 "//aos/vision/events:socket_types",
63 "//aos/vision/events:udp",
64 "//aos/vision/image:image_stream",
65 "//aos/vision/image:jpeg_routines",
66 "//aos/vision/image:reader",
67 ],
Parker Schuh4d2978f2017-02-25 11:13:06 -080068)
69
70cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070071 name = "target_receiver",
72 srcs = [
73 "target_receiver.cc",
74 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070076 visibility = ["//visibility:public"],
77 deps = [
78 ":target_finder",
Alex Perrycb7da4b2019-08-28 19:35:56 -070079 ":vision_fbs",
Austin Schuhf9724442018-10-28 20:30:21 -070080 ":vision_result",
81 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -070082 "//aos/events:shm_event_loop",
Austin Schuhf9724442018-10-28 20:30:21 -070083 "//aos/logging",
Austin Schuhf9724442018-10-28 20:30:21 -070084 "//aos/time",
85 "//aos/vision/events:udp",
86 ],
Parker Schuh4d2978f2017-02-25 11:13:06 -080087)
Parker Schuhf7481be2017-03-04 18:24:33 -080088
89cc_library(
Austin Schuhf9724442018-10-28 20:30:21 -070090 name = "target_finder",
91 srcs = ["target_finder.cc"],
92 hdrs = ["target_finder.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080093 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070094 deps = [
95 "//aos/vision/blob:threshold",
96 "//aos/vision/blob:transpose",
97 "//aos/vision/debug:overlay",
98 "//aos/vision/math:vector",
99 ],
Parker Schuhf7481be2017-03-04 18:24:33 -0800100)
Parker Schuh9ef66132017-03-05 16:18:36 -0800101
102gtk_dependent_cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -0700103 name = "debug_viewer",
104 srcs = ["debug_viewer.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800105 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -0700106 deps = [
107 ":target_finder",
108 "//aos/vision/blob:move_scale",
109 "//aos/vision/blob:threshold",
110 "//aos/vision/blob:transpose",
111 "//aos/vision/debug:debug_framework",
112 "//aos/vision/math:vector",
113 ],
Parker Schuh9ef66132017-03-05 16:18:36 -0800114)