Add auto-mode flag to trim_log_to_enabled
Change-Id: I4d3cba749167fceb848fbf47877998608972205a
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/frc971/analysis/trim_log_to_enabled.cc b/frc971/analysis/trim_log_to_enabled.cc
index 47e7703..fb6b0c6 100644
--- a/frc971/analysis/trim_log_to_enabled.cc
+++ b/frc971/analysis/trim_log_to_enabled.cc
@@ -10,6 +10,7 @@
DEFINE_string(output_folder, "/tmp/trimmed/",
"Name of the folder to write the trimmed log to.");
DEFINE_string(node, "roborio", "");
+DEFINE_bool(auto, false, "If set, trim the log to just the auto mode.");
DEFINE_double(pre_enable_time_sec, 10.0,
"Amount of time to leave in the new log before the first enable "
"signal happens.");
@@ -53,7 +54,7 @@
printed_match = true;
}
- if (msg.enabled()) {
+ if (msg.enabled() && (!FLAGS_auto || msg.autonomous())) {
// Note that time is monotonic, so we don't need to e.g. do min's or
// max's on the start/end time.
if (!start_time.has_value()) {