Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 1 | package(default_visibility = ["//visibility:public"]) |
Comran Morshed | 25f81a0 | 2016-01-23 13:40:10 +0000 | [diff] [blame] | 2 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 3 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
Comran Morshed | 25f81a0 | 2016-01-23 13:40:10 +0000 | [diff] [blame] | 4 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 5 | flatbuffer_cc_library( |
| 6 | name = "superstructure_goal_fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 7 | srcs = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 8 | "superstructure_goal.fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 9 | ], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 10 | gen_reflections = 1, |
| 11 | ) |
| 12 | |
| 13 | flatbuffer_cc_library( |
| 14 | name = "superstructure_position_fbs", |
| 15 | srcs = [ |
| 16 | "superstructure_position.fbs", |
| 17 | ], |
| 18 | gen_reflections = 1, |
| 19 | includes = [ |
| 20 | "//frc971/control_loops:control_loops_fbs_includes", |
| 21 | ], |
| 22 | ) |
| 23 | |
| 24 | flatbuffer_cc_library( |
| 25 | name = "superstructure_output_fbs", |
| 26 | srcs = [ |
| 27 | "superstructure_output.fbs", |
| 28 | ], |
| 29 | gen_reflections = 1, |
| 30 | ) |
| 31 | |
| 32 | flatbuffer_cc_library( |
| 33 | name = "superstructure_status_fbs", |
| 34 | srcs = [ |
| 35 | "superstructure_status.fbs", |
| 36 | ], |
| 37 | gen_reflections = 1, |
| 38 | includes = [ |
| 39 | "//frc971/control_loops:control_loops_fbs_includes", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 40 | ], |
Comran Morshed | 25f81a0 | 2016-01-23 13:40:10 +0000 | [diff] [blame] | 41 | ) |
| 42 | |
Comran Morshed | 2ae094e | 2016-01-23 20:43:20 +0000 | [diff] [blame] | 43 | genrule( |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 44 | name = "genrule_intake", |
| 45 | outs = [ |
| 46 | "intake_plant.h", |
| 47 | "intake_plant.cc", |
| 48 | "integral_intake_plant.h", |
| 49 | "integral_intake_plant.cc", |
| 50 | ], |
| 51 | cmd = "$(location //y2016/control_loops/python:intake) $(OUTS)", |
| 52 | tools = [ |
| 53 | "//y2016/control_loops/python:intake", |
| 54 | ], |
| 55 | visibility = ["//visibility:private"], |
Comran Morshed | 2ae094e | 2016-01-23 20:43:20 +0000 | [diff] [blame] | 56 | ) |
| 57 | |
| 58 | genrule( |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 59 | name = "genrule_arm", |
| 60 | outs = [ |
| 61 | "arm_plant.h", |
| 62 | "arm_plant.cc", |
| 63 | "integral_arm_plant.h", |
| 64 | "integral_arm_plant.cc", |
| 65 | ], |
| 66 | cmd = "$(location //y2016/control_loops/python:arm) $(OUTS)", |
| 67 | tools = [ |
| 68 | "//y2016/control_loops/python:arm", |
| 69 | ], |
| 70 | visibility = ["//visibility:private"], |
Comran Morshed | 2ae094e | 2016-01-23 20:43:20 +0000 | [diff] [blame] | 71 | ) |
| 72 | |
| 73 | cc_library( |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 74 | name = "superstructure_plants", |
| 75 | srcs = [ |
| 76 | "arm_plant.cc", |
| 77 | "intake_plant.cc", |
| 78 | "integral_arm_plant.cc", |
| 79 | "integral_intake_plant.cc", |
| 80 | ], |
| 81 | hdrs = [ |
| 82 | "arm_plant.h", |
| 83 | "intake_plant.h", |
| 84 | "integral_arm_plant.h", |
| 85 | "integral_intake_plant.h", |
| 86 | ], |
| 87 | deps = [ |
| 88 | "//frc971/control_loops:state_feedback_loop", |
| 89 | ], |
Comran Morshed | 2ae094e | 2016-01-23 20:43:20 +0000 | [diff] [blame] | 90 | ) |
| 91 | |
Comran Morshed | 25f81a0 | 2016-01-23 13:40:10 +0000 | [diff] [blame] | 92 | cc_library( |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 93 | name = "superstructure_lib", |
| 94 | srcs = [ |
| 95 | "superstructure.cc", |
| 96 | "superstructure_controls.cc", |
| 97 | ], |
| 98 | hdrs = [ |
| 99 | "superstructure.h", |
| 100 | "superstructure_controls.h", |
| 101 | ], |
| 102 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 103 | ":superstructure_goal_fbs", |
| 104 | ":superstructure_output_fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 105 | ":superstructure_plants", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 106 | ":superstructure_position_fbs", |
| 107 | ":superstructure_status_fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 108 | "//aos:math", |
| 109 | "//aos/controls:control_loop", |
| 110 | "//aos/util:trapezoid_profile", |
| 111 | "//frc971/control_loops:profiled_subsystem", |
| 112 | "//frc971/control_loops:simple_capped_state_feedback_loop", |
| 113 | "//frc971/control_loops:state_feedback_loop", |
| 114 | "//frc971/zeroing", |
| 115 | "//y2016:constants", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 116 | "//y2016/queues:ball_detector_fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 117 | ], |
Comran Morshed | 25f81a0 | 2016-01-23 13:40:10 +0000 | [diff] [blame] | 118 | ) |
| 119 | |
| 120 | cc_test( |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 121 | name = "superstructure_lib_test", |
| 122 | srcs = [ |
| 123 | "superstructure_lib_test.cc", |
| 124 | ], |
Austin Schuh | 14d7d3d | 2020-09-10 18:14:36 -0700 | [diff] [blame^] | 125 | data = ["//y2016:config"], |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 126 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 127 | ":superstructure_goal_fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 128 | ":superstructure_lib", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 129 | ":superstructure_output_fbs", |
| 130 | ":superstructure_position_fbs", |
| 131 | ":superstructure_status_fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 132 | "//aos:math", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 133 | "//aos/controls:control_loop_test", |
| 134 | "//aos/testing:googletest", |
| 135 | "//aos/time", |
| 136 | "//frc971/control_loops:position_sensor_sim", |
| 137 | "//frc971/control_loops:team_number_test_environment", |
| 138 | ], |
Comran Morshed | 25f81a0 | 2016-01-23 13:40:10 +0000 | [diff] [blame] | 139 | ) |
| 140 | |
| 141 | cc_binary( |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 142 | name = "superstructure", |
| 143 | srcs = [ |
| 144 | "superstructure_main.cc", |
| 145 | ], |
| 146 | deps = [ |
| 147 | ":superstructure_lib", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 148 | "//aos:init", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 149 | "//aos/events:shm_event_loop", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 150 | ], |
Comran Morshed | 25f81a0 | 2016-01-23 13:40:10 +0000 | [diff] [blame] | 151 | ) |