Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 1 | load("//aos/build:queues.bzl", "queue_library") |
| 2 | load("//tools/build_rules:gtk_dependent.bzl", "gtk_dependent_cc_binary", "gtk_dependent_cc_library") |
| 3 | load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library") |
Brian Silverman | a498bbb | 2019-03-03 17:18:04 -0800 | [diff] [blame] | 4 | load("//tools:environments.bzl", "mcu_cpus") |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 5 | |
| 6 | package(default_visibility = ["//visibility:public"]) |
| 7 | |
Brian Silverman | ce4825f | 2019-02-17 18:28:39 -0800 | [diff] [blame] | 8 | VISION_TARGETS = [ |
| 9 | "//tools:k8", |
| 10 | "//tools:armhf-debian", |
| 11 | ] |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 12 | |
| 13 | cc_library( |
Parker Schuh | e9a549a | 2019-02-24 16:29:22 -0800 | [diff] [blame] | 14 | name = "constants", |
James Kuszmaul | e2c71ea | 2019-03-04 08:14:21 -0800 | [diff] [blame] | 15 | srcs = [ |
| 16 | "constants.cc", |
| 17 | "constants_formatting.cc", |
| 18 | ], |
Austin Schuh | 29b6be0 | 2019-03-02 22:12:58 -0800 | [diff] [blame] | 19 | hdrs = ["constants.h"], |
Brian Silverman | a498bbb | 2019-03-03 17:18:04 -0800 | [diff] [blame] | 20 | compatible_with = mcu_cpus, |
| 21 | visibility = ["//visibility:public"], |
Parker Schuh | e9a549a | 2019-02-24 16:29:22 -0800 | [diff] [blame] | 22 | ) |
| 23 | |
James Kuszmaul | e2c71ea | 2019-03-04 08:14:21 -0800 | [diff] [blame] | 24 | cc_binary( |
| 25 | name = "constants_formatting", |
| 26 | srcs = ["constants_formatting_main.cc"], |
| 27 | deps = [":constants"], |
| 28 | ) |
| 29 | |
| 30 | genrule( |
| 31 | name = "generate_constants", |
| 32 | outs = ["validate_constants.cc"], |
| 33 | cmd = "$(location :constants_formatting) $(OUTS)", |
| 34 | tools = [":constants_formatting"], |
| 35 | ) |
| 36 | |
Austin Schuh | 4e2629d | 2019-03-28 14:44:37 -0700 | [diff] [blame] | 37 | cc_library( |
| 38 | name = "image_writer", |
| 39 | srcs = ["image_writer.cc"], |
| 40 | hdrs = ["image_writer.h"], |
| 41 | deps = [ |
Austin Schuh | 4e2629d | 2019-03-28 14:44:37 -0700 | [diff] [blame] | 42 | "//aos/vision/image:image_types", |
Alex Perry | 670d5ac | 2019-04-07 14:20:31 -0700 | [diff] [blame^] | 43 | "@com_github_google_glog//:glog", |
Austin Schuh | 4e2629d | 2019-03-28 14:44:37 -0700 | [diff] [blame] | 44 | ], |
| 45 | ) |
| 46 | |
James Kuszmaul | e2c71ea | 2019-03-04 08:14:21 -0800 | [diff] [blame] | 47 | sh_test( |
| 48 | name = "constants_formatting_test", |
| 49 | srcs = ["constants_formatting_test.sh"], |
| 50 | args = [ |
| 51 | "$(location :constants.cc)", |
| 52 | "$(location :validate_constants.cc)", |
| 53 | ], |
| 54 | data = [ |
| 55 | ":constants.cc", |
| 56 | ":validate_constants.cc", |
| 57 | ], |
| 58 | ) |
| 59 | |
Parker Schuh | e9a549a | 2019-02-24 16:29:22 -0800 | [diff] [blame] | 60 | cc_library( |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 61 | name = "target_finder", |
Brian Silverman | ce4825f | 2019-02-17 18:28:39 -0800 | [diff] [blame] | 62 | srcs = [ |
| 63 | "target_finder.cc", |
| 64 | "target_geometry.cc", |
| 65 | ], |
| 66 | hdrs = [ |
| 67 | "target_finder.h", |
| 68 | "target_types.h", |
| 69 | ], |
| 70 | restricted_to = VISION_TARGETS, |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 71 | deps = [ |
Parker Schuh | e9a549a | 2019-02-24 16:29:22 -0800 | [diff] [blame] | 72 | ":constants", |
Alex Perry | b6f334d | 2019-03-23 13:10:45 -0700 | [diff] [blame] | 73 | "//aos/util:math", |
Brian Silverman | ce4825f | 2019-02-17 18:28:39 -0800 | [diff] [blame] | 74 | "//aos/vision/blob:contour", |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 75 | "//aos/vision/blob:hierarchical_contour_merge", |
| 76 | "//aos/vision/blob:region_alloc", |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 77 | "//aos/vision/blob:threshold", |
| 78 | "//aos/vision/blob:transpose", |
| 79 | "//aos/vision/debug:overlay", |
| 80 | "//aos/vision/math:vector", |
Brian Silverman | ce4825f | 2019-02-17 18:28:39 -0800 | [diff] [blame] | 81 | "@com_google_ceres_solver//:ceres", |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 82 | ], |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 83 | ) |
| 84 | |
| 85 | gtk_dependent_cc_binary( |
| 86 | name = "debug_viewer", |
| 87 | srcs = ["debug_viewer.cc"], |
Brian Silverman | ce4825f | 2019-02-17 18:28:39 -0800 | [diff] [blame] | 88 | restricted_to = VISION_TARGETS, |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 89 | deps = [ |
| 90 | ":target_finder", |
| 91 | "//aos/vision/blob:move_scale", |
| 92 | "//aos/vision/blob:threshold", |
| 93 | "//aos/vision/blob:transpose", |
| 94 | "//aos/vision/debug:debug_framework", |
| 95 | "//aos/vision/math:vector", |
Austin Schuh | 7592153 | 2019-03-09 18:46:34 -0800 | [diff] [blame] | 96 | "@com_github_gflags_gflags//:gflags", |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 97 | ], |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 98 | ) |
| 99 | |
| 100 | cc_binary( |
| 101 | name = "target_sender", |
| 102 | srcs = ["target_sender.cc"], |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 103 | restricted_to = VISION_TARGETS, |
Brian Silverman | ce4825f | 2019-02-17 18:28:39 -0800 | [diff] [blame] | 104 | deps = [ |
Austin Schuh | 4e2629d | 2019-03-28 14:44:37 -0700 | [diff] [blame] | 105 | ":image_writer", |
Brian Silverman | ce4825f | 2019-02-17 18:28:39 -0800 | [diff] [blame] | 106 | ":target_finder", |
Brian Silverman | ce4825f | 2019-02-17 18:28:39 -0800 | [diff] [blame] | 107 | "//aos/vision/blob:codec", |
| 108 | "//aos/vision/blob:find_blob", |
| 109 | "//aos/vision/events:epoll_events", |
| 110 | "//aos/vision/events:socket_types", |
| 111 | "//aos/vision/events:udp", |
Brian Silverman | ce4825f | 2019-02-17 18:28:39 -0800 | [diff] [blame] | 112 | "//y2019/jevois:serial", |
| 113 | "//y2019/jevois:structures", |
| 114 | "//y2019/jevois:uart", |
Parker Schuh | 5e8e3a5 | 2019-02-24 13:36:19 -0800 | [diff] [blame] | 115 | "//y2019/jevois/camera:image_stream", |
Austin Schuh | 29b6be0 | 2019-03-02 22:12:58 -0800 | [diff] [blame] | 116 | "//y2019/jevois/camera:reader", |
Brian Silverman | 58899fd | 2019-03-24 11:03:11 -0700 | [diff] [blame] | 117 | "@com_github_google_glog//:glog", |
Brian Silverman | ce4825f | 2019-02-17 18:28:39 -0800 | [diff] [blame] | 118 | "@com_google_ceres_solver//:ceres", |
| 119 | ], |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 120 | ) |
| 121 | |
Parker Schuh | 41d7273 | 2019-02-22 22:28:04 -0800 | [diff] [blame] | 122 | cc_binary( |
Austin Schuh | 29b6be0 | 2019-03-02 22:12:58 -0800 | [diff] [blame] | 123 | name = "serial_waiter", |
| 124 | srcs = ["serial_waiter.cc"], |
| 125 | restricted_to = VISION_TARGETS, |
| 126 | deps = [ |
| 127 | "//aos/time", |
| 128 | "//y2019/jevois:serial", |
| 129 | ], |
| 130 | ) |
| 131 | |
| 132 | cc_binary( |
Parker Schuh | 41d7273 | 2019-02-22 22:28:04 -0800 | [diff] [blame] | 133 | name = "debug_serial", |
| 134 | srcs = ["debug_serial.cc"], |
| 135 | deps = [ |
Austin Schuh | 29b6be0 | 2019-03-02 22:12:58 -0800 | [diff] [blame] | 136 | "//aos/logging", |
| 137 | "//aos/logging:implementations", |
Parker Schuh | 41d7273 | 2019-02-22 22:28:04 -0800 | [diff] [blame] | 138 | "//y2019/jevois:serial", |
| 139 | "//y2019/jevois:structures", |
| 140 | "//y2019/jevois:uart", |
Parker Schuh | 41d7273 | 2019-02-22 22:28:04 -0800 | [diff] [blame] | 141 | ], |
| 142 | ) |
| 143 | |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 144 | cc_binary( |
Parker Schuh | 9e1d169 | 2019-02-24 14:34:04 -0800 | [diff] [blame] | 145 | name = "global_calibration", |
Austin Schuh | 29b6be0 | 2019-03-02 22:12:58 -0800 | [diff] [blame] | 146 | srcs = [ |
Austin Schuh | 29b6be0 | 2019-03-02 22:12:58 -0800 | [diff] [blame] | 147 | "global_calibration.cc", |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 148 | ], |
| 149 | restricted_to = VISION_TARGETS, |
Austin Schuh | 29b6be0 | 2019-03-02 22:12:58 -0800 | [diff] [blame] | 150 | deps = [ |
| 151 | ":target_finder", |
| 152 | "//aos/logging", |
| 153 | "//aos/logging:implementations", |
| 154 | "//aos/vision/blob:codec", |
| 155 | "//aos/vision/blob:find_blob", |
| 156 | "//aos/vision/events:epoll_events", |
| 157 | "//aos/vision/events:socket_types", |
| 158 | "//aos/vision/events:udp", |
| 159 | "//aos/vision/image:image_dataset", |
| 160 | "//aos/vision/image:image_stream", |
| 161 | "//aos/vision/image:reader", |
| 162 | "@com_google_ceres_solver//:ceres", |
| 163 | ], |
Parker Schuh | 2a1447c | 2019-02-17 00:25:29 -0800 | [diff] [blame] | 164 | ) |