Sabina Davis | 1b84afa | 2019-02-09 01:20:21 -0800 | [diff] [blame] | 1 | load("//frc971:downloader.bzl", "robot_downloader") |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 2 | load("//aos:config.bzl", "aos_config") |
Michael Schuh | 5a1a758 | 2019-03-01 13:03:47 -0800 | [diff] [blame] | 3 | load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library") |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 4 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
Sabina Davis | 1b84afa | 2019-02-09 01:20:21 -0800 | [diff] [blame] | 5 | |
| 6 | robot_downloader( |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 7 | data = [ |
Austin Schuh | 14d7d3d | 2020-09-10 18:14:36 -0700 | [diff] [blame] | 8 | ":config", |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 9 | ], |
Austin Schuh | 635e8bf | 2019-03-23 18:53:15 -0700 | [diff] [blame] | 10 | dirs = [ |
| 11 | "//y2019/vision/server:www_files", |
| 12 | ], |
Sabina Davis | 1b84afa | 2019-02-09 01:20:21 -0800 | [diff] [blame] | 13 | start_binaries = [ |
| 14 | ":joystick_reader", |
| 15 | ":wpilib_interface", |
| 16 | "//y2019/control_loops/drivetrain:drivetrain", |
Austin Schuh | 355f327 | 2019-02-15 23:09:29 -0800 | [diff] [blame] | 17 | "//y2019/control_loops/superstructure:superstructure", |
Austin Schuh | 986091a | 2019-03-22 20:35:12 -0700 | [diff] [blame] | 18 | "//y2019/actors:binaries", |
Austin Schuh | 635e8bf | 2019-03-23 18:53:15 -0700 | [diff] [blame] | 19 | "//y2019/vision/server", |
Sabina Davis | 1b84afa | 2019-02-09 01:20:21 -0800 | [diff] [blame] | 20 | ], |
| 21 | ) |
| 22 | |
Tyler Chatow | 37ecdcd | 2019-01-26 20:18:42 -0800 | [diff] [blame] | 23 | cc_library( |
| 24 | name = "constants", |
| 25 | srcs = [ |
| 26 | "constants.cc", |
| 27 | ], |
| 28 | hdrs = [ |
| 29 | "constants.h", |
| 30 | ], |
| 31 | visibility = ["//visibility:public"], |
| 32 | deps = [ |
Tyler Chatow | 37ecdcd | 2019-01-26 20:18:42 -0800 | [diff] [blame] | 33 | "//aos/logging", |
| 34 | "//aos/mutex", |
| 35 | "//aos/network:team_number", |
| 36 | "//frc971:constants", |
James Kuszmaul | 22c5ab3 | 2019-02-09 14:45:58 -0800 | [diff] [blame] | 37 | "//frc971/control_loops:pose", |
Theo Bafrali | 00e4227 | 2019-02-12 01:07:46 -0800 | [diff] [blame] | 38 | "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem", |
James Kuszmaul | f4ede20 | 2020-02-14 08:47:40 -0800 | [diff] [blame] | 39 | "//frc971/control_loops/drivetrain:camera", |
Sabina Davis | 7be49f3 | 2019-02-02 00:30:19 -0800 | [diff] [blame] | 40 | "//y2019/control_loops/drivetrain:polydrivetrain_plants", |
Alex Perry | 5fb5ff2 | 2019-02-09 21:53:17 -0800 | [diff] [blame] | 41 | "//y2019/control_loops/superstructure/elevator:elevator_plants", |
| 42 | "//y2019/control_loops/superstructure/intake:intake_plants", |
| 43 | "//y2019/control_loops/superstructure/stilts:stilts_plants", |
Austin Schuh | c1d6f83 | 2019-02-15 23:22:17 -0800 | [diff] [blame] | 44 | "//y2019/control_loops/superstructure/wrist:wrist_plants", |
James Kuszmaul | e2c71ea | 2019-03-04 08:14:21 -0800 | [diff] [blame] | 45 | "//y2019/vision:constants", |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 46 | "@com_google_absl//absl/base", |
Tyler Chatow | 37ecdcd | 2019-01-26 20:18:42 -0800 | [diff] [blame] | 47 | ], |
| 48 | ) |
| 49 | |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 50 | cc_binary( |
| 51 | name = "wpilib_interface", |
| 52 | srcs = [ |
| 53 | "wpilib_interface.cc", |
| 54 | ], |
Brian Silverman | 7be68ba | 2020-01-08 22:08:40 -0800 | [diff] [blame] | 55 | # This library uses some deprecated parts of the SPI API. |
| 56 | copts = ["-Wno-deprecated-declarations"], |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 57 | restricted_to = ["//tools:roborio"], |
| 58 | deps = [ |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 59 | ":camera_log_fbs", |
Sabina Davis | 7be49f3 | 2019-02-02 00:30:19 -0800 | [diff] [blame] | 60 | ":constants", |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 61 | ":status_light_fbs", |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 62 | "//aos:init", |
| 63 | "//aos:make_unique", |
| 64 | "//aos:math", |
| 65 | "//aos/controls:control_loop", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 66 | "//aos/events:shm_event_loop", |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 67 | "//aos/logging", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 68 | "//aos/robot_state:robot_state_fbs", |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 69 | "//aos/stl_mutex", |
| 70 | "//aos/time", |
| 71 | "//aos/util:log_interval", |
| 72 | "//aos/util:phased_loop", |
| 73 | "//aos/util:wrapping_counter", |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 74 | "//frc971/autonomous:auto_mode_fbs", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 75 | "//frc971/control_loops:control_loops_fbs", |
| 76 | "//frc971/control_loops/drivetrain:drivetrain_position_fbs", |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 77 | "//frc971/wpilib:ADIS16448", |
Austin Schuh | c1d6f83 | 2019-02-15 23:22:17 -0800 | [diff] [blame] | 78 | "//frc971/wpilib:buffered_pcm", |
Sabina Davis | d004fd6 | 2019-02-02 23:51:46 -0800 | [diff] [blame] | 79 | "//frc971/wpilib:drivetrain_writer", |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 80 | "//frc971/wpilib:encoder_and_potentiometer", |
| 81 | "//frc971/wpilib:interrupt_edge_counting", |
| 82 | "//frc971/wpilib:joystick_sender", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 83 | "//frc971/wpilib:logging_fbs", |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 84 | "//frc971/wpilib:loop_output_handler", |
| 85 | "//frc971/wpilib:pdp_fetcher", |
Sabina Davis | adc5854 | 2019-02-01 22:23:00 -0800 | [diff] [blame] | 86 | "//frc971/wpilib:sensor_reader", |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 87 | "//frc971/wpilib:wpilib_interface", |
| 88 | "//frc971/wpilib:wpilib_robot_base", |
Austin Schuh | f6b9463 | 2019-02-02 22:11:27 -0800 | [diff] [blame] | 89 | "//third_party:phoenix", |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 90 | "//third_party:wpilib", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 91 | "//y2019/control_loops/drivetrain:camera_fbs", |
| 92 | "//y2019/control_loops/superstructure:superstructure_output_fbs", |
| 93 | "//y2019/control_loops/superstructure:superstructure_position_fbs", |
Brian Silverman | f8b7525 | 2019-02-24 16:13:58 -0800 | [diff] [blame] | 94 | "//y2019/jevois:spi", |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 95 | ], |
| 96 | ) |
Sabina Davis | 1b84afa | 2019-02-09 01:20:21 -0800 | [diff] [blame] | 97 | |
Tyler Chatow | d28951f | 2019-02-16 20:12:28 -0800 | [diff] [blame] | 98 | cc_library( |
| 99 | name = "joystick_angle", |
| 100 | srcs = [ |
| 101 | "joystick_angle.cc", |
| 102 | ], |
| 103 | hdrs = [ |
| 104 | "joystick_angle.h", |
| 105 | ], |
| 106 | deps = [ |
| 107 | "//aos/input:drivetrain_input", |
Tyler Chatow | c8012ca | 2019-02-18 22:33:01 -0800 | [diff] [blame] | 108 | "//frc971/zeroing:wrap", |
Tyler Chatow | d28951f | 2019-02-16 20:12:28 -0800 | [diff] [blame] | 109 | ], |
| 110 | ) |
| 111 | |
| 112 | cc_test( |
| 113 | name = "joystick_angle_test", |
| 114 | srcs = [ |
| 115 | "joystick_angle_test.cc", |
| 116 | ], |
| 117 | deps = [ |
| 118 | ":joystick_angle", |
| 119 | "//aos/testing:googletest", |
| 120 | ], |
| 121 | ) |
| 122 | |
Sabina Davis | 1b84afa | 2019-02-09 01:20:21 -0800 | [diff] [blame] | 123 | cc_binary( |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 124 | name = "joystick_reader", |
| 125 | srcs = [ |
| 126 | ":joystick_reader.cc", |
| 127 | ], |
| 128 | deps = [ |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 129 | ":camera_log_fbs", |
Tyler Chatow | e024145 | 2019-03-08 21:07:50 -0800 | [diff] [blame] | 130 | ":vision_proto", |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 131 | "//aos:init", |
| 132 | "//aos/actions:action_lib", |
Sabina Davis | 1b84afa | 2019-02-09 01:20:21 -0800 | [diff] [blame] | 133 | "//aos/input:action_joystick_input", |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 134 | "//aos/input:drivetrain_input", |
| 135 | "//aos/input:joystick_input", |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 136 | "//aos/logging", |
| 137 | "//aos/network:team_number", |
| 138 | "//aos/stl_mutex", |
| 139 | "//aos/time", |
| 140 | "//aos/util:log_interval", |
| 141 | "//aos/vision/events:udp", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 142 | "//frc971/autonomous:auto_fbs", |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 143 | "//frc971/autonomous:base_autonomous_actor", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 144 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 145 | "//frc971/control_loops/drivetrain:localizer_fbs", |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 146 | "//y2019/control_loops/drivetrain:drivetrain_base", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 147 | "//y2019/control_loops/drivetrain:target_selector_fbs", |
| 148 | "//y2019/control_loops/superstructure:superstructure_goal_fbs", |
| 149 | "//y2019/control_loops/superstructure:superstructure_position_fbs", |
| 150 | "//y2019/control_loops/superstructure:superstructure_status_fbs", |
Tyler Chatow | e024145 | 2019-03-08 21:07:50 -0800 | [diff] [blame] | 151 | "@com_google_protobuf//:protobuf", |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 152 | ], |
| 153 | ) |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 154 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 155 | flatbuffer_cc_library( |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 156 | name = "camera_log_fbs", |
| 157 | srcs = [ |
| 158 | "camera_log.fbs", |
| 159 | ], |
| 160 | gen_reflections = 1, |
| 161 | visibility = ["//visibility:public"], |
| 162 | ) |
| 163 | |
| 164 | flatbuffer_cc_library( |
| 165 | name = "status_light_fbs", |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 166 | srcs = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 167 | "status_light.fbs", |
| 168 | ], |
| 169 | gen_reflections = 1, |
| 170 | visibility = ["//visibility:public"], |
| 171 | ) |
| 172 | |
| 173 | aos_config( |
| 174 | name = "config", |
| 175 | src = "y2019.json", |
| 176 | flatbuffers = [ |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 177 | ":status_light_fbs", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 178 | "//y2019/control_loops/drivetrain:camera_fbs", |
| 179 | "//y2019/control_loops/drivetrain:target_selector_fbs", |
| 180 | "//y2019/control_loops/superstructure:superstructure_goal_fbs", |
| 181 | "//y2019/control_loops/superstructure:superstructure_output_fbs", |
| 182 | "//y2019/control_loops/superstructure:superstructure_position_fbs", |
| 183 | "//y2019/control_loops/superstructure:superstructure_status_fbs", |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 184 | ":camera_log_fbs", |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 185 | ], |
| 186 | visibility = ["//visibility:public"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 187 | deps = [ |
| 188 | "//aos/robot_state:config", |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 189 | "//frc971/autonomous:config", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 190 | "//frc971/control_loops/drivetrain:config", |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 191 | "//frc971/wpilib:config", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 192 | ], |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 193 | ) |
| 194 | |
Michael Schuh | 5a1a758 | 2019-03-01 13:03:47 -0800 | [diff] [blame] | 195 | cc_proto_library( |
| 196 | name = "vision_proto", |
| 197 | srcs = ["vision.proto"], |
| 198 | visibility = ["//visibility:public"], |
| 199 | ) |
| 200 | |
Michael Schuh | ab42b0a | 2019-01-07 16:33:43 -0800 | [diff] [blame] | 201 | py_library( |
| 202 | name = "python_init", |
| 203 | srcs = ["__init__.py"], |
| 204 | visibility = ["//visibility:public"], |
Sabina Davis | abeae33 | 2019-02-01 21:12:57 -0800 | [diff] [blame] | 205 | ) |