blob: 5c9a3a6fb26a86045fce6ff1366e217b8432888e [file] [log] [blame]
Sabina Davis1b84afa2019-02-09 01:20:21 -08001load("//frc971:downloader.bzl", "robot_downloader")
Alex Perrycb7da4b2019-08-28 19:35:56 -07002load("//aos:config.bzl", "aos_config")
Michael Schuh5a1a7582019-03-01 13:03:47 -08003load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
Alex Perrycb7da4b2019-08-28 19:35:56 -07004load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Sabina Davis1b84afa2019-02-09 01:20:21 -08005
6robot_downloader(
Austin Schuh635e8bf2019-03-23 18:53:15 -07007 dirs = [
8 "//y2019/vision/server:www_files",
9 ],
Sabina Davis1b84afa2019-02-09 01:20:21 -080010 start_binaries = [
11 ":joystick_reader",
12 ":wpilib_interface",
13 "//y2019/control_loops/drivetrain:drivetrain",
Austin Schuh355f3272019-02-15 23:09:29 -080014 "//y2019/control_loops/superstructure:superstructure",
Austin Schuh986091a2019-03-22 20:35:12 -070015 "//y2019/actors:binaries",
Austin Schuh635e8bf2019-03-23 18:53:15 -070016 "//y2019/vision/server",
Sabina Davis1b84afa2019-02-09 01:20:21 -080017 ],
18)
19
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080020cc_library(
21 name = "constants",
22 srcs = [
23 "constants.cc",
24 ],
25 hdrs = [
26 "constants.h",
27 ],
28 visibility = ["//visibility:public"],
29 deps = [
John Parkb859cf02019-11-20 19:52:05 -080030 "@com_google_absl//absl/base",
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080031 "//aos/logging",
32 "//aos/mutex",
33 "//aos/network:team_number",
34 "//frc971:constants",
James Kuszmaul22c5ab32019-02-09 14:45:58 -080035 "//frc971/control_loops:pose",
Theo Bafrali00e42272019-02-12 01:07:46 -080036 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
James Kuszmaul22c5ab32019-02-09 14:45:58 -080037 "//y2019/control_loops/drivetrain:camera",
Sabina Davis7be49f32019-02-02 00:30:19 -080038 "//y2019/control_loops/drivetrain:polydrivetrain_plants",
Alex Perry5fb5ff22019-02-09 21:53:17 -080039 "//y2019/control_loops/superstructure/elevator:elevator_plants",
40 "//y2019/control_loops/superstructure/intake:intake_plants",
41 "//y2019/control_loops/superstructure/stilts:stilts_plants",
Austin Schuhc1d6f832019-02-15 23:22:17 -080042 "//y2019/control_loops/superstructure/wrist:wrist_plants",
James Kuszmaule2c71ea2019-03-04 08:14:21 -080043 "//y2019/vision:constants",
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080044 ],
45)
46
Sabina Davisabeae332019-02-01 21:12:57 -080047cc_binary(
48 name = "wpilib_interface",
49 srcs = [
50 "wpilib_interface.cc",
51 ],
52 restricted_to = ["//tools:roborio"],
53 deps = [
Sabina Davis7be49f32019-02-02 00:30:19 -080054 ":constants",
Sabina Davisc6329342019-03-01 20:44:42 -080055 ":status_light",
Sabina Davisabeae332019-02-01 21:12:57 -080056 "//aos:init",
57 "//aos:make_unique",
58 "//aos:math",
59 "//aos/controls:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070060 "//aos/events:shm_event_loop",
Sabina Davisabeae332019-02-01 21:12:57 -080061 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -070062 "//aos/robot_state:robot_state_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080063 "//aos/stl_mutex",
64 "//aos/time",
65 "//aos/util:log_interval",
66 "//aos/util:phased_loop",
67 "//aos/util:wrapping_counter",
Alex Perrycb7da4b2019-08-28 19:35:56 -070068 "//frc971/autonomous:auto_fbs",
69 "//frc971/control_loops:control_loops_fbs",
70 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080071 "//frc971/wpilib:ADIS16448",
Austin Schuhc1d6f832019-02-15 23:22:17 -080072 "//frc971/wpilib:buffered_pcm",
Sabina Davisd004fd62019-02-02 23:51:46 -080073 "//frc971/wpilib:drivetrain_writer",
Sabina Davisabeae332019-02-01 21:12:57 -080074 "//frc971/wpilib:encoder_and_potentiometer",
75 "//frc971/wpilib:interrupt_edge_counting",
76 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -070077 "//frc971/wpilib:logging_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080078 "//frc971/wpilib:loop_output_handler",
79 "//frc971/wpilib:pdp_fetcher",
Sabina Davisadc58542019-02-01 22:23:00 -080080 "//frc971/wpilib:sensor_reader",
Sabina Davisabeae332019-02-01 21:12:57 -080081 "//frc971/wpilib:wpilib_interface",
82 "//frc971/wpilib:wpilib_robot_base",
Austin Schuhf6b94632019-02-02 22:11:27 -080083 "//third_party:phoenix",
Sabina Davisabeae332019-02-01 21:12:57 -080084 "//third_party:wpilib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070085 "//y2019/control_loops/drivetrain:camera_fbs",
86 "//y2019/control_loops/superstructure:superstructure_output_fbs",
87 "//y2019/control_loops/superstructure:superstructure_position_fbs",
Brian Silvermanf8b75252019-02-24 16:13:58 -080088 "//y2019/jevois:spi",
Sabina Davisabeae332019-02-01 21:12:57 -080089 ],
90)
Sabina Davis1b84afa2019-02-09 01:20:21 -080091
Tyler Chatowd28951f2019-02-16 20:12:28 -080092cc_library(
93 name = "joystick_angle",
94 srcs = [
95 "joystick_angle.cc",
96 ],
97 hdrs = [
98 "joystick_angle.h",
99 ],
100 deps = [
101 "//aos/input:drivetrain_input",
Tyler Chatowc8012ca2019-02-18 22:33:01 -0800102 "//frc971/zeroing:wrap",
Tyler Chatowd28951f2019-02-16 20:12:28 -0800103 ],
104)
105
106cc_test(
107 name = "joystick_angle_test",
108 srcs = [
109 "joystick_angle_test.cc",
110 ],
111 deps = [
112 ":joystick_angle",
113 "//aos/testing:googletest",
114 ],
115)
116
Sabina Davis1b84afa2019-02-09 01:20:21 -0800117cc_binary(
Sabina Davis91b23602019-01-21 00:06:01 -0800118 name = "joystick_reader",
119 srcs = [
120 ":joystick_reader.cc",
121 ],
122 deps = [
Sabina Davisc6329342019-03-01 20:44:42 -0800123 ":status_light",
Tyler Chatowe0241452019-03-08 21:07:50 -0800124 ":vision_proto",
Sabina Davis91b23602019-01-21 00:06:01 -0800125 "//aos:init",
126 "//aos/actions:action_lib",
Sabina Davis1b84afa2019-02-09 01:20:21 -0800127 "//aos/input:action_joystick_input",
Sabina Davis91b23602019-01-21 00:06:01 -0800128 "//aos/input:drivetrain_input",
129 "//aos/input:joystick_input",
Sabina Davis91b23602019-01-21 00:06:01 -0800130 "//aos/logging",
131 "//aos/network:team_number",
132 "//aos/stl_mutex",
133 "//aos/time",
134 "//aos/util:log_interval",
135 "//aos/vision/events:udp",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700136 "//frc971/autonomous:auto_fbs",
Sabina Davis91b23602019-01-21 00:06:01 -0800137 "//frc971/autonomous:base_autonomous_actor",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700138 "//frc971/control_loops:profiled_subsystem_fbs",
139 "//frc971/control_loops/drivetrain:localizer_fbs",
Sabina Davis91b23602019-01-21 00:06:01 -0800140 "//y2019/control_loops/drivetrain:drivetrain_base",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700141 "//y2019/control_loops/drivetrain:target_selector_fbs",
142 "//y2019/control_loops/superstructure:superstructure_goal_fbs",
143 "//y2019/control_loops/superstructure:superstructure_position_fbs",
144 "//y2019/control_loops/superstructure:superstructure_status_fbs",
Tyler Chatowe0241452019-03-08 21:07:50 -0800145 "@com_google_protobuf//:protobuf",
Sabina Davis91b23602019-01-21 00:06:01 -0800146 ],
147)
Sabina Davisabeae332019-02-01 21:12:57 -0800148
Alex Perrycb7da4b2019-08-28 19:35:56 -0700149flatbuffer_cc_library(
Sabina Davisc6329342019-03-01 20:44:42 -0800150 name = "status_light",
151 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700152 "status_light.fbs",
153 ],
154 gen_reflections = 1,
155 visibility = ["//visibility:public"],
156)
157
158aos_config(
159 name = "config",
160 src = "y2019.json",
161 flatbuffers = [
162 ":status_light",
163 "//y2019/control_loops/drivetrain:camera_fbs",
164 "//y2019/control_loops/drivetrain:target_selector_fbs",
165 "//y2019/control_loops/superstructure:superstructure_goal_fbs",
166 "//y2019/control_loops/superstructure:superstructure_output_fbs",
167 "//y2019/control_loops/superstructure:superstructure_position_fbs",
168 "//y2019/control_loops/superstructure:superstructure_status_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -0800169 ],
170 visibility = ["//visibility:public"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700171 deps = [
172 "//aos/robot_state:config",
173 "//frc971/control_loops/drivetrain:config",
174 ],
Sabina Davisc6329342019-03-01 20:44:42 -0800175)
176
Michael Schuh5a1a7582019-03-01 13:03:47 -0800177cc_proto_library(
178 name = "vision_proto",
179 srcs = ["vision.proto"],
180 visibility = ["//visibility:public"],
181)
182
Michael Schuhab42b0a2019-01-07 16:33:43 -0800183py_library(
184 name = "python_init",
185 srcs = ["__init__.py"],
186 visibility = ["//visibility:public"],
Sabina Davisabeae332019-02-01 21:12:57 -0800187)