Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 1 | package(default_visibility = ['//visibility:public']) |
| 2 | |
Austin Schuh | f073651 | 2015-09-07 01:22:16 -0700 | [diff] [blame] | 3 | load('/aos/build/queues', 'queue_library') |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [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', |
Austin Schuh | d0e02df | 2015-11-26 12:48:51 -0800 | [diff] [blame] | 14 | '//frc971/queues:gyro', |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 15 | ], |
| 16 | ) |
| 17 | |
| 18 | queue_library( |
| 19 | name = 'drivetrain_queue', |
| 20 | srcs = [ |
| 21 | 'drivetrain.q', |
| 22 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 23 | deps = [ |
| 24 | '//aos/common/controls:control_loop_queues', |
| 25 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 26 | ) |
| 27 | |
Austin Schuh | 572ff40 | 2015-11-08 12:17:50 -0800 | [diff] [blame] | 28 | genrule( |
| 29 | name = 'genrule_drivetrain', |
| 30 | visibility = ['//visibility:private'], |
| 31 | cmd = '$(location //y2014/control_loops/python:drivetrain) $(OUTS)', |
| 32 | tools = [ |
| 33 | '//y2014/control_loops/python:drivetrain', |
| 34 | ], |
Austin Schuh | 572ff40 | 2015-11-08 12:17:50 -0800 | [diff] [blame] | 35 | outs = [ |
| 36 | 'drivetrain_dog_motor_plant.h', |
| 37 | 'drivetrain_dog_motor_plant.cc', |
| 38 | 'kalman_drivetrain_motor_plant.h', |
| 39 | 'kalman_drivetrain_motor_plant.cc', |
| 40 | ], |
| 41 | ) |
| 42 | |
Austin Schuh | 0e99773 | 2015-11-08 15:14:53 -0800 | [diff] [blame] | 43 | genrule( |
| 44 | name = 'genrule_polydrivetrain', |
| 45 | visibility = ['//visibility:private'], |
| 46 | cmd = '$(location //y2014/control_loops/python:polydrivetrain) $(OUTS)', |
| 47 | tools = [ |
| 48 | '//y2014/control_loops/python:polydrivetrain', |
| 49 | ], |
Austin Schuh | 0e99773 | 2015-11-08 15:14:53 -0800 | [diff] [blame] | 50 | outs = [ |
| 51 | 'polydrivetrain_dog_motor_plant.h', |
| 52 | 'polydrivetrain_dog_motor_plant.cc', |
| 53 | 'polydrivetrain_cim_plant.h', |
| 54 | 'polydrivetrain_cim_plant.cc', |
| 55 | ], |
| 56 | ) |
| 57 | |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 58 | cc_library( |
| 59 | name = 'polydrivetrain_plants', |
| 60 | srcs = [ |
| 61 | 'polydrivetrain_dog_motor_plant.cc', |
| 62 | 'drivetrain_dog_motor_plant.cc', |
Austin Schuh | 572ff40 | 2015-11-08 12:17:50 -0800 | [diff] [blame] | 63 | 'kalman_drivetrain_motor_plant.cc', |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 64 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 65 | hdrs = [ |
| 66 | 'polydrivetrain_dog_motor_plant.h', |
| 67 | 'drivetrain_dog_motor_plant.h', |
Austin Schuh | 572ff40 | 2015-11-08 12:17:50 -0800 | [diff] [blame] | 68 | 'kalman_drivetrain_motor_plant.h', |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 69 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 70 | deps = [ |
| 71 | '//frc971/control_loops:state_feedback_loop', |
| 72 | ], |
| 73 | ) |
| 74 | |
| 75 | cc_library( |
Austin Schuh | 64ebab2 | 2015-11-26 13:28:30 -0800 | [diff] [blame] | 76 | name = 'ssdrivetrain', |
| 77 | srcs = [ |
| 78 | 'ssdrivetrain.cc', |
| 79 | ], |
| 80 | hdrs = [ |
| 81 | 'ssdrivetrain.h', |
| 82 | ], |
| 83 | deps = [ |
| 84 | ':drivetrain_queue', |
| 85 | '//y2014:constants', |
| 86 | '//aos/common/controls:polytope', |
| 87 | '//aos/common:math', |
| 88 | '//aos/common/messages:robot_state', |
| 89 | '//frc971/control_loops:state_feedback_loop', |
| 90 | '//frc971/control_loops:coerce_goal', |
| 91 | '//aos/common/util:log_interval', |
| 92 | '//aos/common/logging:queue_logging', |
| 93 | '//aos/common/logging:matrix_logging', |
| 94 | ], |
| 95 | ) |
| 96 | |
| 97 | cc_library( |
Austin Schuh | 96ce8ae | 2015-11-26 12:46:02 -0800 | [diff] [blame] | 98 | name = 'polydrivetrain', |
| 99 | srcs = [ |
| 100 | 'polydrivetrain.cc', |
| 101 | ], |
| 102 | hdrs = [ |
| 103 | 'polydrivetrain.h', |
| 104 | ], |
| 105 | deps = [ |
| 106 | ':drivetrain_queue', |
| 107 | '//y2014:constants', |
| 108 | '//aos/common/controls:polytope', |
| 109 | '//aos/common:math', |
| 110 | '//aos/common/messages:robot_state', |
| 111 | '//frc971/control_loops:state_feedback_loop', |
| 112 | '//frc971/control_loops:coerce_goal', |
| 113 | '//aos/common/util:log_interval', |
| 114 | '//aos/common/logging:queue_logging', |
| 115 | '//aos/common/logging:matrix_logging', |
| 116 | ], |
| 117 | ) |
| 118 | |
| 119 | cc_library( |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 120 | name = 'drivetrain_lib', |
| 121 | srcs = [ |
| 122 | 'drivetrain.cc', |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 123 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 124 | hdrs = [ |
| 125 | 'drivetrain.h', |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 126 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 127 | deps = [ |
| 128 | ':drivetrain_queue', |
Austin Schuh | 96ce8ae | 2015-11-26 12:46:02 -0800 | [diff] [blame] | 129 | ':polydrivetrain', |
Austin Schuh | 64ebab2 | 2015-11-26 13:28:30 -0800 | [diff] [blame] | 130 | ':ssdrivetrain', |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 131 | '//aos/common/controls:control_loop', |
| 132 | '//y2014:constants', |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 133 | '//frc971/queues:gyro', |
| 134 | '//aos/common/util:log_interval', |
| 135 | '//aos/common/logging:queue_logging', |
| 136 | '//aos/common/logging:matrix_logging', |
| 137 | ], |
| 138 | ) |
| 139 | |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 140 | cc_test( |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 141 | name = 'drivetrain_lib_test', |
| 142 | srcs = [ |
| 143 | 'drivetrain_lib_test.cc', |
| 144 | ], |
| 145 | deps = [ |
Brian Silverman | 258b917 | 2015-09-19 14:32:57 -0400 | [diff] [blame] | 146 | '//aos/testing:googletest', |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 147 | ':drivetrain_queue', |
| 148 | ':drivetrain_lib', |
| 149 | '//aos/common/controls:control_loop_test', |
| 150 | '//frc971/control_loops:state_feedback_loop', |
| 151 | '//frc971/queues:gyro', |
| 152 | '//aos/common:queues', |
| 153 | ], |
| 154 | ) |
| 155 | |
| 156 | cc_binary( |
| 157 | name = 'drivetrain', |
| 158 | srcs = [ |
| 159 | 'drivetrain_main.cc', |
| 160 | ], |
| 161 | deps = [ |
| 162 | '//aos/linux_code:init', |
| 163 | ':drivetrain_lib', |
| 164 | ':drivetrain_queue', |
| 165 | ], |
| 166 | ) |