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/y2024_defense/BUILD b/y2024_defense/BUILD
index 8f888a5..c639d70 100644
--- a/y2024_defense/BUILD
+++ b/y2024_defense/BUILD
@@ -145,8 +145,9 @@
"//frc971/zeroing:absolute_encoder",
"//frc971/zeroing:pot_and_absolute_encoder",
"//y2024_defense/control_loops/drivetrain:polydrivetrain_plants",
- "@com_github_google_glog//:glog",
"@com_google_absl//absl/base",
+ "@com_google_absl//absl/log",
+ "@com_google_absl//absl/log:check",
],
)
diff --git a/y2024_defense/constants.cc b/y2024_defense/constants.cc
index 31b3ae3..00f74b9 100644
--- a/y2024_defense/constants.cc
+++ b/y2024_defense/constants.cc
@@ -8,7 +8,8 @@
#endif
#include "absl/base/call_once.h"
-#include "glog/logging.h"
+#include "absl/log/check.h"
+#include "absl/log/log.h"
#include "aos/mutex/mutex.h"
#include "aos/network/team_number.h"
diff --git a/y2024_defense/rockpi/imu_main.cc b/y2024_defense/rockpi/imu_main.cc
index 8ab51fe..4f85551 100644
--- a/y2024_defense/rockpi/imu_main.cc
+++ b/y2024_defense/rockpi/imu_main.cc
@@ -1,16 +1,19 @@
+#include "absl/flags/flag.h"
+
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
#include "aos/realtime.h"
#include "frc971/imu_reader/imu.h"
#include "y2024_defense/constants.h"
-DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
+ABSL_FLAG(std::string, config, "aos_config.json",
+ "Path to the config file to use.");
int main(int argc, char *argv[]) {
aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig(FLAGS_config);
+ aos::configuration::ReadConfig(absl::GetFlag(FLAGS_config));
aos::ShmEventLoop event_loop(&config.message());
frc971::imu::Imu imu(
diff --git a/y2024_defense/wpilib_interface.cc b/y2024_defense/wpilib_interface.cc
index 175f238..03ca275 100644
--- a/y2024_defense/wpilib_interface.cc
+++ b/y2024_defense/wpilib_interface.cc
@@ -11,6 +11,7 @@
#include <mutex>
#include <thread>
+#include "absl/flags/flag.h"
#include "ctre/phoenix/CANifier.h"
#include "frc971/wpilib/ahal/AnalogInput.h"
@@ -61,9 +62,9 @@
#include "frc971/wpilib/wpilib_robot_base.h"
#include "y2024_defense/constants.h"
-DEFINE_bool(ctre_diag_server, false,
- "If true, enable the diagnostics server for interacting with "
- "devices on the CAN bus using Phoenix Tuner");
+ABSL_FLAG(bool, ctre_diag_server, false,
+ "If true, enable the diagnostics server for interacting with "
+ "devices on the CAN bus using Phoenix Tuner");
using ::aos::monotonic_clock;
using ::frc971::CANConfiguration;
@@ -292,7 +293,7 @@
constants::Values::kDrivetrainSupplyCurrentLimit());
// Setting up CAN.
- if (!FLAGS_ctre_diag_server) {
+ if (!absl::GetFlag(FLAGS_ctre_diag_server)) {
c_Phoenix_Diagnostics_SetSecondsToStart(-1);
c_Phoenix_Diagnostics_Dispose();
}