blob: b179ad9fe13c66eecaab4332d37f116f3e696ec2 [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 Kuszmaul5f5e1232020-12-22 20:58:00 -080034 ],
35)
36
37rollup_bundle(
38 name = "plot_index_bundle",
James Kuszmaul5f5e1232020-12-22 20:58:00 -080039 entry_point = "plot_index.ts",
40 target_compatible_with = ["@platforms//os:linux"],
41 deps = [
42 ":plot_index",
43 ],
44)
45
46filegroup(
47 name = "plotter_files",
48 srcs = [
49 "index.html",
50 "plot_index_bundle.min.js",
Austin Schuhfcd56942022-07-18 17:41:32 -070051 "styles.css",
James Kuszmaul5f5e1232020-12-22 20:58:00 -080052 ],
53)
54
55sh_binary(
56 name = "web_plotter",
57 srcs = ["web_plotter.sh"],
58 data = [
59 ":plotter_files",
60 "//aos/network:log_web_proxy_main",
61 ],
62 target_compatible_with = ["@platforms//os:linux"],
63)
64
65sh_binary(
66 name = "live_web_plotter_demo",
67 srcs = ["live_web_plotter_demo.sh"],
68 data = [
69 ":plotter_files",
70 "//aos/network:web_proxy_main",
71 "//aos/network/www:test_config",
72 ],
73 target_compatible_with = ["@platforms//os:linux"],
74)
James Kuszmaul48671362020-12-24 13:54:16 -080075
Stephan Pleines85b295c2024-02-04 17:50:26 -080076genrule(
77 name = "copy_css",
James Kuszmaul48671362020-12-24 13:54:16 -080078 srcs = [
Stephan Pleines85b295c2024-02-04 17:50:26 -080079 "//aos/network/www:styles.css",
James Kuszmaul48671362020-12-24 13:54:16 -080080 ],
Stephan Pleines85b295c2024-02-04 17:50:26 -080081 outs = ["styles.css"],
82 cmd = "cp $< $@",
James Kuszmaul48671362020-12-24 13:54:16 -080083)
Henry Speiserc82be542022-04-07 22:05:20 -070084
85cc_binary(
James Kuszmaul14d7ea12023-12-09 15:41:14 -080086 name = "trim_log_to_enabled",
87 srcs = [
88 "trim_log_to_enabled.cc",
89 ],
90 target_compatible_with = ["@platforms//os:linux"],
91 deps = [
92 "//aos:init",
93 "//aos/events:simulated_event_loop",
94 "//aos/events/logging:log_reader",
95 "//aos/util:simulation_logger",
96 "//frc971/input:joystick_state_fbs",
97 ],
98)
99
100cc_binary(
Henry Speiserc82be542022-04-07 22:05:20 -0700101 name = "log_to_match",
102 srcs = [
103 "log_to_match.cc",
104 ],
105 target_compatible_with = ["@platforms//os:linux"],
106 deps = [
107 "//aos:init",
108 "//aos/events:simulated_event_loop",
109 "//aos/events/logging:log_reader",
110 "//frc971/input:joystick_state_fbs",
111 ],
112)
James Kuszmaul3398d0b2023-02-11 22:55:22 -0800113
James Kuszmaulf35eb982023-12-09 17:50:01 -0800114py_binary(
115 name = "trim_and_plot_foxglove",
116 srcs = ["trim_and_plot_foxglove.py"],
117 data = [
118 ":trim_log_to_enabled",
119 "//aos/util:log_to_mcap",
120 "@foxglove_studio",
121 ],
122 deps = ["@RangeHTTPServer"],
123)