blob: 7f08651cbfeca12ca1a180497edae8cbc2f477db [file] [log] [blame]
Comran Morshed25f81a02016-01-23 13:40:10 +00001package(default_visibility = ['//visibility:public'])
2
Austin Schuh4f857292018-02-15 23:42:04 -08003load('//aos/build:queues.bzl', 'queue_library')
Comran Morshed25f81a02016-01-23 13:40:10 +00004
5queue_library(
6 name = 'superstructure_queue',
7 srcs = [
8 'superstructure.q',
9 ],
10 deps = [
John Park33858a32018-09-28 23:05:48 -070011 '//aos/controls:control_loop_queues',
Comran Morshed25f81a02016-01-23 13:40:10 +000012 '//frc971/control_loops:queues',
13 ],
14)
15
Comran Morshed2ae094e2016-01-23 20:43:20 +000016genrule(
17 name = 'genrule_intake',
18 visibility = ['//visibility:private'],
19 cmd = '$(location //y2016/control_loops/python:intake) $(OUTS)',
20 tools = [
21 '//y2016/control_loops/python:intake',
22 ],
23 outs = [
24 'intake_plant.h',
25 'intake_plant.cc',
26 'integral_intake_plant.h',
27 'integral_intake_plant.cc',
28 ],
29)
30
31genrule(
Austin Schuh2fc10fa2016-02-08 00:44:34 -080032 name = 'genrule_arm',
Comran Morshed2ae094e2016-01-23 20:43:20 +000033 visibility = ['//visibility:private'],
Austin Schuh2fc10fa2016-02-08 00:44:34 -080034 cmd = '$(location //y2016/control_loops/python:arm) $(OUTS)',
Comran Morshed2ae094e2016-01-23 20:43:20 +000035 tools = [
Austin Schuh2fc10fa2016-02-08 00:44:34 -080036 '//y2016/control_loops/python:arm',
Comran Morshed2ae094e2016-01-23 20:43:20 +000037 ],
38 outs = [
Austin Schuh2fc10fa2016-02-08 00:44:34 -080039 'arm_plant.h',
40 'arm_plant.cc',
41 'integral_arm_plant.h',
42 'integral_arm_plant.cc',
Comran Morshed2ae094e2016-01-23 20:43:20 +000043 ],
44)
45
46cc_library(
47 name = 'superstructure_plants',
48 srcs = [
49 'intake_plant.cc',
Austin Schuh2fc10fa2016-02-08 00:44:34 -080050 'arm_plant.cc',
Comran Morshed2ae094e2016-01-23 20:43:20 +000051 'integral_intake_plant.cc',
Austin Schuh2fc10fa2016-02-08 00:44:34 -080052 'integral_arm_plant.cc',
Comran Morshed2ae094e2016-01-23 20:43:20 +000053 ],
54 hdrs = [
55 'intake_plant.h',
Austin Schuh2fc10fa2016-02-08 00:44:34 -080056 'arm_plant.h',
Comran Morshed2ae094e2016-01-23 20:43:20 +000057 'integral_intake_plant.h',
Austin Schuh2fc10fa2016-02-08 00:44:34 -080058 'integral_arm_plant.h',
Comran Morshed2ae094e2016-01-23 20:43:20 +000059 ],
60 deps = [
61 '//frc971/control_loops:state_feedback_loop',
62 ],
63)
64
Comran Morshed25f81a02016-01-23 13:40:10 +000065cc_library(
66 name = 'superstructure_lib',
67 srcs = [
68 'superstructure.cc',
Austin Schuh10c2d112016-02-14 13:42:28 -080069 'superstructure_controls.cc',
Comran Morshed25f81a02016-01-23 13:40:10 +000070 ],
71 hdrs = [
72 'superstructure.h',
Austin Schuh10c2d112016-02-14 13:42:28 -080073 'superstructure_controls.h',
Comran Morshed25f81a02016-01-23 13:40:10 +000074 ],
75 deps = [
76 ':superstructure_queue',
Austin Schuh2fc10fa2016-02-08 00:44:34 -080077 ':superstructure_plants',
John Park33858a32018-09-28 23:05:48 -070078 '//aos/controls:control_loop',
79 '//aos/util:trapezoid_profile',
80 '//aos:math',
Austin Schuh473a5652017-02-05 01:30:42 -080081 '//frc971/control_loops:profiled_subsystem',
Brian Silverman2b1957a2016-02-14 20:29:57 -050082 '//frc971/control_loops:simple_capped_state_feedback_loop',
Austin Schuh473a5652017-02-05 01:30:42 -080083 '//frc971/control_loops:state_feedback_loop',
Austin Schuh2fc10fa2016-02-08 00:44:34 -080084 '//frc971/zeroing',
Austin Schuh473a5652017-02-05 01:30:42 -080085 '//y2016/queues:ball_detector',
Austin Schuh2fc10fa2016-02-08 00:44:34 -080086 '//y2016:constants',
Comran Morshed25f81a02016-01-23 13:40:10 +000087 ],
88)
89
90cc_test(
91 name = 'superstructure_lib_test',
92 srcs = [
93 'superstructure_lib_test.cc',
94 ],
95 deps = [
96 ':superstructure_queue',
97 ':superstructure_lib',
98 '//aos/testing:googletest',
John Park33858a32018-09-28 23:05:48 -070099 '//aos:queues',
100 '//aos/controls:control_loop_test',
101 '//aos:math',
102 '//aos/time:time',
Austin Schuh2fc10fa2016-02-08 00:44:34 -0800103 '//frc971/control_loops:position_sensor_sim',
104 '//frc971/control_loops:team_number_test_environment',
Comran Morshed25f81a02016-01-23 13:40:10 +0000105 ],
106)
107
108cc_binary(
109 name = 'superstructure',
110 srcs = [
111 'superstructure_main.cc',
112 ],
113 deps = [
John Park398c74a2018-10-20 21:17:39 -0700114 '//aos:init',
Comran Morshed25f81a02016-01-23 13:40:10 +0000115 ':superstructure_lib',
116 ':superstructure_queue',
117 ],
118)