milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 1 | load("//frc971:downloader.bzl", "robot_downloader") |
| 2 | load("//aos:config.bzl", "aos_config") |
Henry Speiser | 0b9b005 | 2022-03-02 23:07:40 -0800 | [diff] [blame] | 3 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 4 | load("//tools/build_rules:template.bzl", "jinja2_template") |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 5 | |
| 6 | robot_downloader( |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 7 | binaries = [ |
Henry Speiser | 0b9b005 | 2022-03-02 23:07:40 -0800 | [diff] [blame] | 8 | ":setpoint_setter", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 9 | "//aos/network:web_proxy_main", |
Austin Schuh | 3d3707a | 2022-04-02 22:39:50 -0700 | [diff] [blame^] | 10 | "//aos/events/logging:log_cat", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 11 | ], |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 12 | data = [ |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 13 | ":aos_config", |
Austin Schuh | 6b2edc6 | 2022-03-27 13:32:09 -0700 | [diff] [blame] | 14 | ":message_bridge_client.sh", |
Austin Schuh | de605f1 | 2022-02-23 23:08:19 -0800 | [diff] [blame] | 15 | "@ctre_phoenix_api_cpp_athena//:shared_libraries", |
| 16 | "@ctre_phoenix_cci_athena//:shared_libraries", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 17 | ], |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 18 | dirs = [ |
Ravago Jones | 81e5063 | 2022-03-11 16:23:51 -0800 | [diff] [blame] | 19 | "//y2022/actors:splines", |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 20 | "//y2022/www:www_files", |
| 21 | ], |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 22 | start_binaries = [ |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 23 | "//aos/events/logging:logger_main", |
| 24 | "//aos/network:web_proxy_main", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 25 | ":joystick_reader", |
| 26 | ":wpilib_interface", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 27 | "//aos/network:message_bridge_client", |
| 28 | "//aos/network:message_bridge_server", |
| 29 | "//y2022/actors:binaries", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 30 | "//y2022/control_loops/drivetrain:drivetrain", |
Milind Upadhyay | b8abf02 | 2022-02-22 21:07:44 -0800 | [diff] [blame] | 31 | "//y2022/control_loops/drivetrain:trajectory_generator", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 32 | "//y2022/control_loops/superstructure:superstructure", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 33 | ], |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 34 | target_compatible_with = ["@platforms//os:linux"], |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 35 | ) |
| 36 | |
milind-u | 6b6e100 | 2022-01-22 13:26:42 -0800 | [diff] [blame] | 37 | robot_downloader( |
| 38 | name = "pi_download", |
| 39 | binaries = [ |
Jim Ostrowski | b9135a9 | 2022-02-06 22:49:11 -0800 | [diff] [blame] | 40 | "//y2020/vision:calibration", |
milind-u | 6b6e100 | 2022-01-22 13:26:42 -0800 | [diff] [blame] | 41 | "//y2022/vision:viewer", |
Ravago Jones | e12b790 | 2022-02-04 22:50:44 -0800 | [diff] [blame] | 42 | "//y2022/localizer:imu_main", |
James Kuszmaul | 51fa1ae | 2022-02-26 00:49:57 -0800 | [diff] [blame] | 43 | "//y2022/localizer:localizer_main", |
James Kuszmaul | 3eb753d | 2022-03-12 15:21:12 -0800 | [diff] [blame] | 44 | "//y2022/vision:image_decimator", |
Tyler Chatow | b3850c1 | 2020-02-26 20:55:48 -0800 | [diff] [blame] | 45 | "//y2022/image_streamer:image_streamer", |
Austin Schuh | 63f6516 | 2022-04-01 22:31:19 -0700 | [diff] [blame] | 46 | "//aos/events/logging:log_cat", |
milind-u | 6b6e100 | 2022-01-22 13:26:42 -0800 | [diff] [blame] | 47 | ], |
| 48 | data = [ |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 49 | ":aos_config", |
Tyler Chatow | b3850c1 | 2020-02-26 20:55:48 -0800 | [diff] [blame] | 50 | "//y2022/image_streamer:image_streamer_start", |
milind-u | 6b6e100 | 2022-01-22 13:26:42 -0800 | [diff] [blame] | 51 | ], |
James Kuszmaul | b35e234 | 2022-03-06 15:44:00 -0800 | [diff] [blame] | 52 | dirs = [ |
| 53 | "//y2022/www:www_files", |
Tyler Chatow | b3850c1 | 2020-02-26 20:55:48 -0800 | [diff] [blame] | 54 | "//y2022/image_streamer/www:www_files", |
James Kuszmaul | b35e234 | 2022-03-06 15:44:00 -0800 | [diff] [blame] | 55 | ], |
milind-u | 6b6e100 | 2022-01-22 13:26:42 -0800 | [diff] [blame] | 56 | start_binaries = [ |
| 57 | "//aos/events/logging:logger_main", |
| 58 | "//aos/network:message_bridge_client", |
| 59 | "//aos/network:message_bridge_server", |
| 60 | "//aos/network:web_proxy_main", |
| 61 | "//y2022/vision:camera_reader", |
| 62 | ], |
| 63 | target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"], |
| 64 | target_type = "pi", |
| 65 | ) |
| 66 | |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 67 | aos_config( |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 68 | name = "aos_config", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 69 | src = "y2022.json", |
| 70 | flatbuffers = [ |
| 71 | "//aos/network:message_bridge_client_fbs", |
| 72 | "//aos/network:message_bridge_server_fbs", |
| 73 | "//aos/network:timestamp_fbs", |
| 74 | "//frc971/input:robot_state_fbs", |
| 75 | "//frc971/vision:vision_fbs", |
Jim Ostrowski | 007e2ea | 2022-01-30 13:13:26 -0800 | [diff] [blame] | 76 | "//y2022/vision:calibration_fbs", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 77 | ], |
| 78 | target_compatible_with = ["@platforms//os:linux"], |
| 79 | visibility = ["//visibility:public"], |
| 80 | deps = [ |
James Kuszmaul | ef35d73 | 2022-02-12 16:37:32 -0800 | [diff] [blame] | 81 | ":config_imu", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 82 | ":config_logger", |
| 83 | ":config_pi1", |
| 84 | ":config_pi2", |
| 85 | ":config_pi3", |
| 86 | ":config_pi4", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 87 | ":config_roborio", |
| 88 | ], |
| 89 | ) |
| 90 | |
| 91 | [ |
| 92 | aos_config( |
| 93 | name = "config_" + pi, |
| 94 | src = "y2022_" + pi + ".json", |
| 95 | flatbuffers = [ |
| 96 | "//aos/network:message_bridge_client_fbs", |
| 97 | "//aos/network:message_bridge_server_fbs", |
| 98 | "//aos/network:timestamp_fbs", |
| 99 | "//aos/network:remote_message_fbs", |
| 100 | "//frc971/vision:vision_fbs", |
Milind Upadhyay | d67e9cf | 2022-03-13 13:56:57 -0700 | [diff] [blame] | 101 | "//y2022/localizer:localizer_output_fbs", |
Jim Ostrowski | 007e2ea | 2022-01-30 13:13:26 -0800 | [diff] [blame] | 102 | "//y2022/vision:calibration_fbs", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 103 | "//y2022/vision:target_estimate_fbs", |
| 104 | ], |
| 105 | target_compatible_with = ["@platforms//os:linux"], |
| 106 | visibility = ["//visibility:public"], |
| 107 | deps = [ |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 108 | "//aos/events:aos_config", |
| 109 | "//frc971/control_loops/drivetrain:aos_config", |
| 110 | "//frc971/input:aos_config", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 111 | ], |
| 112 | ) |
| 113 | for pi in [ |
| 114 | "pi1", |
| 115 | "pi2", |
| 116 | "pi3", |
| 117 | "pi4", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 118 | ] |
| 119 | ] |
| 120 | |
| 121 | aos_config( |
James Kuszmaul | ef35d73 | 2022-02-12 16:37:32 -0800 | [diff] [blame] | 122 | name = "config_imu", |
| 123 | src = "y2022_imu.json", |
| 124 | flatbuffers = [ |
| 125 | "//aos/network:message_bridge_client_fbs", |
| 126 | "//aos/network:message_bridge_server_fbs", |
| 127 | "//aos/network:timestamp_fbs", |
| 128 | "//aos/network:remote_message_fbs", |
James Kuszmaul | 51fa1ae | 2022-02-26 00:49:57 -0800 | [diff] [blame] | 129 | "//y2022/localizer:localizer_status_fbs", |
| 130 | "//y2022/localizer:localizer_output_fbs", |
James Kuszmaul | 0dedb5e | 2022-03-05 16:02:20 -0800 | [diff] [blame] | 131 | "//y2022/localizer:localizer_visualization_fbs", |
James Kuszmaul | ef35d73 | 2022-02-12 16:37:32 -0800 | [diff] [blame] | 132 | ], |
| 133 | target_compatible_with = ["@platforms//os:linux"], |
| 134 | visibility = ["//visibility:public"], |
| 135 | deps = [ |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 136 | "//aos/events:aos_config", |
| 137 | "//frc971/control_loops/drivetrain:aos_config", |
James Kuszmaul | ef35d73 | 2022-02-12 16:37:32 -0800 | [diff] [blame] | 138 | ], |
| 139 | ) |
| 140 | |
| 141 | aos_config( |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 142 | name = "config_logger", |
| 143 | src = "y2022_logger.json", |
| 144 | flatbuffers = [ |
| 145 | "//aos/network:message_bridge_client_fbs", |
| 146 | "//aos/network:message_bridge_server_fbs", |
| 147 | "//aos/network:timestamp_fbs", |
| 148 | "//aos/network:remote_message_fbs", |
| 149 | "//frc971/vision:vision_fbs", |
Jim Ostrowski | 007e2ea | 2022-01-30 13:13:26 -0800 | [diff] [blame] | 150 | "//y2022/vision:calibration_fbs", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 151 | ], |
| 152 | target_compatible_with = ["@platforms//os:linux"], |
| 153 | visibility = ["//visibility:public"], |
| 154 | deps = [ |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 155 | "//aos/events:aos_config", |
| 156 | "//frc971/control_loops/drivetrain:aos_config", |
| 157 | "//frc971/input:aos_config", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 158 | ], |
| 159 | ) |
| 160 | |
| 161 | aos_config( |
| 162 | name = "config_roborio", |
| 163 | src = "y2022_roborio.json", |
| 164 | flatbuffers = [ |
Henry Speiser | 0b9b005 | 2022-03-02 23:07:40 -0800 | [diff] [blame] | 165 | ":setpoint_fbs", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 166 | "//aos/network:remote_message_fbs", |
| 167 | "//aos/network:message_bridge_client_fbs", |
| 168 | "//aos/network:message_bridge_server_fbs", |
| 169 | "//aos/network:timestamp_fbs", |
| 170 | "//y2019/control_loops/drivetrain:target_selector_fbs", |
| 171 | "//y2022/control_loops/superstructure:superstructure_goal_fbs", |
| 172 | "//y2022/control_loops/superstructure:superstructure_output_fbs", |
| 173 | "//y2022/control_loops/superstructure:superstructure_position_fbs", |
Milind Upadhyay | 482b0ba | 2022-02-26 21:51:59 -0800 | [diff] [blame] | 174 | "//y2022/control_loops/superstructure:superstructure_can_position_fbs", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 175 | "//y2022/control_loops/superstructure:superstructure_status_fbs", |
| 176 | ], |
| 177 | target_compatible_with = ["@platforms//os:linux"], |
| 178 | deps = [ |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 179 | "//aos/events:aos_config", |
| 180 | "//frc971/autonomous:aos_config", |
| 181 | "//frc971/control_loops/drivetrain:aos_config", |
| 182 | "//frc971/input:aos_config", |
| 183 | "//frc971/wpilib:aos_config", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 184 | ], |
| 185 | ) |
| 186 | |
| 187 | [ |
| 188 | jinja2_template( |
| 189 | name = "y2022_pi" + str(num) + ".json", |
| 190 | src = "y2022_pi_template.json", |
| 191 | parameters = {"NUM": str(num)}, |
| 192 | target_compatible_with = ["@platforms//os:linux"], |
| 193 | ) |
| 194 | for num in range(1, 6) |
| 195 | ] |
| 196 | |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 197 | cc_library( |
| 198 | name = "constants", |
| 199 | srcs = [ |
| 200 | "constants.cc", |
| 201 | ], |
| 202 | hdrs = [ |
| 203 | "constants.h", |
| 204 | ], |
| 205 | visibility = ["//visibility:public"], |
| 206 | deps = [ |
| 207 | "//aos/mutex", |
| 208 | "//aos/network:team_number", |
| 209 | "//frc971:constants", |
| 210 | "//frc971/control_loops:pose", |
| 211 | "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem", |
Ravago Jones | 3283ce0 | 2022-03-09 19:31:29 -0800 | [diff] [blame] | 212 | "//frc971/shooter_interpolation:interpolation", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 213 | "//y2022/control_loops/drivetrain:polydrivetrain_plants", |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 214 | "//y2022/control_loops/superstructure/catapult:catapult_plants", |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 215 | "//y2022/control_loops/superstructure/climber:climber_plants", |
Yash Chainani | 997a749 | 2022-01-29 15:48:56 -0800 | [diff] [blame] | 216 | "//y2022/control_loops/superstructure/intake:intake_plants", |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 217 | "//y2022/control_loops/superstructure/turret:turret_plants", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 218 | "@com_github_google_glog//:glog", |
| 219 | "@com_google_absl//absl/base", |
| 220 | ], |
| 221 | ) |
| 222 | |
| 223 | cc_binary( |
| 224 | name = "wpilib_interface", |
| 225 | srcs = [ |
| 226 | "wpilib_interface.cc", |
| 227 | ], |
| 228 | target_compatible_with = ["//tools/platforms/hardware:roborio"], |
| 229 | deps = [ |
| 230 | ":constants", |
| 231 | "//aos:init", |
| 232 | "//aos:math", |
| 233 | "//aos/events:shm_event_loop", |
| 234 | "//aos/logging", |
| 235 | "//aos/stl_mutex", |
| 236 | "//aos/time", |
| 237 | "//aos/util:log_interval", |
| 238 | "//aos/util:phased_loop", |
| 239 | "//aos/util:wrapping_counter", |
| 240 | "//frc971/autonomous:auto_mode_fbs", |
| 241 | "//frc971/control_loops:control_loop", |
| 242 | "//frc971/control_loops:control_loops_fbs", |
| 243 | "//frc971/control_loops/drivetrain:drivetrain_position_fbs", |
| 244 | "//frc971/input:robot_state_fbs", |
Ravago Jones | 0e86e24 | 2022-02-12 18:38:14 -0800 | [diff] [blame] | 245 | "//frc971/queues:gyro_fbs", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 246 | "//frc971/wpilib:ADIS16448", |
| 247 | "//frc971/wpilib:buffered_pcm", |
| 248 | "//frc971/wpilib:drivetrain_writer", |
| 249 | "//frc971/wpilib:encoder_and_potentiometer", |
| 250 | "//frc971/wpilib:interrupt_edge_counting", |
| 251 | "//frc971/wpilib:joystick_sender", |
| 252 | "//frc971/wpilib:logging_fbs", |
| 253 | "//frc971/wpilib:loop_output_handler", |
| 254 | "//frc971/wpilib:pdp_fetcher", |
| 255 | "//frc971/wpilib:sensor_reader", |
| 256 | "//frc971/wpilib:wpilib_interface", |
| 257 | "//frc971/wpilib:wpilib_robot_base", |
| 258 | "//third_party:phoenix", |
| 259 | "//third_party:wpilib", |
Henry Speiser | 77747b7 | 2022-03-06 17:18:29 -0800 | [diff] [blame] | 260 | "//y2022/control_loops/superstructure:led_indicator_lib", |
Milind Upadhyay | 482b0ba | 2022-02-26 21:51:59 -0800 | [diff] [blame] | 261 | "//y2022/control_loops/superstructure:superstructure_can_position_fbs", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 262 | "//y2022/control_loops/superstructure:superstructure_output_fbs", |
| 263 | "//y2022/control_loops/superstructure:superstructure_position_fbs", |
| 264 | ], |
| 265 | ) |
| 266 | |
| 267 | cc_binary( |
| 268 | name = "joystick_reader", |
| 269 | srcs = [ |
| 270 | ":joystick_reader.cc", |
| 271 | ], |
| 272 | deps = [ |
Henry Speiser | 0b9b005 | 2022-03-02 23:07:40 -0800 | [diff] [blame] | 273 | ":constants", |
| 274 | ":setpoint_fbs", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 275 | "//aos:init", |
| 276 | "//aos/actions:action_lib", |
| 277 | "//aos/logging", |
| 278 | "//frc971/autonomous:auto_fbs", |
| 279 | "//frc971/autonomous:base_autonomous_actor", |
| 280 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 281 | "//frc971/input:action_joystick_input", |
| 282 | "//frc971/input:drivetrain_input", |
| 283 | "//frc971/input:joystick_input", |
| 284 | "//y2022/control_loops/drivetrain:drivetrain_base", |
| 285 | "//y2022/control_loops/superstructure:superstructure_goal_fbs", |
| 286 | "//y2022/control_loops/superstructure:superstructure_status_fbs", |
| 287 | ], |
| 288 | ) |
Milo Lin | 5d49af0 | 2022-02-05 12:50:32 -0800 | [diff] [blame] | 289 | |
Henry Speiser | 0b9b005 | 2022-03-02 23:07:40 -0800 | [diff] [blame] | 290 | flatbuffer_cc_library( |
| 291 | name = "setpoint_fbs", |
| 292 | srcs = [ |
| 293 | "setpoint.fbs", |
| 294 | ], |
| 295 | gen_reflections = 1, |
| 296 | target_compatible_with = ["@platforms//os:linux"], |
| 297 | ) |
| 298 | |
| 299 | cc_binary( |
| 300 | name = "setpoint_setter", |
| 301 | srcs = ["setpoint_setter.cc"], |
| 302 | target_compatible_with = ["@platforms//os:linux"], |
| 303 | deps = [ |
| 304 | ":constants", |
| 305 | ":setpoint_fbs", |
| 306 | "//aos:init", |
| 307 | "//aos/events:shm_event_loop", |
| 308 | ], |
| 309 | ) |
| 310 | |
Milo Lin | 5d49af0 | 2022-02-05 12:50:32 -0800 | [diff] [blame] | 311 | py_library( |
| 312 | name = "python_init", |
| 313 | srcs = ["__init__.py"], |
| 314 | target_compatible_with = ["@platforms//os:linux"], |
| 315 | visibility = ["//visibility:public"], |
| 316 | ) |
James Kuszmaul | f3ef9e1 | 2022-03-05 17:13:00 -0800 | [diff] [blame] | 317 | |
| 318 | sh_binary( |
| 319 | name = "log_web_proxy", |
| 320 | srcs = ["log_web_proxy.sh"], |
| 321 | data = [ |
| 322 | ":aos_config", |
| 323 | "//aos/network:log_web_proxy_main", |
| 324 | "//y2022/www:field_main_bundle.min.js", |
| 325 | "//y2022/www:files", |
| 326 | ], |
| 327 | target_compatible_with = ["@platforms//os:linux"], |
| 328 | ) |