blob: c5841357730d37139b7ca4c4b8fb6b4fb765fc4a [file] [log] [blame]
Comran Morshed25f81a02016-01-23 13:40:10 +00001package(default_visibility = ['//visibility:public'])
2
3load('/aos/build/queues', 'queue_library')
4
5queue_library(
6 name = 'superstructure_queue',
7 srcs = [
8 'superstructure.q',
9 ],
10 deps = [
11 '//aos/common/controls:control_loop_queues',
12 '//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',
Comran Morshed25f81a02016-01-23 13:40:10 +000078 '//aos/common/controls:control_loop',
Austin Schuh2fc10fa2016-02-08 00:44:34 -080079 '//aos/common/util:trapezoid_profile',
Comran Morshed25f81a02016-01-23 13:40:10 +000080 '//frc971/control_loops:state_feedback_loop',
Austin Schuh2fc10fa2016-02-08 00:44:34 -080081 '//frc971/zeroing',
82 '//y2016:constants',
Comran Morshed25f81a02016-01-23 13:40:10 +000083 ],
84)
85
86cc_test(
87 name = 'superstructure_lib_test',
88 srcs = [
89 'superstructure_lib_test.cc',
90 ],
91 deps = [
92 ':superstructure_queue',
93 ':superstructure_lib',
94 '//aos/testing:googletest',
95 '//aos/common:queues',
96 '//aos/common/controls:control_loop_test',
Austin Schuh2fc10fa2016-02-08 00:44:34 -080097 '//aos/common:math',
98 '//aos/common:time',
99 '//frc971/control_loops:position_sensor_sim',
100 '//frc971/control_loops:team_number_test_environment',
Comran Morshed25f81a02016-01-23 13:40:10 +0000101 ],
102)
103
104cc_binary(
105 name = 'superstructure',
106 srcs = [
107 'superstructure_main.cc',
108 ],
109 deps = [
110 '//aos/linux_code:init',
111 ':superstructure_lib',
112 ':superstructure_queue',
113 ],
114)