blob: a96ea5ad76186a3af2d9e61163ca179354669dfd [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 ],
12 visibility = ["//visibility:public"],
13 deps = [
John Park33858a32018-09-28 23:05:48 -070014 "//aos/logging",
Brian Silvermanf819b442019-01-20 16:51:04 -080015 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -070016 "//aos/network:team_number",
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",
Brian Silverman6470f442018-08-05 12:08:16 -070022 ],
Comran Morshed9a9948c2016-01-16 15:58:04 +000023)
24
25cc_binary(
Brian Silverman6470f442018-08-05 12:08:16 -070026 name = "joystick_reader",
27 srcs = [
28 "joystick_reader.cc",
29 ],
30 deps = [
31 ":constants",
John Park398c74a2018-10-20 21:17:39 -070032 "//aos:init",
Brian Silvermanf819b442019-01-20 16:51:04 -080033 "//aos/actions:action_lib",
Austin Schuha250b2d2019-05-27 16:14:02 -070034 "//aos/input:action_joystick_input",
Brian Silvermanf819b442019-01-20 16:51:04 -080035 "//aos/logging",
36 "//aos/time",
37 "//aos/util:log_interval",
Alex Perrycb7da4b2019-08-28 19:35:56 -070038 "//frc971/autonomous:auto_fbs",
39 "//frc971/control_loops/drivetrain:drivetrain_goal_fbs",
40 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Tyler Chatow24b5db12020-01-06 21:16:56 -080041 "//frc971/queues:gyro_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070042 "//y2016/actors:autonomous_action_lib",
43 "//y2016/actors:superstructure_action_lib",
44 "//y2016/actors:vision_align_action_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070045 "//y2016/control_loops/shooter:shooter_goal_fbs",
46 "//y2016/control_loops/superstructure:superstructure_goal_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070047 "//y2016/control_loops/superstructure:superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070048 "//y2016/control_loops/superstructure:superstructure_status_fbs",
49 "//y2016/queues:ball_detector_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070050 ],
Comran Morshed9a9948c2016-01-16 15:58:04 +000051)
52
Lee Mracek6821fe02018-11-01 17:27:30 -040053robot_downloader(
Tyler Chatow24b5db12020-01-06 21:16:56 -080054 data = [
55 ":config.json",
56 ],
Brian Silvermanf819b442019-01-20 16:51:04 -080057 dirs = [
58 "//y2016/dashboard:www_files",
59 ],
60 start_binaries = [
61 ":joystick_reader",
62 ":wpilib_interface",
63 "//y2016/control_loops/drivetrain:drivetrain",
64 "//y2016/control_loops/superstructure:superstructure",
65 "//y2016/control_loops/shooter:shooter",
66 "//y2016/dashboard:dashboard",
67 "//y2016/actors:autonomous_action",
68 "//y2016/actors:superstructure_action",
69 "//y2016/actors:vision_align_action",
70 "//y2016/vision:target_receiver",
71 ],
Austin Schuhc80dd152016-02-29 01:47:44 -080072)
Brian Silverman06016bc2017-02-11 16:34:34 -080073
Alex Perrycb7da4b2019-08-28 19:35:56 -070074aos_config(
75 name = "config",
76 src = "y2016.json",
77 flatbuffers = [
78 "//y2016/control_loops/shooter:shooter_goal_fbs",
79 "//y2016/control_loops/shooter:shooter_output_fbs",
80 "//y2016/control_loops/shooter:shooter_position_fbs",
81 "//y2016/control_loops/shooter:shooter_status_fbs",
82 "//y2016/control_loops/superstructure:superstructure_goal_fbs",
83 "//y2016/control_loops/superstructure:superstructure_output_fbs",
84 "//y2016/control_loops/superstructure:superstructure_position_fbs",
85 "//y2016/control_loops/superstructure:superstructure_status_fbs",
86 "//y2016/queues:ball_detector_fbs",
Tyler Chatow24b5db12020-01-06 21:16:56 -080087 "//y2016/vision:vision_fbs",
88 "//y2019/control_loops/drivetrain:target_selector_fbs",
89 "//y2016/actors:vision_align_action_fbs",
90 "//y2016/actors:superstructure_action_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -070091 ],
92 visibility = ["//visibility:public"],
93 deps = [
94 "//aos/robot_state:config",
Tyler Chatow24b5db12020-01-06 21:16:56 -080095 "//frc971/autonomous:config",
Alex Perrycb7da4b2019-08-28 19:35:56 -070096 "//frc971/control_loops/drivetrain:config",
Tyler Chatow24b5db12020-01-06 21:16:56 -080097 "//frc971/wpilib:config",
Alex Perrycb7da4b2019-08-28 19:35:56 -070098 ],
99)
100
Brian Silverman06016bc2017-02-11 16:34:34 -0800101cc_binary(
Brian Silverman6470f442018-08-05 12:08:16 -0700102 name = "wpilib_interface",
103 srcs = [
104 "wpilib_interface.cc",
105 ],
106 restricted_to = ["//tools:roborio"],
107 deps = [
108 ":constants",
Brian Silvermanf819b442019-01-20 16:51:04 -0800109 "//aos:init",
110 "//aos:make_unique",
John Park33858a32018-09-28 23:05:48 -0700111 "//aos:math",
John Park33858a32018-09-28 23:05:48 -0700112 "//aos/controls:control_loop",
113 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700114 "//aos/robot_state:robot_state_fbs",
Brian Silvermanf819b442019-01-20 16:51:04 -0800115 "//aos/stl_mutex",
116 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700117 "//aos/util:log_interval",
118 "//aos/util:phased_loop",
119 "//aos/util:wrapping_counter",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700120 "//frc971/autonomous:auto_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800121 "//frc971/autonomous:auto_mode_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700122 "//frc971/control_loops:control_loops_fbs",
123 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
124 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700125 "//frc971/wpilib:ADIS16448",
126 "//frc971/wpilib:buffered_pcm",
127 "//frc971/wpilib:dma",
128 "//frc971/wpilib:dma_edge_counting",
Sabina Davisb71bc282019-02-03 01:17:23 -0800129 "//frc971/wpilib:drivetrain_writer",
Brian Silverman6470f442018-08-05 12:08:16 -0700130 "//frc971/wpilib:encoder_and_potentiometer",
131 "//frc971/wpilib:gyro_sender",
132 "//frc971/wpilib:interrupt_edge_counting",
133 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700134 "//frc971/wpilib:logging_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700135 "//frc971/wpilib:loop_output_handler",
136 "//frc971/wpilib:pdp_fetcher",
Austin Schuh54667ac2019-02-02 16:44:49 -0800137 "//frc971/wpilib:sensor_reader",
Brian Silverman6470f442018-08-05 12:08:16 -0700138 "//frc971/wpilib:wpilib_robot_base",
139 "//third_party:wpilib",
140 "//y2016/control_loops/drivetrain:polydrivetrain_plants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700141 "//y2016/control_loops/shooter:shooter_output_fbs",
142 "//y2016/control_loops/shooter:shooter_position_fbs",
143 "//y2016/control_loops/superstructure:superstructure_output_fbs",
144 "//y2016/control_loops/superstructure:superstructure_position_fbs",
145 "//y2016/queues:ball_detector_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700146 ],
147)
148
149py_library(
150 name = "python_init",
151 srcs = ["__init__.py"],
152 visibility = ["//visibility:public"],
Brian Silverman06016bc2017-02-11 16:34:34 -0800153)