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