blob: c896ce6812d5369bae7138f60b1f8adab493e3f5 [file] [log] [blame]
Philipp Schrader3de4dfc2023-02-15 20:18:25 -08001load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
James Kuszmaul61a971f2020-01-01 15:06:18 -08002
Philipp Schradercc016b32021-12-30 08:59:58 -08003package(default_visibility = ["//visibility:public"])
4
Philipp Schrader3de4dfc2023-02-15 20:18:25 -08005ts_project(
James Kuszmaul5f5e1232020-12-22 20:58:00 -08006 name = "plot_index",
7 srcs = ["plot_index.ts"],
8 target_compatible_with = ["@platforms//os:linux"],
9 deps = [
10 "//aos:configuration_ts_fbs",
11 "//aos/network/www:demo_plot",
12 "//aos/network/www:proxy",
James Kuszmaulac2b6b42021-03-07 22:38:06 -080013 "//frc971/control_loops/drivetrain:down_estimator_plotter",
James Kuszmaulc4ae11c2020-12-26 16:26:58 -080014 "//frc971/control_loops/drivetrain:drivetrain_plotter",
milind upadhyay9bd381d2021-01-23 13:44:13 -080015 "//frc971/control_loops/drivetrain:robot_state_plotter",
James Kuszmaul73fc1352021-04-09 22:31:25 -070016 "//frc971/control_loops/drivetrain:spline_plotter",
James Kuszmaul5f5e1232020-12-22 20:58:00 -080017 "//frc971/wpilib:imu_plotter",
James Kuszmaul9c23d262021-09-25 21:50:02 -070018 "//y2020/control_loops/drivetrain:localizer_plotter",
Austin Schuh7d63eab2021-03-06 20:15:02 -080019 "//y2020/control_loops/superstructure:accelerator_plotter",
20 "//y2020/control_loops/superstructure:finisher_plotter",
Austin Schuh2efe1682021-03-06 22:47:15 -080021 "//y2020/control_loops/superstructure:hood_plotter",
James Kuszmaul78101402021-09-11 12:42:21 -070022 "//y2020/control_loops/superstructure:turret_plotter",
Sabina Leaver58f04b72021-10-06 20:52:09 -070023 "//y2021_bot3/control_loops/superstructure:superstructure_plotter",
Austin Schuh76f227c2022-02-23 16:34:08 -080024 "//y2022/control_loops/superstructure:catapult_plotter",
Milind Upadhyayeb739bb2022-03-02 10:49:21 -080025 "//y2022/control_loops/superstructure:climber_plotter",
26 "//y2022/control_loops/superstructure:intake_plotter",
Ravago Jonesb64988c2022-03-06 15:05:01 -080027 "//y2022/control_loops/superstructure:superstructure_plotter",
Milind Upadhyayeb739bb2022-03-02 10:49:21 -080028 "//y2022/control_loops/superstructure:turret_plotter",
James Kuszmaul51fa1ae2022-02-26 00:49:57 -080029 "//y2022/localizer:localizer_plotter",
James Kuszmaulb35e2342022-03-06 15:44:00 -080030 "//y2022/vision:vision_plotter",
James Kuszmaul81e71842023-09-29 15:25:13 -070031 "//y2023/control_loops/superstructure:superstructure_plotter",
James Kuszmaula8e0d6e2023-03-12 13:33:36 -070032 "//y2023/localizer:corrections_plotter",
James Kuszmaul827a6d62023-03-26 12:40:29 -070033 "//y2023/localizer:localizer_plotter",
James Kuszmaul313e9ce2024-02-11 17:47:33 -080034 "//y2024/localizer:corrections_plotter",
35 "//y2024/localizer:localizer_plotter",
James Kuszmaul5f5e1232020-12-22 20:58:00 -080036 ],
37)
38
39rollup_bundle(
40 name = "plot_index_bundle",
James Kuszmaul5f5e1232020-12-22 20:58:00 -080041 entry_point = "plot_index.ts",
42 target_compatible_with = ["@platforms//os:linux"],
43 deps = [
44 ":plot_index",
45 ],
46)
47
48filegroup(
49 name = "plotter_files",
50 srcs = [
51 "index.html",
52 "plot_index_bundle.min.js",
Austin Schuhfcd56942022-07-18 17:41:32 -070053 "styles.css",
James Kuszmaul5f5e1232020-12-22 20:58:00 -080054 ],
55)
56
57sh_binary(
58 name = "web_plotter",
59 srcs = ["web_plotter.sh"],
60 data = [
61 ":plotter_files",
62 "//aos/network:log_web_proxy_main",
63 ],
64 target_compatible_with = ["@platforms//os:linux"],
65)
66
67sh_binary(
68 name = "live_web_plotter_demo",
69 srcs = ["live_web_plotter_demo.sh"],
70 data = [
71 ":plotter_files",
72 "//aos/network:web_proxy_main",
73 "//aos/network/www:test_config",
74 ],
75 target_compatible_with = ["@platforms//os:linux"],
76)
James Kuszmaul48671362020-12-24 13:54:16 -080077
Stephan Pleines85b295c2024-02-04 17:50:26 -080078genrule(
79 name = "copy_css",
James Kuszmaul48671362020-12-24 13:54:16 -080080 srcs = [
Stephan Pleines85b295c2024-02-04 17:50:26 -080081 "//aos/network/www:styles.css",
James Kuszmaul48671362020-12-24 13:54:16 -080082 ],
Stephan Pleines85b295c2024-02-04 17:50:26 -080083 outs = ["styles.css"],
84 cmd = "cp $< $@",
James Kuszmaul48671362020-12-24 13:54:16 -080085)
Henry Speiserc82be542022-04-07 22:05:20 -070086
87cc_binary(
James Kuszmaul14d7ea12023-12-09 15:41:14 -080088 name = "trim_log_to_enabled",
89 srcs = [
90 "trim_log_to_enabled.cc",
91 ],
92 target_compatible_with = ["@platforms//os:linux"],
93 deps = [
94 "//aos:init",
95 "//aos/events:simulated_event_loop",
96 "//aos/events/logging:log_reader",
97 "//aos/util:simulation_logger",
98 "//frc971/input:joystick_state_fbs",
99 ],
100)
101
102cc_binary(
Henry Speiserc82be542022-04-07 22:05:20 -0700103 name = "log_to_match",
104 srcs = [
105 "log_to_match.cc",
106 ],
107 target_compatible_with = ["@platforms//os:linux"],
108 deps = [
109 "//aos:init",
110 "//aos/events:simulated_event_loop",
111 "//aos/events/logging:log_reader",
112 "//frc971/input:joystick_state_fbs",
113 ],
114)
James Kuszmaul3398d0b2023-02-11 22:55:22 -0800115
James Kuszmaulf35eb982023-12-09 17:50:01 -0800116py_binary(
117 name = "trim_and_plot_foxglove",
118 srcs = ["trim_and_plot_foxglove.py"],
119 data = [
120 ":trim_log_to_enabled",
121 "//aos/util:log_to_mcap",
122 "@foxglove_studio",
123 ],
124 deps = ["@RangeHTTPServer"],
125)