James Kuszmaul | d12497a | 2024-01-14 18:00:34 -0800 | [diff] [blame] | 1 | load("//aos/flatbuffers:generate.bzl", "static_flatbuffer") |
| 2 | |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 3 | package(default_visibility = ["//visibility:public"]) |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 4 | |
James Kuszmaul | d12497a | 2024-01-14 18:00:34 -0800 | [diff] [blame] | 5 | static_flatbuffer( |
| 6 | name = "constants_fbs", |
| 7 | srcs = ["constants.fbs"], |
| 8 | ) |
| 9 | |
Philipp Schrader | 29d54f2 | 2016-04-02 22:14:48 +0000 | [diff] [blame] | 10 | cc_library( |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 11 | name = "averager", |
| 12 | hdrs = [ |
| 13 | "averager.h", |
| 14 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 15 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | d3f9eb2 | 2020-01-12 15:02:07 -0800 | [diff] [blame] | 16 | deps = [ |
| 17 | "@com_github_google_glog//:glog", |
| 18 | "@org_tuxfamily_eigen//:eigen", |
| 19 | ], |
Philipp Schrader | 29d54f2 | 2016-04-02 22:14:48 +0000 | [diff] [blame] | 20 | ) |
| 21 | |
| 22 | cc_test( |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 23 | name = "averager_test", |
| 24 | srcs = [ |
| 25 | "averager_test.cc", |
| 26 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 27 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 28 | deps = [ |
| 29 | ":averager", |
| 30 | "//aos/testing:googletest", |
James Kuszmaul | d3f9eb2 | 2020-01-12 15:02:07 -0800 | [diff] [blame] | 31 | "@org_tuxfamily_eigen//:eigen", |
| 32 | ], |
| 33 | ) |
| 34 | |
| 35 | cc_library( |
| 36 | name = "imu_zeroer", |
| 37 | srcs = [ |
| 38 | "imu_zeroer.cc", |
| 39 | ], |
| 40 | hdrs = [ |
| 41 | "imu_zeroer.h", |
| 42 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 43 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | d3f9eb2 | 2020-01-12 15:02:07 -0800 | [diff] [blame] | 44 | deps = [ |
| 45 | ":averager", |
James Kuszmaul | b1e2937 | 2020-02-11 16:55:36 -0800 | [diff] [blame] | 46 | "//frc971/control_loops:control_loops_fbs", |
| 47 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
James Kuszmaul | d3f9eb2 | 2020-01-12 15:02:07 -0800 | [diff] [blame] | 48 | "//frc971/wpilib:imu_fbs", |
| 49 | "@com_github_google_glog//:glog", |
| 50 | "@org_tuxfamily_eigen//:eigen", |
| 51 | ], |
| 52 | ) |
| 53 | |
| 54 | cc_test( |
| 55 | name = "imu_zeroer_test", |
| 56 | srcs = [ |
| 57 | "imu_zeroer_test.cc", |
| 58 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 59 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | d3f9eb2 | 2020-01-12 15:02:07 -0800 | [diff] [blame] | 60 | deps = [ |
| 61 | ":imu_zeroer", |
| 62 | "//aos:flatbuffers", |
| 63 | "//aos/testing:googletest", |
| 64 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 65 | ], |
Philipp Schrader | 29d54f2 | 2016-04-02 22:14:48 +0000 | [diff] [blame] | 66 | ) |
| 67 | |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 68 | cc_library( |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 69 | name = "zeroing", |
| 70 | srcs = [ |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 71 | ], |
| 72 | hdrs = [ |
| 73 | "zeroing.h", |
| 74 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 75 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 76 | deps = [ |
| 77 | ":wrap", |
Ravago Jones | 726deb0 | 2021-05-29 14:36:43 -0700 | [diff] [blame] | 78 | "//aos/containers:error_list", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 79 | "//aos/logging", |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 80 | "//frc971:constants", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 81 | "//frc971/control_loops:control_loops_fbs", |
| 82 | "@com_github_google_glog//:glog", |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 83 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 84 | ) |
| 85 | |
James Kuszmaul | ec635d2 | 2023-08-12 18:39:24 -0700 | [diff] [blame] | 86 | cc_library( |
| 87 | name = "zeroing_test_lib", |
| 88 | testonly = True, |
| 89 | hdrs = ["zeroing_test.h"], |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 90 | deps = [ |
| 91 | ":zeroing", |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 92 | "//aos/testing:googletest", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 93 | "//frc971/control_loops:control_loops_fbs", |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 94 | "//frc971/control_loops:position_sensor_sim", |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 95 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 96 | ) |
Austin Schuh | c6423e6 | 2017-02-11 16:56:30 -0800 | [diff] [blame] | 97 | |
James Kuszmaul | ec635d2 | 2023-08-12 18:39:24 -0700 | [diff] [blame] | 98 | [ |
| 99 | ( |
| 100 | cc_library( |
| 101 | name = lib, |
| 102 | srcs = [lib + ".cc"], |
| 103 | hdrs = [lib + ".h"], |
| 104 | deps = [ |
| 105 | ":wrap", |
| 106 | ":zeroing", |
| 107 | "//aos/containers:error_list", |
| 108 | "//aos/logging", |
| 109 | "//frc971:constants", |
| 110 | "//frc971/control_loops:control_loops_fbs", |
| 111 | "@com_github_google_glog//:glog", |
| 112 | ], |
| 113 | ), |
| 114 | cc_test( |
| 115 | name = lib + "_test", |
| 116 | srcs = [lib + "_test.cc"], |
| 117 | deps = [ |
| 118 | lib, |
| 119 | ":zeroing", |
| 120 | ":zeroing_test_lib", |
| 121 | "//aos/testing:googletest", |
| 122 | "//frc971/control_loops:control_loops_fbs", |
| 123 | "//frc971/control_loops:position_sensor_sim", |
| 124 | ], |
| 125 | ), |
| 126 | ) |
| 127 | for lib in [ |
| 128 | "absolute_and_absolute_encoder", |
| 129 | "absolute_encoder", |
| 130 | "continuous_absolute_encoder", |
| 131 | "hall_effect_and_position", |
| 132 | "pot_and_absolute_encoder", |
| 133 | "pot_and_index", |
| 134 | "pulse_index", |
| 135 | ] |
| 136 | ] |
| 137 | |
Austin Schuh | c6423e6 | 2017-02-11 16:56:30 -0800 | [diff] [blame] | 138 | cc_library( |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 139 | name = "wrap", |
| 140 | srcs = [ |
| 141 | "wrap.cc", |
| 142 | ], |
| 143 | hdrs = [ |
| 144 | "wrap.h", |
| 145 | ], |
Austin Schuh | c6423e6 | 2017-02-11 16:56:30 -0800 | [diff] [blame] | 146 | ) |
| 147 | |
| 148 | cc_test( |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 149 | name = "wrap_test", |
| 150 | srcs = [ |
| 151 | "wrap_test.cc", |
| 152 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 153 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 4fae0fc | 2018-03-27 23:51:42 -0700 | [diff] [blame] | 154 | deps = [ |
| 155 | ":wrap", |
| 156 | "//aos/testing:googletest", |
| 157 | ], |
Austin Schuh | c6423e6 | 2017-02-11 16:56:30 -0800 | [diff] [blame] | 158 | ) |
Stephan Massalt | 4d1e74f | 2020-01-11 17:50:39 -0800 | [diff] [blame] | 159 | |
| 160 | cc_test( |
| 161 | name = "unwrap_test", |
| 162 | srcs = [ |
| 163 | "unwrap_test.cc", |
| 164 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 165 | target_compatible_with = ["@platforms//os:linux"], |
Stephan Massalt | 4d1e74f | 2020-01-11 17:50:39 -0800 | [diff] [blame] | 166 | deps = [ |
| 167 | ":wrap", |
| 168 | "//aos/testing:googletest", |
| 169 | ], |
| 170 | ) |