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', |
| 14 | ], |
| 15 | ) |
| 16 | |
| 17 | queue_library( |
| 18 | name = 'drivetrain_queue', |
| 19 | srcs = [ |
| 20 | 'drivetrain.q', |
| 21 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 22 | deps = [ |
| 23 | '//aos/common/controls:control_loop_queues', |
| 24 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 25 | ) |
| 26 | |
Austin Schuh | 572ff40 | 2015-11-08 12:17:50 -0800 | [diff] [blame] | 27 | genrule( |
| 28 | name = 'genrule_drivetrain', |
| 29 | visibility = ['//visibility:private'], |
| 30 | cmd = '$(location //y2014/control_loops/python:drivetrain) $(OUTS)', |
| 31 | tools = [ |
| 32 | '//y2014/control_loops/python:drivetrain', |
| 33 | ], |
| 34 | tags = [ |
| 35 | 'local', |
| 36 | ], |
| 37 | outs = [ |
| 38 | 'drivetrain_dog_motor_plant.h', |
| 39 | 'drivetrain_dog_motor_plant.cc', |
| 40 | 'kalman_drivetrain_motor_plant.h', |
| 41 | 'kalman_drivetrain_motor_plant.cc', |
| 42 | ], |
| 43 | ) |
| 44 | |
Austin Schuh | 0e99773 | 2015-11-08 15:14:53 -0800 | [diff] [blame^] | 45 | genrule( |
| 46 | name = 'genrule_polydrivetrain', |
| 47 | visibility = ['//visibility:private'], |
| 48 | cmd = '$(location //y2014/control_loops/python:polydrivetrain) $(OUTS)', |
| 49 | tools = [ |
| 50 | '//y2014/control_loops/python:polydrivetrain', |
| 51 | ], |
| 52 | tags = [ |
| 53 | 'local', |
| 54 | ], |
| 55 | outs = [ |
| 56 | 'polydrivetrain_dog_motor_plant.h', |
| 57 | 'polydrivetrain_dog_motor_plant.cc', |
| 58 | 'polydrivetrain_cim_plant.h', |
| 59 | 'polydrivetrain_cim_plant.cc', |
| 60 | ], |
| 61 | ) |
| 62 | |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 63 | cc_library( |
| 64 | name = 'polydrivetrain_plants', |
| 65 | srcs = [ |
| 66 | 'polydrivetrain_dog_motor_plant.cc', |
| 67 | 'drivetrain_dog_motor_plant.cc', |
Austin Schuh | 572ff40 | 2015-11-08 12:17:50 -0800 | [diff] [blame] | 68 | 'kalman_drivetrain_motor_plant.cc', |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 69 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 70 | hdrs = [ |
| 71 | 'polydrivetrain_dog_motor_plant.h', |
| 72 | 'drivetrain_dog_motor_plant.h', |
Austin Schuh | 572ff40 | 2015-11-08 12:17:50 -0800 | [diff] [blame] | 73 | 'kalman_drivetrain_motor_plant.h', |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 74 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 75 | deps = [ |
| 76 | '//frc971/control_loops:state_feedback_loop', |
| 77 | ], |
| 78 | ) |
| 79 | |
| 80 | cc_library( |
| 81 | name = 'drivetrain_lib', |
| 82 | srcs = [ |
| 83 | 'drivetrain.cc', |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 84 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 85 | hdrs = [ |
| 86 | 'drivetrain.h', |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 87 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 88 | deps = [ |
| 89 | ':drivetrain_queue', |
| 90 | '//aos/common/controls:control_loop', |
| 91 | '//y2014:constants', |
| 92 | '//aos/common/controls:polytope', |
Austin Schuh | 044e18b | 2015-10-21 20:17:09 -0700 | [diff] [blame] | 93 | '//aos/common:math', |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 94 | '//frc971/control_loops:state_feedback_loop', |
| 95 | '//frc971/control_loops:coerce_goal', |
| 96 | '//frc971/queues:gyro', |
| 97 | '//aos/common/util:log_interval', |
| 98 | '//aos/common/logging:queue_logging', |
| 99 | '//aos/common/logging:matrix_logging', |
| 100 | ], |
| 101 | ) |
| 102 | |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 103 | cc_test( |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 104 | name = 'drivetrain_lib_test', |
| 105 | srcs = [ |
| 106 | 'drivetrain_lib_test.cc', |
| 107 | ], |
| 108 | deps = [ |
Brian Silverman | 258b917 | 2015-09-19 14:32:57 -0400 | [diff] [blame] | 109 | '//aos/testing:googletest', |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 110 | ':drivetrain_queue', |
| 111 | ':drivetrain_lib', |
| 112 | '//aos/common/controls:control_loop_test', |
| 113 | '//frc971/control_loops:state_feedback_loop', |
| 114 | '//frc971/queues:gyro', |
| 115 | '//aos/common:queues', |
| 116 | ], |
| 117 | ) |
| 118 | |
| 119 | cc_binary( |
| 120 | name = 'drivetrain', |
| 121 | srcs = [ |
| 122 | 'drivetrain_main.cc', |
| 123 | ], |
| 124 | deps = [ |
| 125 | '//aos/linux_code:init', |
| 126 | ':drivetrain_lib', |
| 127 | ':drivetrain_queue', |
| 128 | ], |
| 129 | ) |