blob: 9c236c8d23d51bf61d11bf0f4e9c8615197dfd0e [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 Kuszmaul2e818b22024-02-24 09:02:42 -080034 "//y2024/control_loops/superstructure:superstructure_plotter",
James Kuszmaul313e9ce2024-02-11 17:47:33 -080035 "//y2024/localizer:corrections_plotter",
36 "//y2024/localizer:localizer_plotter",
James Kuszmaul5f5e1232020-12-22 20:58:00 -080037 ],
38)
39
40rollup_bundle(
41 name = "plot_index_bundle",
James Kuszmaul5f5e1232020-12-22 20:58:00 -080042 entry_point = "plot_index.ts",
43 target_compatible_with = ["@platforms//os:linux"],
44 deps = [
45 ":plot_index",
46 ],
47)
48
49filegroup(
50 name = "plotter_files",
51 srcs = [
52 "index.html",
53 "plot_index_bundle.min.js",
Austin Schuhfcd56942022-07-18 17:41:32 -070054 "styles.css",
James Kuszmaul5f5e1232020-12-22 20:58:00 -080055 ],
56)
57
58sh_binary(
59 name = "web_plotter",
60 srcs = ["web_plotter.sh"],
61 data = [
62 ":plotter_files",
63 "//aos/network:log_web_proxy_main",
64 ],
65 target_compatible_with = ["@platforms//os:linux"],
66)
67
68sh_binary(
69 name = "live_web_plotter_demo",
70 srcs = ["live_web_plotter_demo.sh"],
71 data = [
72 ":plotter_files",
73 "//aos/network:web_proxy_main",
74 "//aos/network/www:test_config",
75 ],
76 target_compatible_with = ["@platforms//os:linux"],
77)
James Kuszmaul48671362020-12-24 13:54:16 -080078
Stephan Pleines85b295c2024-02-04 17:50:26 -080079genrule(
80 name = "copy_css",
James Kuszmaul48671362020-12-24 13:54:16 -080081 srcs = [
Stephan Pleines85b295c2024-02-04 17:50:26 -080082 "//aos/network/www:styles.css",
James Kuszmaul48671362020-12-24 13:54:16 -080083 ],
Stephan Pleines85b295c2024-02-04 17:50:26 -080084 outs = ["styles.css"],
85 cmd = "cp $< $@",
James Kuszmaul48671362020-12-24 13:54:16 -080086)
Henry Speiserc82be542022-04-07 22:05:20 -070087
88cc_binary(
James Kuszmaul14d7ea12023-12-09 15:41:14 -080089 name = "trim_log_to_enabled",
90 srcs = [
91 "trim_log_to_enabled.cc",
92 ],
93 target_compatible_with = ["@platforms//os:linux"],
94 deps = [
95 "//aos:init",
96 "//aos/events:simulated_event_loop",
97 "//aos/events/logging:log_reader",
98 "//aos/util:simulation_logger",
99 "//frc971/input:joystick_state_fbs",
100 ],
101)
102
103cc_binary(
Henry Speiserc82be542022-04-07 22:05:20 -0700104 name = "log_to_match",
105 srcs = [
106 "log_to_match.cc",
107 ],
108 target_compatible_with = ["@platforms//os:linux"],
109 deps = [
110 "//aos:init",
111 "//aos/events:simulated_event_loop",
112 "//aos/events/logging:log_reader",
113 "//frc971/input:joystick_state_fbs",
114 ],
115)
James Kuszmaul3398d0b2023-02-11 22:55:22 -0800116
James Kuszmaulf35eb982023-12-09 17:50:01 -0800117py_binary(
118 name = "trim_and_plot_foxglove",
119 srcs = ["trim_and_plot_foxglove.py"],
120 data = [
121 ":trim_log_to_enabled",
122 "//aos/util:log_to_mcap",
123 "@foxglove_studio",
124 ],
125 deps = ["@RangeHTTPServer"],
126)