blob: 8c695c87bad037d18329ce185c3b05a19870bd0e [file] [log] [blame]
Brian Silvermanf819b442019-01-20 16:51:04 -08001load("//frc971:downloader.bzl", "robot_downloader")
Alex Perrycb7da4b2019-08-28 19:35:56 -07002load("//aos:config.bzl", "aos_config")
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/logging",
16 "//aos/network:team_number",
Brian Silverman1463c092020-10-30 17:28:24 -070017 "//aos/stl_mutex",
Brian Silverman6470f442018-08-05 12:08:16 -070018 "//frc971:constants",
19 "//frc971:shifter_hall_effect",
20 "//frc971/control_loops:state_feedback_loop",
21 "//y2016/control_loops/drivetrain:polydrivetrain_plants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080022 "@com_google_absl//absl/base",
Brian Silverman6470f442018-08-05 12:08:16 -070023 ],
Comran Morshed9a9948c2016-01-16 15:58:04 +000024)
25
26cc_binary(
Brian Silverman6470f442018-08-05 12:08:16 -070027 name = "joystick_reader",
28 srcs = [
29 "joystick_reader.cc",
30 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080031 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070032 deps = [
33 ":constants",
John Park398c74a2018-10-20 21:17:39 -070034 "//aos:init",
Brian Silvermanf819b442019-01-20 16:51:04 -080035 "//aos/actions:action_lib",
Austin Schuha250b2d2019-05-27 16:14:02 -070036 "//aos/input:action_joystick_input",
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",
Tyler Chatow24b5db12020-01-06 21:16:56 -080043 "//frc971/queues:gyro_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070044 "//y2016/actors:autonomous_action_lib",
45 "//y2016/actors:superstructure_action_lib",
46 "//y2016/actors:vision_align_action_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070047 "//y2016/control_loops/shooter:shooter_goal_fbs",
48 "//y2016/control_loops/superstructure:superstructure_goal_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070049 "//y2016/control_loops/superstructure:superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070050 "//y2016/control_loops/superstructure:superstructure_status_fbs",
51 "//y2016/queues:ball_detector_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070052 ],
Comran Morshed9a9948c2016-01-16 15:58:04 +000053)
54
Lee Mracek6821fe02018-11-01 17:27:30 -040055robot_downloader(
Tyler Chatow24b5db12020-01-06 21:16:56 -080056 data = [
Austin Schuh14d7d3d2020-09-10 18:14:36 -070057 ":config",
Tyler Chatow24b5db12020-01-06 21:16:56 -080058 ],
Brian Silvermanf819b442019-01-20 16:51:04 -080059 dirs = [
60 "//y2016/dashboard:www_files",
61 ],
62 start_binaries = [
63 ":joystick_reader",
64 ":wpilib_interface",
65 "//y2016/control_loops/drivetrain:drivetrain",
66 "//y2016/control_loops/superstructure:superstructure",
67 "//y2016/control_loops/shooter:shooter",
68 "//y2016/dashboard:dashboard",
69 "//y2016/actors:autonomous_action",
70 "//y2016/actors:superstructure_action",
71 "//y2016/actors:vision_align_action",
72 "//y2016/vision:target_receiver",
73 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080074 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhc80dd152016-02-29 01:47:44 -080075)
Brian Silverman06016bc2017-02-11 16:34:34 -080076
Alex Perrycb7da4b2019-08-28 19:35:56 -070077aos_config(
78 name = "config",
79 src = "y2016.json",
80 flatbuffers = [
81 "//y2016/control_loops/shooter:shooter_goal_fbs",
82 "//y2016/control_loops/shooter:shooter_output_fbs",
83 "//y2016/control_loops/shooter:shooter_position_fbs",
84 "//y2016/control_loops/shooter:shooter_status_fbs",
85 "//y2016/control_loops/superstructure:superstructure_goal_fbs",
86 "//y2016/control_loops/superstructure:superstructure_output_fbs",
87 "//y2016/control_loops/superstructure:superstructure_position_fbs",
88 "//y2016/control_loops/superstructure:superstructure_status_fbs",
89 "//y2016/queues:ball_detector_fbs",
Tyler Chatow24b5db12020-01-06 21:16:56 -080090 "//y2016/vision:vision_fbs",
91 "//y2019/control_loops/drivetrain:target_selector_fbs",
92 "//y2016/actors:vision_align_action_fbs",
93 "//y2016/actors:superstructure_action_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -070094 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080095 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070096 visibility = ["//visibility:public"],
97 deps = [
98 "//aos/robot_state:config",
Tyler Chatow24b5db12020-01-06 21:16:56 -080099 "//frc971/autonomous:config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700100 "//frc971/control_loops/drivetrain:config",
Tyler Chatow24b5db12020-01-06 21:16:56 -0800101 "//frc971/wpilib:config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700102 ],
103)
104
Brian Silverman06016bc2017-02-11 16:34:34 -0800105cc_binary(
Brian Silverman6470f442018-08-05 12:08:16 -0700106 name = "wpilib_interface",
107 srcs = [
108 "wpilib_interface.cc",
109 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800110 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman6470f442018-08-05 12:08:16 -0700111 deps = [
112 ":constants",
Brian Silvermanf819b442019-01-20 16:51:04 -0800113 "//aos:init",
114 "//aos:make_unique",
John Park33858a32018-09-28 23:05:48 -0700115 "//aos:math",
John Park33858a32018-09-28 23:05:48 -0700116 "//aos/controls:control_loop",
117 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700118 "//aos/robot_state:robot_state_fbs",
Brian Silvermanf819b442019-01-20 16:51:04 -0800119 "//aos/stl_mutex",
120 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700121 "//aos/util:log_interval",
122 "//aos/util:phased_loop",
123 "//aos/util:wrapping_counter",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700124 "//frc971/autonomous:auto_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800125 "//frc971/autonomous:auto_mode_fbs",
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",
Brian Silverman6470f442018-08-05 12:08:16 -0700129 "//frc971/wpilib:ADIS16448",
130 "//frc971/wpilib:buffered_pcm",
131 "//frc971/wpilib:dma",
132 "//frc971/wpilib:dma_edge_counting",
Sabina Davisb71bc282019-02-03 01:17:23 -0800133 "//frc971/wpilib:drivetrain_writer",
Brian Silverman6470f442018-08-05 12:08:16 -0700134 "//frc971/wpilib:encoder_and_potentiometer",
135 "//frc971/wpilib:gyro_sender",
136 "//frc971/wpilib:interrupt_edge_counting",
137 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700138 "//frc971/wpilib:logging_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700139 "//frc971/wpilib:loop_output_handler",
140 "//frc971/wpilib:pdp_fetcher",
Austin Schuh54667ac2019-02-02 16:44:49 -0800141 "//frc971/wpilib:sensor_reader",
Brian Silverman6470f442018-08-05 12:08:16 -0700142 "//frc971/wpilib:wpilib_robot_base",
143 "//third_party:wpilib",
144 "//y2016/control_loops/drivetrain:polydrivetrain_plants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700145 "//y2016/control_loops/shooter:shooter_output_fbs",
146 "//y2016/control_loops/shooter:shooter_position_fbs",
147 "//y2016/control_loops/superstructure:superstructure_output_fbs",
148 "//y2016/control_loops/superstructure:superstructure_position_fbs",
149 "//y2016/queues:ball_detector_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700150 ],
151)
152
153py_library(
154 name = "python_init",
155 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800156 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700157 visibility = ["//visibility:public"],
Brian Silverman06016bc2017-02-11 16:34:34 -0800158)