blob: 9c2714220bd9e54b526f006fd6f5800bab745394 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001load("//aos:config.bzl", "aos_config")
Austin Schuh8f99c822024-05-05 22:43:40 -07002load("//frc971:downloader.bzl", "robot_downloader")
Comran Morshed9a9948c2016-01-16 15:58:04 +00003
4cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -07005 name = "constants",
6 srcs = [
7 "constants.cc",
8 ],
9 hdrs = [
10 "constants.h",
11 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080012 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070013 visibility = ["//visibility:public"],
14 deps = [
John Park33858a32018-09-28 23:05:48 -070015 "//aos/network:team_number",
Brian Silverman1463c092020-10-30 17:28:24 -070016 "//aos/stl_mutex",
Brian Silverman6470f442018-08-05 12:08:16 -070017 "//frc971:constants",
18 "//frc971:shifter_hall_effect",
19 "//frc971/control_loops:state_feedback_loop",
20 "//y2016/control_loops/drivetrain:polydrivetrain_plants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080021 "@com_google_absl//absl/base",
Austin Schuh99f7c6a2024-06-25 22:07:44 -070022 "@com_google_absl//absl/log",
23 "@com_google_absl//absl/log:check",
Brian Silverman6470f442018-08-05 12:08:16 -070024 ],
Comran Morshed9a9948c2016-01-16 15:58:04 +000025)
26
27cc_binary(
Brian Silverman6470f442018-08-05 12:08:16 -070028 name = "joystick_reader",
29 srcs = [
30 "joystick_reader.cc",
31 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080032 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070033 deps = [
34 ":constants",
John Park398c74a2018-10-20 21:17:39 -070035 "//aos:init",
Brian Silvermanf819b442019-01-20 16:51:04 -080036 "//aos/actions:action_lib",
Brian Silvermanf819b442019-01-20 16:51:04 -080037 "//aos/logging",
38 "//aos/time",
39 "//aos/util:log_interval",
Alex Perrycb7da4b2019-08-28 19:35:56 -070040 "//frc971/autonomous:auto_fbs",
41 "//frc971/control_loops/drivetrain:drivetrain_goal_fbs",
42 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaul75a18c52021-03-10 22:02:07 -080043 "//frc971/control_loops/drivetrain:spline_goal_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070044 "//frc971/input:action_joystick_input",
Tyler Chatow24b5db12020-01-06 21:16:56 -080045 "//frc971/queues:gyro_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070046 "//y2016/actors:autonomous_action_lib",
47 "//y2016/actors:superstructure_action_lib",
48 "//y2016/actors:vision_align_action_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070049 "//y2016/control_loops/shooter:shooter_goal_fbs",
50 "//y2016/control_loops/superstructure:superstructure_goal_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070051 "//y2016/control_loops/superstructure:superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070052 "//y2016/control_loops/superstructure:superstructure_status_fbs",
53 "//y2016/queues:ball_detector_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070054 ],
Comran Morshed9a9948c2016-01-16 15:58:04 +000055)
56
Lee Mracek6821fe02018-11-01 17:27:30 -040057robot_downloader(
Tyler Chatow24b5db12020-01-06 21:16:56 -080058 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -080059 ":aos_config",
Tyler Chatow24b5db12020-01-06 21:16:56 -080060 ],
Brian Silvermanf819b442019-01-20 16:51:04 -080061 dirs = [
62 "//y2016/dashboard:www_files",
63 ],
64 start_binaries = [
65 ":joystick_reader",
66 ":wpilib_interface",
67 "//y2016/control_loops/drivetrain:drivetrain",
68 "//y2016/control_loops/superstructure:superstructure",
69 "//y2016/control_loops/shooter:shooter",
70 "//y2016/dashboard:dashboard",
71 "//y2016/actors:autonomous_action",
72 "//y2016/actors:superstructure_action",
73 "//y2016/actors:vision_align_action",
74 "//y2016/vision:target_receiver",
75 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080076 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhc80dd152016-02-29 01:47:44 -080077)
Brian Silverman06016bc2017-02-11 16:34:34 -080078
Alex Perrycb7da4b2019-08-28 19:35:56 -070079aos_config(
Austin Schuhc5fa6d92022-02-25 14:36:28 -080080 name = "aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -070081 src = "y2016.json",
82 flatbuffers = [
83 "//y2016/control_loops/shooter:shooter_goal_fbs",
84 "//y2016/control_loops/shooter:shooter_output_fbs",
85 "//y2016/control_loops/shooter:shooter_position_fbs",
86 "//y2016/control_loops/shooter:shooter_status_fbs",
87 "//y2016/control_loops/superstructure:superstructure_goal_fbs",
88 "//y2016/control_loops/superstructure:superstructure_output_fbs",
89 "//y2016/control_loops/superstructure:superstructure_position_fbs",
90 "//y2016/control_loops/superstructure:superstructure_status_fbs",
91 "//y2016/queues:ball_detector_fbs",
Tyler Chatow24b5db12020-01-06 21:16:56 -080092 "//y2016/vision:vision_fbs",
93 "//y2019/control_loops/drivetrain:target_selector_fbs",
94 "//y2016/actors:vision_align_action_fbs",
95 "//y2016/actors:superstructure_action_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -070096 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080097 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070098 visibility = ["//visibility:public"],
99 deps = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800100 "//frc971/autonomous:aos_config",
101 "//frc971/control_loops/drivetrain:aos_config",
102 "//frc971/input:aos_config",
103 "//frc971/wpilib:aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700104 ],
105)
106
Brian Silverman06016bc2017-02-11 16:34:34 -0800107cc_binary(
Brian Silverman6470f442018-08-05 12:08:16 -0700108 name = "wpilib_interface",
109 srcs = [
110 "wpilib_interface.cc",
111 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800112 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman6470f442018-08-05 12:08:16 -0700113 deps = [
114 ":constants",
Brian Silvermanf819b442019-01-20 16:51:04 -0800115 "//aos:init",
John Park33858a32018-09-28 23:05:48 -0700116 "//aos:math",
John Park33858a32018-09-28 23:05:48 -0700117 "//aos/logging",
Brian Silvermanf819b442019-01-20 16:51:04 -0800118 "//aos/stl_mutex",
119 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700120 "//aos/util:log_interval",
121 "//aos/util:phased_loop",
122 "//aos/util:wrapping_counter",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700123 "//frc971/autonomous:auto_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800124 "//frc971/autonomous:auto_mode_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700125 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700126 "//frc971/control_loops:control_loops_fbs",
127 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
128 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700129 "//frc971/input:robot_state_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700130 "//frc971/wpilib:ADIS16448",
131 "//frc971/wpilib:buffered_pcm",
132 "//frc971/wpilib:dma",
133 "//frc971/wpilib:dma_edge_counting",
Sabina Davisb71bc282019-02-03 01:17:23 -0800134 "//frc971/wpilib:drivetrain_writer",
Brian Silverman6470f442018-08-05 12:08:16 -0700135 "//frc971/wpilib:encoder_and_potentiometer",
136 "//frc971/wpilib:gyro_sender",
137 "//frc971/wpilib:interrupt_edge_counting",
138 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700139 "//frc971/wpilib:logging_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700140 "//frc971/wpilib:loop_output_handler",
141 "//frc971/wpilib:pdp_fetcher",
Austin Schuh54667ac2019-02-02 16:44:49 -0800142 "//frc971/wpilib:sensor_reader",
Brian Silverman6470f442018-08-05 12:08:16 -0700143 "//frc971/wpilib:wpilib_robot_base",
144 "//third_party:wpilib",
145 "//y2016/control_loops/drivetrain:polydrivetrain_plants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700146 "//y2016/control_loops/shooter:shooter_output_fbs",
147 "//y2016/control_loops/shooter:shooter_position_fbs",
148 "//y2016/control_loops/superstructure:superstructure_output_fbs",
149 "//y2016/control_loops/superstructure:superstructure_position_fbs",
150 "//y2016/queues:ball_detector_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700151 ],
152)
153
154py_library(
155 name = "python_init",
156 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800157 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700158 visibility = ["//visibility:public"],
Brian Silverman06016bc2017-02-11 16:34:34 -0800159)