Move over to ABSL logging and flags.
Removes gperftools too since that wants gflags.
Here come the fireworks.
Change-Id: I79cb7bcf60f1047fbfa28bfffc21a0fd692e4b1c
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2020/control_loops/superstructure/shooter/BUILD b/y2020/control_loops/superstructure/shooter/BUILD
index 96c933f..df676e4 100644
--- a/y2020/control_loops/superstructure/shooter/BUILD
+++ b/y2020/control_loops/superstructure/shooter/BUILD
@@ -57,7 +57,8 @@
":shooter_tuning_readings_fbs",
"//aos:init",
"//aos/events:shm_event_loop",
- "@com_github_gflags_gflags//:gflags",
- "@com_github_google_glog//:glog",
+ "@com_google_absl//absl/flags:flag",
+ "@com_google_absl//absl/log",
+ "@com_google_absl//absl/log:check",
],
)
diff --git a/y2020/control_loops/superstructure/shooter/shooter_tuning_params_setter.cc b/y2020/control_loops/superstructure/shooter/shooter_tuning_params_setter.cc
index 5e3010d..abd5463 100644
--- a/y2020/control_loops/superstructure/shooter/shooter_tuning_params_setter.cc
+++ b/y2020/control_loops/superstructure/shooter/shooter_tuning_params_setter.cc
@@ -1,22 +1,26 @@
-#include "gflags/gflags.h"
-#include "glog/logging.h"
+#include "absl/flags/flag.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
#include "y2020/control_loops/superstructure/shooter/shooter_tuning_params_generated.h"
-DEFINE_double(velocity_initial_finisher, 300.0, "Initial finisher velocity");
-DEFINE_double(velocity_final_finisher, 500.0, "Final finisher velocity");
-DEFINE_double(velocity_finisher_increment, 25.0, "Finisher velocity increment");
+ABSL_FLAG(double, velocity_initial_finisher, 300.0,
+ "Initial finisher velocity");
+ABSL_FLAG(double, velocity_final_finisher, 500.0, "Final finisher velocity");
+ABSL_FLAG(double, velocity_finisher_increment, 25.0,
+ "Finisher velocity increment");
-DEFINE_double(velocity_initial_accelerator, 180.0,
- "Initial accelerator velocity");
-DEFINE_double(velocity_final_accelerator, 250.0, "Final accelerator velocity");
-DEFINE_double(velocity_accelerator_increment, 20.0,
- "Accelerator velocity increment");
+ABSL_FLAG(double, velocity_initial_accelerator, 180.0,
+ "Initial accelerator velocity");
+ABSL_FLAG(double, velocity_final_accelerator, 250.0,
+ "Final accelerator velocity");
+ABSL_FLAG(double, velocity_accelerator_increment, 20.0,
+ "Accelerator velocity increment");
-DEFINE_int32(balls_per_iteration, 10,
- "Balls to shoot per iteration in the velocity sweep");
+ABSL_FLAG(int32_t, balls_per_iteration, 10,
+ "Balls to shoot per iteration in the velocity sweep");
namespace shooter = y2020::control_loops::superstructure::shooter;
@@ -43,16 +47,19 @@
auto builder = sender.MakeBuilder();
auto finisher_params = BuildFlywheelTuningParams(
- builder, FLAGS_velocity_initial_finisher, FLAGS_velocity_final_finisher,
- FLAGS_velocity_finisher_increment);
+ builder, absl::GetFlag(FLAGS_velocity_initial_finisher),
+ absl::GetFlag(FLAGS_velocity_final_finisher),
+ absl::GetFlag(FLAGS_velocity_finisher_increment));
auto accelerator_params = BuildFlywheelTuningParams(
- builder, FLAGS_velocity_initial_accelerator,
- FLAGS_velocity_final_accelerator, FLAGS_velocity_accelerator_increment);
+ builder, absl::GetFlag(FLAGS_velocity_initial_accelerator),
+ absl::GetFlag(FLAGS_velocity_final_accelerator),
+ absl::GetFlag(FLAGS_velocity_accelerator_increment));
auto tuning_params_builder = builder.MakeBuilder<shooter::TuningParams>();
tuning_params_builder.add_finisher(finisher_params);
tuning_params_builder.add_accelerator(accelerator_params);
- tuning_params_builder.add_balls_per_iteration(FLAGS_balls_per_iteration);
+ tuning_params_builder.add_balls_per_iteration(
+ absl::GetFlag(FLAGS_balls_per_iteration));
builder.CheckOk(builder.Send(tuning_params_builder.Finish()));
return 0;