Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 1 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_ts_library") |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 2 | load("@npm//@bazel/typescript:index.bzl", "ts_library") |
| 3 | |
| 4 | package(default_visibility = ["//visibility:public"]) |
| 5 | |
| 6 | flatbuffer_cc_library( |
| 7 | name = "superstructure_goal_fbs", |
| 8 | srcs = [ |
| 9 | "superstructure_goal.fbs", |
| 10 | ], |
| 11 | gen_reflections = 1, |
| 12 | includes = [ |
| 13 | "//frc971/control_loops:control_loops_fbs_includes", |
| 14 | "//frc971/control_loops:profiled_subsystem_fbs_includes", |
| 15 | ], |
| 16 | ) |
| 17 | |
| 18 | flatbuffer_cc_library( |
| 19 | name = "superstructure_output_fbs", |
| 20 | srcs = [ |
| 21 | "superstructure_output.fbs", |
| 22 | ], |
| 23 | gen_reflections = 1, |
| 24 | ) |
| 25 | |
| 26 | flatbuffer_cc_library( |
| 27 | name = "superstructure_status_fbs", |
| 28 | srcs = [ |
| 29 | "superstructure_status.fbs", |
| 30 | ], |
| 31 | gen_reflections = 1, |
| 32 | includes = [ |
| 33 | "//frc971/control_loops:control_loops_fbs_includes", |
| 34 | "//frc971/control_loops:profiled_subsystem_fbs_includes", |
| 35 | ], |
| 36 | ) |
| 37 | |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 38 | flatbuffer_ts_library( |
| 39 | name = "superstructure_status_ts_fbs", |
| 40 | srcs = [ |
| 41 | "superstructure_status.fbs", |
| 42 | ], |
| 43 | includes = [ |
| 44 | "//frc971/control_loops:control_loops_fbs_includes", |
| 45 | "//frc971/control_loops:profiled_subsystem_fbs_includes", |
| 46 | ], |
| 47 | target_compatible_with = ["@platforms//os:linux"], |
| 48 | ) |
| 49 | |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 50 | flatbuffer_cc_library( |
| 51 | name = "superstructure_position_fbs", |
| 52 | srcs = [ |
| 53 | "superstructure_position.fbs", |
| 54 | ], |
| 55 | gen_reflections = 1, |
| 56 | includes = [ |
| 57 | "//frc971/control_loops:control_loops_fbs_includes", |
| 58 | "//frc971/control_loops:profiled_subsystem_fbs_includes", |
| 59 | ], |
| 60 | ) |
| 61 | |
| 62 | cc_library( |
| 63 | name = "superstructure_lib", |
| 64 | srcs = [ |
| 65 | "superstructure.cc", |
| 66 | ], |
| 67 | hdrs = [ |
| 68 | "superstructure.h", |
| 69 | ], |
| 70 | deps = [ |
| 71 | ":superstructure_goal_fbs", |
| 72 | ":superstructure_output_fbs", |
| 73 | ":superstructure_position_fbs", |
| 74 | ":superstructure_status_fbs", |
| 75 | "//aos/events:event_loop", |
| 76 | "//frc971/control_loops:control_loop", |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 77 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 78 | "//y2022:constants", |
| 79 | ], |
| 80 | ) |
| 81 | |
| 82 | cc_binary( |
| 83 | name = "superstructure", |
| 84 | srcs = [ |
| 85 | "superstructure_main.cc", |
| 86 | ], |
| 87 | deps = [ |
| 88 | ":superstructure_lib", |
| 89 | "//aos:init", |
| 90 | "//aos/events:shm_event_loop", |
| 91 | ], |
| 92 | ) |
| 93 | |
| 94 | cc_test( |
| 95 | name = "superstructure_lib_test", |
| 96 | srcs = [ |
| 97 | "superstructure_lib_test.cc", |
| 98 | ], |
| 99 | data = [ |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame^] | 100 | "//y2022:aos_config", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 101 | ], |
| 102 | deps = [ |
| 103 | ":superstructure_goal_fbs", |
| 104 | ":superstructure_lib", |
| 105 | ":superstructure_output_fbs", |
| 106 | ":superstructure_position_fbs", |
| 107 | ":superstructure_status_fbs", |
| 108 | "//aos:math", |
| 109 | "//aos/events/logging:log_writer", |
| 110 | "//aos/testing:googletest", |
| 111 | "//aos/time", |
| 112 | "//frc971/control_loops:capped_test_plant", |
| 113 | "//frc971/control_loops:control_loop_test", |
| 114 | "//frc971/control_loops:position_sensor_sim", |
| 115 | "//frc971/control_loops:team_number_test_environment", |
| 116 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
| 117 | ], |
| 118 | ) |
| 119 | |
| 120 | ts_library( |
| 121 | name = "superstructure_plotter", |
| 122 | srcs = ["superstructure_plotter.ts"], |
| 123 | target_compatible_with = ["@platforms//os:linux"], |
| 124 | deps = [ |
| 125 | "//aos/network/www:aos_plotter", |
| 126 | "//aos/network/www:colors", |
| 127 | "//aos/network/www:proxy", |
| 128 | ], |
| 129 | ) |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 130 | |
| 131 | ts_library( |
| 132 | name = "catapult_plotter", |
| 133 | srcs = ["catapult_plotter.ts"], |
| 134 | target_compatible_with = ["@platforms//os:linux"], |
| 135 | deps = [ |
| 136 | "//aos/network/www:aos_plotter", |
| 137 | "//aos/network/www:colors", |
| 138 | "//aos/network/www:proxy", |
| 139 | ], |
| 140 | ) |