blob: e7e3b8c480f5830ffed99d80d3d0c2e89c108800 [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",
Austin Schuhf9724442018-10-28 20:30:21 -070043 "//aos/time",
44 "//aos/vision/blob:codec",
45 "//aos/vision/blob:find_blob",
46 "//aos/vision/blob:range_image",
47 "//aos/vision/blob:threshold",
48 "//aos/vision/events:epoll_events",
49 "//aos/vision/events:socket_types",
50 "//aos/vision/events:udp",
51 "//aos/vision/image:image_stream",
52 "//aos/vision/image:jpeg_routines",
53 "//aos/vision/image:reader",
54 ],
Parker Schuh4d2978f2017-02-25 11:13:06 -080055)
56
57cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070058 name = "target_receiver",
59 srcs = [
60 "target_receiver.cc",
61 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080062 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070063 visibility = ["//visibility:public"],
64 deps = [
65 ":target_finder",
Alex Perrycb7da4b2019-08-28 19:35:56 -070066 ":vision_fbs",
Austin Schuhf9724442018-10-28 20:30:21 -070067 ":vision_result",
68 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -070069 "//aos/events:shm_event_loop",
Austin Schuhf9724442018-10-28 20:30:21 -070070 "//aos/logging",
Austin Schuhf9724442018-10-28 20:30:21 -070071 "//aos/time",
72 "//aos/vision/events:udp",
73 ],
Parker Schuh4d2978f2017-02-25 11:13:06 -080074)
Parker Schuhf7481be2017-03-04 18:24:33 -080075
76cc_library(
Austin Schuhf9724442018-10-28 20:30:21 -070077 name = "target_finder",
78 srcs = ["target_finder.cc"],
79 hdrs = ["target_finder.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080080 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070081 deps = [
82 "//aos/vision/blob:threshold",
83 "//aos/vision/blob:transpose",
84 "//aos/vision/debug:overlay",
85 "//aos/vision/math:vector",
86 ],
Parker Schuhf7481be2017-03-04 18:24:33 -080087)
Parker Schuh9ef66132017-03-05 16:18:36 -080088
89gtk_dependent_cc_binary(
Austin Schuhf9724442018-10-28 20:30:21 -070090 name = "debug_viewer",
91 srcs = ["debug_viewer.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080092 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhf9724442018-10-28 20:30:21 -070093 deps = [
94 ":target_finder",
95 "//aos/vision/blob:move_scale",
96 "//aos/vision/blob:threshold",
97 "//aos/vision/blob:transpose",
98 "//aos/vision/debug:debug_framework",
99 "//aos/vision/math:vector",
100 ],
Parker Schuh9ef66132017-03-05 16:18:36 -0800101)