blob: 62e2278b174d3ff0a89005c28b31781c1ea51001 [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")
Austin Schuhf9724442018-10-28 20:30:21 -07003load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
Parker Schuh4d2978f2017-02-25 11:13:06 -08004
5package(default_visibility = ["//visibility:public"])
6
Alex Perrycb7da4b2019-08-28 19:35:56 -07007flatbuffer_cc_library(
8 name = "vision_fbs",
Austin Schuhf9724442018-10-28 20:30:21 -07009 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070010 "vision.fbs",
Austin Schuhf9724442018-10-28 20:30:21 -070011 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070012 gen_reflections = 1,
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
Austin Schuhf9724442018-10-28 20:30:21 -070017cc_proto_library(
18 name = "vision_result",
19 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
Austin Schuhf9724442018-10-28 20:30:21 -070023cc_proto_library(
24 name = "vision_config",
25 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 = [
28 "//aos/vision/image:camera_params",
29 ],
Parker Schuhd497ed62017-03-04 20:11:58 -080030)
31
32cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070033 name = "target_sender",
34 srcs = [
35 "target_sender.cc",
36 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080037 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070038 deps = [
39 ":target_finder",
40 ":vision_config",
41 ":vision_result",
42 "//aos/logging",
43 "//aos/logging:implementations",
44 "//aos/time",
45 "//aos/vision/blob:codec",
46 "//aos/vision/blob:find_blob",
47 "//aos/vision/blob:range_image",
48 "//aos/vision/blob:threshold",
49 "//aos/vision/events:epoll_events",
50 "//aos/vision/events:socket_types",
51 "//aos/vision/events:udp",
52 "//aos/vision/image:image_stream",
53 "//aos/vision/image:jpeg_routines",
54 "//aos/vision/image:reader",
55 ],
Parker Schuh4d2978f2017-02-25 11:13:06 -080056)
57
58cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070059 name = "target_receiver",
60 srcs = [
61 "target_receiver.cc",
62 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080063 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070064 visibility = ["//visibility:public"],
65 deps = [
66 ":target_finder",
Alex Perrycb7da4b2019-08-28 19:35:56 -070067 ":vision_fbs",
Austin Schuhf9724442018-10-28 20:30:21 -070068 ":vision_result",
69 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -070070 "//aos/events:shm_event_loop",
Austin Schuhf9724442018-10-28 20:30:21 -070071 "//aos/logging",
Austin Schuhf9724442018-10-28 20:30:21 -070072 "//aos/time",
73 "//aos/vision/events:udp",
74 ],
Parker Schuh4d2978f2017-02-25 11:13:06 -080075)
Parker Schuhf7481be2017-03-04 18:24:33 -080076
77cc_library(
Austin Schuhf9724442018-10-28 20:30:21 -070078 name = "target_finder",
79 srcs = ["target_finder.cc"],
80 hdrs = ["target_finder.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080081 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070082 deps = [
83 "//aos/vision/blob:threshold",
84 "//aos/vision/blob:transpose",
85 "//aos/vision/debug:overlay",
86 "//aos/vision/math:vector",
87 ],
Parker Schuhf7481be2017-03-04 18:24:33 -080088)
Parker Schuh9ef66132017-03-05 16:18:36 -080089
90gtk_dependent_cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070091 name = "debug_viewer",
92 srcs = ["debug_viewer.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080093 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070094 deps = [
95 ":target_finder",
96 "//aos/vision/blob:move_scale",
97 "//aos/vision/blob:threshold",
98 "//aos/vision/blob:transpose",
99 "//aos/vision/debug:debug_framework",
100 "//aos/vision/math:vector",
101 ],
Parker Schuh9ef66132017-03-05 16:18:36 -0800102)