Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 1 | package(default_visibility = ['//visibility:public']) |
| 2 | |
Austin Schuh | 4f85729 | 2018-02-15 23:42:04 -0800 | [diff] [blame^] | 3 | load('//aos/build:queues.bzl', 'queue_library') |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 4 | |
| 5 | cc_binary( |
| 6 | name = 'replay_drivetrain', |
| 7 | srcs = [ |
| 8 | 'replay_drivetrain.cc', |
| 9 | ], |
| 10 | deps = [ |
| 11 | ':drivetrain_queue', |
| 12 | '//aos/common/controls:replay_control_loop', |
| 13 | '//aos/linux_code:init', |
| 14 | '//frc971/queues:gyro', |
| 15 | ], |
| 16 | ) |
| 17 | |
| 18 | queue_library( |
| 19 | name = 'drivetrain_queue', |
| 20 | srcs = [ |
| 21 | 'drivetrain.q', |
| 22 | ], |
| 23 | deps = [ |
| 24 | '//aos/common/controls:control_loop_queues', |
Austin Schuh | edbb64f | 2016-03-19 01:18:09 -0700 | [diff] [blame] | 25 | '//frc971/control_loops:queues', |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 26 | ], |
| 27 | ) |
| 28 | |
| 29 | cc_library( |
| 30 | name = 'drivetrain_config', |
| 31 | hdrs = [ |
| 32 | 'drivetrain_config.h', |
| 33 | ], |
| 34 | deps = [ |
| 35 | '//frc971/control_loops:state_feedback_loop', |
| 36 | '//frc971:shifter_hall_effect', |
| 37 | ], |
| 38 | ) |
| 39 | |
| 40 | cc_library( |
Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 41 | name = 'gear', |
| 42 | hdrs = [ |
| 43 | 'gear.h', |
| 44 | ], |
| 45 | ) |
| 46 | |
| 47 | cc_library( |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 48 | name = 'ssdrivetrain', |
| 49 | srcs = [ |
| 50 | 'ssdrivetrain.cc', |
| 51 | ], |
| 52 | hdrs = [ |
| 53 | 'ssdrivetrain.h', |
| 54 | ], |
| 55 | deps = [ |
| 56 | ':drivetrain_queue', |
| 57 | ':drivetrain_config', |
Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 58 | ':gear', |
| 59 | '//aos/common/controls:control_loop', |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 60 | '//aos/common/controls:polytope', |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 61 | '//aos/common/logging:matrix_logging', |
Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 62 | '//aos/common/logging:queue_logging', |
| 63 | '//aos/common/messages:robot_state', |
| 64 | '//aos/common/util:log_interval', |
| 65 | '//aos/common/util:trapezoid_profile', |
| 66 | '//aos/common:math', |
| 67 | '//frc971/control_loops:coerce_goal', |
| 68 | '//frc971/control_loops:state_feedback_loop', |
| 69 | '//frc971:shifter_hall_effect', |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 70 | ], |
| 71 | ) |
| 72 | |
| 73 | cc_library( |
| 74 | name = 'polydrivetrain', |
| 75 | srcs = [ |
| 76 | 'polydrivetrain.cc', |
| 77 | ], |
| 78 | hdrs = [ |
| 79 | 'polydrivetrain.h', |
| 80 | ], |
| 81 | deps = [ |
| 82 | ':drivetrain_queue', |
| 83 | ':drivetrain_config', |
Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 84 | ':gear', |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 85 | '//aos/common/controls:polytope', |
| 86 | '//aos/common:math', |
| 87 | '//aos/common/messages:robot_state', |
| 88 | '//frc971/control_loops:state_feedback_loop', |
| 89 | '//frc971/control_loops:coerce_goal', |
| 90 | '//aos/common/util:log_interval', |
| 91 | '//aos/common/logging:queue_logging', |
| 92 | '//aos/common/logging:matrix_logging', |
| 93 | ], |
| 94 | ) |
| 95 | |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 96 | genrule( |
| 97 | name = 'genrule_down_estimator', |
| 98 | visibility = ['//visibility:private'], |
| 99 | cmd = '$(location //frc971/control_loops/python:down_estimator) $(OUTS)', |
| 100 | tools = [ |
| 101 | '//frc971/control_loops/python:down_estimator', |
| 102 | ], |
| 103 | outs = [ |
| 104 | 'down_estimator.h', |
| 105 | 'down_estimator.cc', |
| 106 | ], |
| 107 | ) |
| 108 | |
| 109 | cc_library( |
| 110 | name = 'down_estimator', |
| 111 | hdrs = [ |
| 112 | 'down_estimator.h', |
| 113 | ], |
| 114 | srcs = [ |
| 115 | 'down_estimator.cc', |
| 116 | ], |
| 117 | deps = [ |
| 118 | '//frc971/control_loops:state_feedback_loop', |
| 119 | ], |
| 120 | ) |
| 121 | |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 122 | cc_library( |
| 123 | name = 'drivetrain_lib', |
| 124 | srcs = [ |
| 125 | 'drivetrain.cc', |
| 126 | ], |
| 127 | hdrs = [ |
| 128 | 'drivetrain.h', |
| 129 | ], |
| 130 | deps = [ |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 131 | ':down_estimator', |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 132 | ':drivetrain_queue', |
Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 133 | ':gear', |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 134 | ':polydrivetrain', |
| 135 | ':ssdrivetrain', |
| 136 | '//aos/common/controls:control_loop', |
| 137 | '//frc971/queues:gyro', |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 138 | '//frc971/wpilib:imu_queue', |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 139 | '//aos/common/util:log_interval', |
| 140 | '//aos/common/logging:queue_logging', |
| 141 | '//aos/common/logging:matrix_logging', |
| 142 | ], |
| 143 | ) |
| 144 | |
| 145 | cc_test( |
| 146 | name = 'drivetrain_lib_test', |
| 147 | srcs = [ |
| 148 | 'drivetrain_lib_test.cc', |
| 149 | ], |
| 150 | deps = [ |
| 151 | '//aos/testing:googletest', |
| 152 | ':drivetrain_queue', |
| 153 | ':drivetrain_lib', |
| 154 | ':drivetrain_config', |
| 155 | '//aos/common/controls:control_loop_test', |
| 156 | '//frc971/control_loops:state_feedback_loop', |
| 157 | '//frc971/queues:gyro', |
| 158 | '//aos/common:queues', |
Comran Morshed | baf5784 | 2016-02-17 20:58:53 +0000 | [diff] [blame] | 159 | '//y2016:constants', |
| 160 | '//y2016/control_loops/drivetrain:polydrivetrain_plants', |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 161 | ], |
| 162 | ) |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 163 | |
| 164 | genrule( |
| 165 | name = 'genrule_haptic_wheel', |
| 166 | visibility = ['//visibility:private'], |
| 167 | cmd = '$(location //frc971/control_loops/python:haptic_wheel) $(OUTS)', |
| 168 | tools = [ |
| 169 | '//frc971/control_loops/python:haptic_wheel', |
| 170 | ], |
| 171 | outs = [ |
| 172 | 'haptic_wheel.h', |
| 173 | 'haptic_wheel.cc', |
| 174 | 'integral_haptic_wheel.h', |
| 175 | 'integral_haptic_wheel.cc', |
| 176 | 'haptic_trigger.h', |
| 177 | 'haptic_trigger.cc', |
| 178 | 'integral_haptic_trigger.h', |
| 179 | 'integral_haptic_trigger.cc', |
| 180 | ], |
| 181 | restricted_to = ["//tools:k8", "//tools:roborio", "//tools:armhf-debian", "//tools:cortex-m4f"], |
| 182 | ) |
| 183 | |
| 184 | cc_library( |
| 185 | name = 'haptic_input_uc', |
| 186 | hdrs = [ |
| 187 | 'haptic_wheel.h', |
| 188 | 'integral_haptic_wheel.h', |
| 189 | 'haptic_trigger.h', |
| 190 | 'integral_haptic_trigger.h', |
| 191 | ], |
| 192 | srcs = [ |
| 193 | 'haptic_wheel.cc', |
| 194 | 'integral_haptic_wheel.cc', |
| 195 | 'haptic_trigger.cc', |
| 196 | 'integral_haptic_trigger.cc', |
| 197 | ], |
| 198 | deps = [ |
| 199 | '//frc971/control_loops:state_feedback_loop_uc', |
| 200 | ], |
| 201 | restricted_to = ["//tools:cortex-m4f"], |
| 202 | ) |
| 203 | |
| 204 | cc_library( |
| 205 | name = 'haptic_wheel', |
| 206 | hdrs = [ |
| 207 | 'haptic_wheel.h', |
| 208 | 'integral_haptic_wheel.h', |
| 209 | 'haptic_trigger.h', |
| 210 | 'integral_haptic_trigger.h', |
| 211 | ], |
| 212 | srcs = [ |
| 213 | 'haptic_wheel.cc', |
| 214 | 'integral_haptic_wheel.cc', |
| 215 | 'haptic_trigger.cc', |
| 216 | 'integral_haptic_trigger.cc', |
| 217 | ], |
| 218 | deps = [ |
| 219 | '//frc971/control_loops:state_feedback_loop', |
| 220 | ], |
| 221 | ) |