blob: 12a585b9214bfb48423136a2b6dc3e11047289d1 [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")
Austin Schuh7b9a3ba2017-02-19 23:11:45 -08003
Tyler Chatow6107aba2017-01-22 01:39:40 +00004cc_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/shooter_interpolation:interpolation",
20 "//y2017/control_loops/drivetrain:polydrivetrain_plants",
21 "//y2017/control_loops/superstructure/column:column_plants",
22 "//y2017/control_loops/superstructure/hood:hood_plants",
23 "//y2017/control_loops/superstructure/intake:intake_plants",
24 "//y2017/control_loops/superstructure/shooter:shooter_plants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080025 "@com_google_absl//absl/base",
Brian Silverman6470f442018-08-05 12:08:16 -070026 ],
Tyler Chatow6107aba2017-01-22 01:39:40 +000027)
Brian Silverman06016bc2017-02-11 16:34:34 -080028
29cc_binary(
Brian Silverman6470f442018-08-05 12:08:16 -070030 name = "joystick_reader",
31 srcs = [
32 "joystick_reader.cc",
33 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080034 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070035 deps = [
36 ":constants",
Brian Silvermanf819b442019-01-20 16:51:04 -080037 "//aos:init",
John Park33858a32018-09-28 23:05:48 -070038 "//aos/actions:action_lib",
Brian Silvermanf819b442019-01-20 16:51:04 -080039 "//aos/logging",
40 "//aos/time",
41 "//aos/util:log_interval",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070042 "//frc971/input:action_joystick_input",
43 "//frc971/input:drivetrain_input",
Brian Silverman6470f442018-08-05 12:08:16 -070044 "//y2017/actors:autonomous_action_lib",
45 "//y2017/control_loops/drivetrain:drivetrain_base",
Alex Perrycb7da4b2019-08-28 19:35:56 -070046 "//y2017/control_loops/superstructure:superstructure_goal_fbs",
47 "//y2017/control_loops/superstructure:superstructure_status_fbs",
48 ],
49)
50
51aos_config(
52 name = "config",
53 src = "y2017.json",
54 flatbuffers = [
55 "//y2017/control_loops/superstructure:superstructure_goal_fbs",
56 "//y2017/control_loops/superstructure:superstructure_output_fbs",
57 "//y2017/control_loops/superstructure:superstructure_position_fbs",
58 "//y2017/control_loops/superstructure:superstructure_status_fbs",
59 "//y2017/vision:vision_fbs",
60 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080061 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070062 visibility = ["//visibility:public"],
63 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070064 "//frc971/control_loops/drivetrain:config",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070065 "//frc971/input:config",
Brian Silverman6470f442018-08-05 12:08:16 -070066 ],
Campbell Crowley71b5f132017-02-18 13:16:08 -080067)
68
69cc_binary(
Brian Silverman6470f442018-08-05 12:08:16 -070070 name = "wpilib_interface",
71 srcs = [
72 "wpilib_interface.cc",
73 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080074 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman6470f442018-08-05 12:08:16 -070075 deps = [
76 ":constants",
Brian Silvermanf819b442019-01-20 16:51:04 -080077 "//aos:init",
John Park33858a32018-09-28 23:05:48 -070078 "//aos:math",
John Park33858a32018-09-28 23:05:48 -070079 "//aos/logging",
Brian Silvermanf819b442019-01-20 16:51:04 -080080 "//aos/stl_mutex",
81 "//aos/time",
John Park33858a32018-09-28 23:05:48 -070082 "//aos/util:log_interval",
83 "//aos/util:phased_loop",
84 "//aos/util:wrapping_counter",
Alex Perrycb7da4b2019-08-28 19:35:56 -070085 "//frc971/autonomous:auto_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -080086 "//frc971/autonomous:auto_mode_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070087 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070088 "//frc971/control_loops:control_loops_fbs",
89 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
90 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070091 "//frc971/input:robot_state_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070092 "//frc971/wpilib:ADIS16448",
93 "//frc971/wpilib:buffered_pcm",
94 "//frc971/wpilib:dma",
95 "//frc971/wpilib:dma_edge_counting",
Sabina Davis7af11ad2019-02-03 01:16:45 -080096 "//frc971/wpilib:drivetrain_writer",
Brian Silverman6470f442018-08-05 12:08:16 -070097 "//frc971/wpilib:encoder_and_potentiometer",
98 "//frc971/wpilib:interrupt_edge_counting",
99 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700100 "//frc971/wpilib:logging_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700101 "//frc971/wpilib:loop_output_handler",
102 "//frc971/wpilib:pdp_fetcher",
Austin Schuhbf29b6f2019-02-02 21:45:27 -0800103 "//frc971/wpilib:sensor_reader",
Brian Silverman6470f442018-08-05 12:08:16 -0700104 "//frc971/wpilib:wpilib_robot_base",
105 "//third_party:wpilib",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700106 "//y2017/control_loops/superstructure:superstructure_output_fbs",
107 "//y2017/control_loops/superstructure:superstructure_position_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700108 ],
Brian Silverman06016bc2017-02-11 16:34:34 -0800109)
Austin Schuh7b9a3ba2017-02-19 23:11:45 -0800110
Lee Mracek6821fe02018-11-01 17:27:30 -0400111robot_downloader(
Brian Silvermanf819b442019-01-20 16:51:04 -0800112 start_binaries = [
113 ":joystick_reader",
114 ":wpilib_interface",
115 "//y2017/control_loops/drivetrain:drivetrain",
116 "//y2017/control_loops/superstructure:superstructure",
117 "//y2017/actors:autonomous_action",
118 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800119 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700120)
121
122py_library(
123 name = "python_init",
124 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800125 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700126 visibility = ["//visibility:public"],
Austin Schuh7b9a3ba2017-02-19 23:11:45 -0800127)