James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 1 | load("//aos/flatbuffers:generate.bzl", "static_flatbuffer") |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 2 | |
Philipp Schrader | cc016b3 | 2021-12-30 08:59:58 -0800 | [diff] [blame] | 3 | package(default_visibility = ["//visibility:public"]) |
| 4 | |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 5 | static_flatbuffer( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 6 | name = "claw_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 | "claw_goal.fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 9 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 10 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 11 | ) |
| 12 | |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 13 | static_flatbuffer( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 14 | name = "claw_position_fbs", |
| 15 | srcs = [ |
| 16 | "claw_position.fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 17 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 18 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 19 | deps = [ |
| 20 | "//frc971/control_loops:control_loops_fbs", |
| 21 | ], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 22 | ) |
| 23 | |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 24 | static_flatbuffer( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 25 | name = "claw_output_fbs", |
| 26 | srcs = [ |
| 27 | "claw_output.fbs", |
| 28 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 29 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 30 | ) |
| 31 | |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 32 | static_flatbuffer( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 33 | name = "claw_status_fbs", |
| 34 | srcs = [ |
| 35 | "claw_status.fbs", |
| 36 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 37 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 38 | ) |
| 39 | |
Austin Schuh | edc317c | 2015-11-08 14:07:42 -0800 | [diff] [blame] | 40 | genrule( |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 41 | name = "genrule_claw", |
| 42 | outs = [ |
| 43 | "claw_motor_plant.h", |
| 44 | "claw_motor_plant.cc", |
| 45 | ], |
| 46 | cmd = "$(location //y2014/control_loops/python:claw) $(OUTS)", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 47 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 48 | tools = [ |
| 49 | "//y2014/control_loops/python:claw", |
| 50 | ], |
| 51 | visibility = ["//visibility:private"], |
Austin Schuh | edc317c | 2015-11-08 14:07:42 -0800 | [diff] [blame] | 52 | ) |
| 53 | |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 54 | cc_library( |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 55 | name = "claw_lib", |
| 56 | srcs = [ |
| 57 | "claw.cc", |
| 58 | "claw_motor_plant.cc", |
| 59 | ], |
| 60 | hdrs = [ |
| 61 | "claw.h", |
| 62 | "claw_motor_plant.h", |
| 63 | ], |
| 64 | linkopts = [ |
| 65 | "-lm", |
| 66 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 67 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 68 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 69 | ":claw_goal_fbs", |
| 70 | ":claw_output_fbs", |
| 71 | ":claw_position_fbs", |
| 72 | ":claw_status_fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 73 | "//aos:math", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 74 | "//frc971/control_loops:coerce_goal", |
Austin Schuh | 0a3c9d4 | 2021-07-15 22:36:24 -0700 | [diff] [blame] | 75 | "//frc971/control_loops:control_loop", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 76 | "//frc971/control_loops:hall_effect_tracker", |
Austin Schuh | 0a3c9d4 | 2021-07-15 22:36:24 -0700 | [diff] [blame] | 77 | "//frc971/control_loops:polytope", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 78 | "//frc971/control_loops:state_feedback_loop", |
| 79 | "//y2014:constants", |
| 80 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 81 | ) |
| 82 | |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 83 | cc_test( |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 84 | name = "claw_lib_test", |
| 85 | srcs = [ |
| 86 | "claw_lib_test.cc", |
| 87 | ], |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 88 | data = ["//y2014:aos_config"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 89 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 90 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 91 | ":claw_goal_fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 92 | ":claw_lib", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 93 | ":claw_output_fbs", |
| 94 | ":claw_position_fbs", |
| 95 | ":claw_status_fbs", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 96 | "//aos/testing:googletest", |
Austin Schuh | 0a3c9d4 | 2021-07-15 22:36:24 -0700 | [diff] [blame] | 97 | "//frc971/control_loops:control_loop_test", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 98 | "//frc971/control_loops:state_feedback_loop", |
| 99 | "//frc971/control_loops:team_number_test_environment", |
| 100 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 101 | ) |
| 102 | |
| 103 | cc_binary( |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 104 | name = "claw", |
| 105 | srcs = [ |
| 106 | "claw_main.cc", |
| 107 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 108 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 109 | deps = [ |
| 110 | ":claw_lib", |
| 111 | "//aos:init", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 112 | "//aos/events:shm_event_loop", |
Austin Schuh | 55a13dc | 2019-01-27 22:39:03 -0800 | [diff] [blame] | 113 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 114 | ) |