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") |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 3 | load("//tools/build_rules:template.bzl", "jinja2_template") |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 4 | |
| 5 | robot_downloader( |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 6 | binaries = [ |
| 7 | "//aos/network:web_proxy_main", |
| 8 | ], |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 9 | data = [ |
| 10 | ":config", |
| 11 | ], |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame^] | 12 | dirs = [ |
| 13 | "//y2022/www:www_files", |
| 14 | ], |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 15 | start_binaries = [ |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 16 | "//aos/events/logging:logger_main", |
| 17 | "//aos/network:web_proxy_main", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 18 | ":joystick_reader", |
| 19 | ":wpilib_interface", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 20 | "//aos/network:message_bridge_client", |
| 21 | "//aos/network:message_bridge_server", |
| 22 | "//y2022/actors:binaries", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 23 | "//y2022/control_loops/drivetrain:drivetrain", |
Milind Upadhyay | b8abf02 | 2022-02-22 21:07:44 -0800 | [diff] [blame] | 24 | "//y2022/control_loops/drivetrain:trajectory_generator", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 25 | "//y2022/control_loops/superstructure:superstructure", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 26 | ], |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 27 | target_compatible_with = ["@platforms//os:linux"], |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 28 | ) |
| 29 | |
milind-u | 6b6e100 | 2022-01-22 13:26:42 -0800 | [diff] [blame] | 30 | robot_downloader( |
| 31 | name = "pi_download", |
| 32 | binaries = [ |
Jim Ostrowski | b9135a9 | 2022-02-06 22:49:11 -0800 | [diff] [blame] | 33 | "//y2020/vision:calibration", |
milind-u | 6b6e100 | 2022-01-22 13:26:42 -0800 | [diff] [blame] | 34 | "//y2022/vision:viewer", |
Ravago Jones | e12b790 | 2022-02-04 22:50:44 -0800 | [diff] [blame] | 35 | "//y2022/localizer:imu_main", |
James Kuszmaul | 93825a0 | 2022-02-13 16:50:33 -0800 | [diff] [blame] | 36 | "//y2022/control_loops/localizer:localizer_main", |
milind-u | 6b6e100 | 2022-01-22 13:26:42 -0800 | [diff] [blame] | 37 | ], |
| 38 | data = [ |
| 39 | ":config", |
| 40 | ], |
milind-u | 6b6e100 | 2022-01-22 13:26:42 -0800 | [diff] [blame] | 41 | start_binaries = [ |
| 42 | "//aos/events/logging:logger_main", |
| 43 | "//aos/network:message_bridge_client", |
| 44 | "//aos/network:message_bridge_server", |
| 45 | "//aos/network:web_proxy_main", |
| 46 | "//y2022/vision:camera_reader", |
| 47 | ], |
| 48 | target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"], |
| 49 | target_type = "pi", |
| 50 | ) |
| 51 | |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 52 | aos_config( |
| 53 | name = "config", |
| 54 | src = "y2022.json", |
| 55 | flatbuffers = [ |
| 56 | "//aos/network:message_bridge_client_fbs", |
| 57 | "//aos/network:message_bridge_server_fbs", |
| 58 | "//aos/network:timestamp_fbs", |
| 59 | "//frc971/input:robot_state_fbs", |
| 60 | "//frc971/vision:vision_fbs", |
Jim Ostrowski | 007e2ea | 2022-01-30 13:13:26 -0800 | [diff] [blame] | 61 | "//y2022/vision:calibration_fbs", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 62 | ], |
| 63 | target_compatible_with = ["@platforms//os:linux"], |
| 64 | visibility = ["//visibility:public"], |
| 65 | deps = [ |
James Kuszmaul | ef35d73 | 2022-02-12 16:37:32 -0800 | [diff] [blame] | 66 | ":config_imu", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 67 | ":config_logger", |
| 68 | ":config_pi1", |
| 69 | ":config_pi2", |
| 70 | ":config_pi3", |
| 71 | ":config_pi4", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 72 | ":config_roborio", |
| 73 | ], |
| 74 | ) |
| 75 | |
| 76 | [ |
| 77 | aos_config( |
| 78 | name = "config_" + pi, |
| 79 | src = "y2022_" + pi + ".json", |
| 80 | flatbuffers = [ |
| 81 | "//aos/network:message_bridge_client_fbs", |
| 82 | "//aos/network:message_bridge_server_fbs", |
| 83 | "//aos/network:timestamp_fbs", |
| 84 | "//aos/network:remote_message_fbs", |
| 85 | "//frc971/vision:vision_fbs", |
Jim Ostrowski | 007e2ea | 2022-01-30 13:13:26 -0800 | [diff] [blame] | 86 | "//y2022/vision:calibration_fbs", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 87 | "//y2022/vision:target_estimate_fbs", |
| 88 | ], |
| 89 | target_compatible_with = ["@platforms//os:linux"], |
| 90 | visibility = ["//visibility:public"], |
| 91 | deps = [ |
| 92 | "//aos/events:config", |
| 93 | "//frc971/control_loops/drivetrain:config", |
| 94 | "//frc971/input:config", |
| 95 | ], |
| 96 | ) |
| 97 | for pi in [ |
| 98 | "pi1", |
| 99 | "pi2", |
| 100 | "pi3", |
| 101 | "pi4", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 102 | ] |
| 103 | ] |
| 104 | |
| 105 | aos_config( |
James Kuszmaul | ef35d73 | 2022-02-12 16:37:32 -0800 | [diff] [blame] | 106 | name = "config_imu", |
| 107 | src = "y2022_imu.json", |
| 108 | flatbuffers = [ |
| 109 | "//aos/network:message_bridge_client_fbs", |
| 110 | "//aos/network:message_bridge_server_fbs", |
| 111 | "//aos/network:timestamp_fbs", |
| 112 | "//aos/network:remote_message_fbs", |
| 113 | "//y2022/control_loops/localizer:localizer_status_fbs", |
| 114 | "//y2022/control_loops/localizer:localizer_output_fbs", |
| 115 | ], |
| 116 | target_compatible_with = ["@platforms//os:linux"], |
| 117 | visibility = ["//visibility:public"], |
| 118 | deps = [ |
| 119 | "//aos/events:config", |
| 120 | "//frc971/control_loops/drivetrain:config", |
| 121 | ], |
| 122 | ) |
| 123 | |
| 124 | aos_config( |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 125 | name = "config_logger", |
| 126 | src = "y2022_logger.json", |
| 127 | flatbuffers = [ |
| 128 | "//aos/network:message_bridge_client_fbs", |
| 129 | "//aos/network:message_bridge_server_fbs", |
| 130 | "//aos/network:timestamp_fbs", |
| 131 | "//aos/network:remote_message_fbs", |
| 132 | "//frc971/vision:vision_fbs", |
Jim Ostrowski | 007e2ea | 2022-01-30 13:13:26 -0800 | [diff] [blame] | 133 | "//y2022/vision:calibration_fbs", |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 134 | ], |
| 135 | target_compatible_with = ["@platforms//os:linux"], |
| 136 | visibility = ["//visibility:public"], |
| 137 | deps = [ |
| 138 | "//aos/events:config", |
| 139 | "//frc971/control_loops/drivetrain:config", |
| 140 | "//frc971/input:config", |
| 141 | ], |
| 142 | ) |
| 143 | |
| 144 | aos_config( |
| 145 | name = "config_roborio", |
| 146 | src = "y2022_roborio.json", |
| 147 | flatbuffers = [ |
| 148 | "//aos/network:remote_message_fbs", |
| 149 | "//aos/network:message_bridge_client_fbs", |
| 150 | "//aos/network:message_bridge_server_fbs", |
| 151 | "//aos/network:timestamp_fbs", |
| 152 | "//y2019/control_loops/drivetrain:target_selector_fbs", |
| 153 | "//y2022/control_loops/superstructure:superstructure_goal_fbs", |
| 154 | "//y2022/control_loops/superstructure:superstructure_output_fbs", |
| 155 | "//y2022/control_loops/superstructure:superstructure_position_fbs", |
| 156 | "//y2022/control_loops/superstructure:superstructure_status_fbs", |
| 157 | ], |
| 158 | target_compatible_with = ["@platforms//os:linux"], |
| 159 | deps = [ |
| 160 | "//aos/events:config", |
| 161 | "//frc971/autonomous:config", |
| 162 | "//frc971/control_loops/drivetrain:config", |
| 163 | "//frc971/input:config", |
| 164 | "//frc971/wpilib:config", |
| 165 | ], |
| 166 | ) |
| 167 | |
| 168 | [ |
| 169 | jinja2_template( |
| 170 | name = "y2022_pi" + str(num) + ".json", |
| 171 | src = "y2022_pi_template.json", |
| 172 | parameters = {"NUM": str(num)}, |
| 173 | target_compatible_with = ["@platforms//os:linux"], |
| 174 | ) |
| 175 | for num in range(1, 6) |
| 176 | ] |
| 177 | |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 178 | cc_library( |
| 179 | name = "constants", |
| 180 | srcs = [ |
| 181 | "constants.cc", |
| 182 | ], |
| 183 | hdrs = [ |
| 184 | "constants.h", |
| 185 | ], |
| 186 | visibility = ["//visibility:public"], |
| 187 | deps = [ |
| 188 | "//aos/mutex", |
| 189 | "//aos/network:team_number", |
| 190 | "//frc971:constants", |
| 191 | "//frc971/control_loops:pose", |
| 192 | "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem", |
| 193 | "//y2022/control_loops/drivetrain:polydrivetrain_plants", |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 194 | "//y2022/control_loops/superstructure/climber:climber_plants", |
Yash Chainani | 997a749 | 2022-01-29 15:48:56 -0800 | [diff] [blame] | 195 | "//y2022/control_loops/superstructure/intake:intake_plants", |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 196 | "//y2022/control_loops/superstructure/turret:turret_plants", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 197 | "@com_github_google_glog//:glog", |
| 198 | "@com_google_absl//absl/base", |
| 199 | ], |
| 200 | ) |
| 201 | |
| 202 | cc_binary( |
| 203 | name = "wpilib_interface", |
| 204 | srcs = [ |
| 205 | "wpilib_interface.cc", |
| 206 | ], |
| 207 | target_compatible_with = ["//tools/platforms/hardware:roborio"], |
| 208 | deps = [ |
| 209 | ":constants", |
| 210 | "//aos:init", |
| 211 | "//aos:math", |
| 212 | "//aos/events:shm_event_loop", |
| 213 | "//aos/logging", |
| 214 | "//aos/stl_mutex", |
| 215 | "//aos/time", |
| 216 | "//aos/util:log_interval", |
| 217 | "//aos/util:phased_loop", |
| 218 | "//aos/util:wrapping_counter", |
| 219 | "//frc971/autonomous:auto_mode_fbs", |
| 220 | "//frc971/control_loops:control_loop", |
| 221 | "//frc971/control_loops:control_loops_fbs", |
| 222 | "//frc971/control_loops/drivetrain:drivetrain_position_fbs", |
| 223 | "//frc971/input:robot_state_fbs", |
| 224 | "//frc971/wpilib:ADIS16448", |
| 225 | "//frc971/wpilib:buffered_pcm", |
| 226 | "//frc971/wpilib:drivetrain_writer", |
| 227 | "//frc971/wpilib:encoder_and_potentiometer", |
| 228 | "//frc971/wpilib:interrupt_edge_counting", |
| 229 | "//frc971/wpilib:joystick_sender", |
| 230 | "//frc971/wpilib:logging_fbs", |
| 231 | "//frc971/wpilib:loop_output_handler", |
| 232 | "//frc971/wpilib:pdp_fetcher", |
| 233 | "//frc971/wpilib:sensor_reader", |
| 234 | "//frc971/wpilib:wpilib_interface", |
| 235 | "//frc971/wpilib:wpilib_robot_base", |
| 236 | "//third_party:phoenix", |
| 237 | "//third_party:wpilib", |
| 238 | "//y2022/control_loops/superstructure:superstructure_output_fbs", |
| 239 | "//y2022/control_loops/superstructure:superstructure_position_fbs", |
| 240 | ], |
| 241 | ) |
| 242 | |
| 243 | cc_binary( |
| 244 | name = "joystick_reader", |
| 245 | srcs = [ |
| 246 | ":joystick_reader.cc", |
| 247 | ], |
| 248 | deps = [ |
| 249 | "//aos:init", |
| 250 | "//aos/actions:action_lib", |
| 251 | "//aos/logging", |
| 252 | "//frc971/autonomous:auto_fbs", |
| 253 | "//frc971/autonomous:base_autonomous_actor", |
| 254 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 255 | "//frc971/input:action_joystick_input", |
| 256 | "//frc971/input:drivetrain_input", |
| 257 | "//frc971/input:joystick_input", |
| 258 | "//y2022/control_loops/drivetrain:drivetrain_base", |
| 259 | "//y2022/control_loops/superstructure:superstructure_goal_fbs", |
| 260 | "//y2022/control_loops/superstructure:superstructure_status_fbs", |
| 261 | ], |
| 262 | ) |
Milo Lin | 5d49af0 | 2022-02-05 12:50:32 -0800 | [diff] [blame] | 263 | |
| 264 | py_library( |
| 265 | name = "python_init", |
| 266 | srcs = ["__init__.py"], |
| 267 | target_compatible_with = ["@platforms//os:linux"], |
| 268 | visibility = ["//visibility:public"], |
| 269 | ) |