Merge "Ignore the turret and finisher and hood on the practice robot."
diff --git a/aos/BUILD b/aos/BUILD
index cd1f133..9049e08 100644
--- a/aos/BUILD
+++ b/aos/BUILD
@@ -153,9 +153,8 @@
     ],
     target_compatible_with = ["@platforms//os:linux"],
     deps = [
-        "//aos/logging",
-        "//aos/logging:implementations",
         "//aos/time",
+        "@com_github_google_glog//:glog",
     ],
 )
 
diff --git a/aos/dump_rtprio.cc b/aos/dump_rtprio.cc
index 5ab402f..a017137 100644
--- a/aos/dump_rtprio.cc
+++ b/aos/dump_rtprio.cc
@@ -16,9 +16,8 @@
 #include <cstdlib>
 #include <string>
 
-#include "aos/logging/implementations.h"
-#include "aos/logging/logging.h"
 #include "aos/time/time.h"
+#include "glog/logging.h"
 
 namespace {
 
@@ -54,19 +53,16 @@
 int find_pid_max() {
   int r;
   FILE *pid_max_file = fopen("/proc/sys/kernel/pid_max", "r");
-  if (pid_max_file == nullptr) {
-    AOS_PLOG(FATAL, "fopen(\"/proc/sys/kernel/pid_max\")");
-  }
-  AOS_CHECK_EQ(1, fscanf(pid_max_file, "%d", &r));
-  AOS_PCHECK(fclose(pid_max_file));
+  PCHECK(pid_max_file != nullptr)
+      << ": Failed to open /proc/sys/kernel/pid_max";
+  CHECK_EQ(1, fscanf(pid_max_file, "%d", &r));
+  PCHECK(fclose(pid_max_file) == 0);
   return r;
 }
 
 cpu_set_t find_all_cpus() {
   long nproc = sysconf(_SC_NPROCESSORS_CONF);
-  if (nproc == -1) {
-    AOS_PLOG(FATAL, "sysconf(_SC_NPROCESSORS_CONF)");
-  }
+  PCHECK(nproc != -1);
   cpu_set_t r;
   CPU_ZERO(&r);
   for (long i = 0; i < nproc; ++i) {
@@ -82,9 +78,7 @@
     *not_there = true;
     return cpu_set_t();
   }
-  if (result != 0) {
-    AOS_PLOG(FATAL, "sched_getaffinity(%d, %zu, %p)", process, sizeof(r), &r);
-  }
+  PCHECK(result == 0) << ": sched_getaffinity of " << process;
   return r;
 }
 
@@ -95,9 +89,7 @@
     *not_there = true;
     return sched_param();
   }
-  if (result != 0) {
-    AOS_PLOG(FATAL, "sched_getparam(%d)", process);
-  }
+  PCHECK(result == 0) << ": sched_getparam of " << process;
   return r;
 }
 
@@ -107,9 +99,7 @@
     *not_there = true;
     return 0;
   }
-  if (scheduler == -1) {
-    AOS_PLOG(FATAL, "sched_getscheduler(%d)", process);
-  }
+  PCHECK(scheduler != -1) << ": sched_getscheduler of " << process;
   return scheduler;
 }
 
@@ -125,10 +115,8 @@
       *not_there = true;
       return "";
     }
-    if (exe_size == -1) {
-      AOS_PLOG(FATAL, "readlink(%s, %p, %zu)", exe_filename.c_str(), exe_buffer,
-               sizeof(exe_buffer));
-    }
+    PCHECK(exe_size != -1) << ": readlink " << exe_filename
+                           << " into buffer of size " << sizeof(exe_buffer);
     return ::std::string(exe_buffer, exe_size);
   }
 }
@@ -140,9 +128,7 @@
     *not_there = true;
     return 0;
   }
-  if (errno != 0) {
-    AOS_PLOG(FATAL, "getpriority(PRIO_PROCESS, %d)", process);
-  }
+  PCHECK(errno == 0) << "getpriority of " << process;
   return nice_value;
 }
 
@@ -153,9 +139,7 @@
     *not_there = true;
     return;
   }
-  if (stat == nullptr) {
-    AOS_PLOG(FATAL, "fopen(%s, \"r\")", stat_filename.c_str());
-  }
+  PCHECK(stat != nullptr) << ": Failed to open " << stat_filename;
 
   char buffer[2048];
   if (fgets(buffer, sizeof(buffer), stat) == nullptr) {
@@ -164,7 +148,8 @@
         *not_there = true;
         return;
       }
-      AOS_PLOG(FATAL, "fgets(%p, %zu, %p)", buffer, sizeof(buffer), stat);
+      PLOG(FATAL) << "reading from " << stat_filename << " into buffer of size "
+                  << sizeof(buffer);
     }
   }
 
@@ -197,12 +182,12 @@
       field_start = i + 1;
     }
   }
-  AOS_PCHECK(fclose(stat));
+  PCHECK(fclose(stat) == 0);
 
   if (field < 4) {
-    AOS_LOG(FATAL, "couldn't get fields from /proc/%d/stat\n", process);
+    LOG(FATAL) << "couldn't get fields from /proc/" << process << "/stat";
   }
-  AOS_CHECK_EQ(pid, process);
+  CHECK_EQ(pid, process);
 }
 
 void read_status(int process, int ppid, int *pgrp, ::std::string *name,
@@ -214,16 +199,15 @@
     *not_there = true;
     return;
   }
-  if (status == nullptr) {
-    AOS_PLOG(FATAL, "fopen(%s, \"r\")", status_filename.c_str());
-  }
+  PCHECK(status != nullptr) << ": Failed to open " << status_filename;
 
   int pid = 0, status_ppid = 0;
   while (true) {
     char buffer[1024];
     if (fgets(buffer, sizeof(buffer), status) == nullptr) {
       if (ferror(status)) {
-        AOS_PLOG(FATAL, "fgets(%p, %zu, %p)", buffer, sizeof(buffer), status);
+        PLOG(FATAL) << "reading from " << status_filename
+                    << " into buffer of size " << sizeof(buffer);
       } else {
         break;
       }
@@ -239,9 +223,9 @@
       *pgrp = ::std::stoi(strip_string_prefix(5, line));
     }
   }
-  AOS_PCHECK(fclose(status));
-  AOS_CHECK_EQ(pid, process);
-  AOS_CHECK_EQ(status_ppid, ppid);
+  PCHECK(fclose(status) == 0);
+  CHECK_EQ(pid, process);
+  CHECK_EQ(status_ppid, ppid);
 }
 
 }  // namespace
diff --git a/aos/seasocks/BUILD b/aos/seasocks/BUILD
index e9a98c7..7f5d25a 100644
--- a/aos/seasocks/BUILD
+++ b/aos/seasocks/BUILD
@@ -14,7 +14,7 @@
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/logging",
         "//third_party/seasocks",
+        "@com_github_google_glog//:glog",
     ],
 )
diff --git a/aos/seasocks/seasocks_logger.cc b/aos/seasocks/seasocks_logger.cc
index 53d05e8..3cf3bd9 100644
--- a/aos/seasocks/seasocks_logger.cc
+++ b/aos/seasocks/seasocks_logger.cc
@@ -1,32 +1,35 @@
 #include "aos/seasocks/seasocks_logger.h"
 
-#include "aos/logging/logging.h"
+#include "glog/logging.h"
 #include "seasocks/PrintfLogger.h"
 
 namespace aos {
 namespace seasocks {
 
 void SeasocksLogger::log(::seasocks::Logger::Level level, const char *message) {
-  // Convert Seasocks error codes to AOS.
-  log_level aos_level;
+  // Convert Seasocks error codes to glog.
+  int glog_level;
   switch (level) {
     case ::seasocks::Logger::Level::Info:
-      aos_level = INFO;
+      glog_level = google::INFO;
       break;
     case ::seasocks::Logger::Level::Warning:
-      aos_level = WARNING;
+      glog_level = google::WARNING;
       break;
     case ::seasocks::Logger::Level::Error:
     case ::seasocks::Logger::Level::Severe:
-      aos_level = ERROR;
+      glog_level = google::ERROR;
       break;
     case ::seasocks::Logger::Level::Debug:
     case ::seasocks::Logger::Level::Access:
     default:
-      aos_level = DEBUG;
+      if (!VLOG_IS_ON(1)) {
+        return;
+      }
+      glog_level = google::INFO;
       break;
   }
-  AOS_LOG(aos_level, "Seasocks: %s\n", message);
+  LOG_AT_LEVEL(glog_level) << "Seasocks: " << message;
 }
 
 }  // namespace seasocks
diff --git a/y2014/BUILD b/y2014/BUILD
index d483883..cb718a6 100644
--- a/y2014/BUILD
+++ b/y2014/BUILD
@@ -12,12 +12,12 @@
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/logging",
         "//aos/network:team_number",
         "//aos/stl_mutex",
         "//frc971:shifter_hall_effect",
         "//frc971/control_loops:state_feedback_loop",
         "//y2014/control_loops/drivetrain:polydrivetrain_plants",
+        "@com_github_google_glog//:glog",
         "@com_google_absl//absl/base",
     ],
 )
diff --git a/y2014/constants.cc b/y2014/constants.cc
index d6a8e5d..70f70fe 100644
--- a/y2014/constants.cc
+++ b/y2014/constants.cc
@@ -10,9 +10,9 @@
 #endif
 
 #include "absl/base/call_once.h"
-#include "aos/logging/logging.h"
 #include "aos/network/team_number.h"
 #include "aos/stl_mutex/stl_mutex.h"
+#include "glog/logging.h"
 #include "y2014/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
 #include "y2014/control_loops/drivetrain/polydrivetrain_dog_motor_plant.h"
 
@@ -223,13 +223,13 @@
       };
       break;
     default:
-      AOS_LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
+      LOG(FATAL) << "unknown team: " << team;
   }
 }
 
 void DoGetValues(const Values **result) {
   uint16_t team = ::aos::network::GetTeamNumber();
-  AOS_LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team);
+  LOG(INFO) << "creating a Constants for team: " << team;
   *result = DoGetValuesForTeam(team);
   return;
 }
diff --git a/y2016/BUILD b/y2016/BUILD
index bf3919d..260a305 100644
--- a/y2016/BUILD
+++ b/y2016/BUILD
@@ -12,13 +12,13 @@
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/logging",
         "//aos/network:team_number",
         "//aos/stl_mutex",
         "//frc971:constants",
         "//frc971:shifter_hall_effect",
         "//frc971/control_loops:state_feedback_loop",
         "//y2016/control_loops/drivetrain:polydrivetrain_plants",
+        "@com_github_google_glog//:glog",
         "@com_google_absl//absl/base",
     ],
 )
diff --git a/y2016/constants.cc b/y2016/constants.cc
index 363ef26..1ca3ef2 100644
--- a/y2016/constants.cc
+++ b/y2016/constants.cc
@@ -10,9 +10,9 @@
 #endif
 
 #include "absl/base/call_once.h"
-#include "aos/logging/logging.h"
 #include "aos/network/team_number.h"
 #include "aos/stl_mutex/stl_mutex.h"
+#include "glog/logging.h"
 #include "y2016/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
 #include "y2016/control_loops/drivetrain/polydrivetrain_dog_motor_plant.h"
 
@@ -146,13 +146,13 @@
       };
       break;
     default:
-      AOS_LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
+      LOG(FATAL) << "unknown team: " << team;
   }
 }
 
 void DoGetValues(const Values **result) {
   uint16_t team = ::aos::network::GetTeamNumber();
-  AOS_LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team);
+  LOG(INFO) << "creating a Constants for team: " << team;
   *result = DoGetValuesForTeam(team);
   return;
 }
diff --git a/y2017/BUILD b/y2017/BUILD
index 12a585b..df1fd4b 100644
--- a/y2017/BUILD
+++ b/y2017/BUILD
@@ -12,7 +12,6 @@
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/logging",
         "//aos/network:team_number",
         "//aos/stl_mutex",
         "//frc971:constants",
@@ -22,6 +21,7 @@
         "//y2017/control_loops/superstructure/hood:hood_plants",
         "//y2017/control_loops/superstructure/intake:intake_plants",
         "//y2017/control_loops/superstructure/shooter:shooter_plants",
+        "@com_github_google_glog//:glog",
         "@com_google_absl//absl/base",
     ],
 )
diff --git a/y2017/constants.cc b/y2017/constants.cc
index 654edf8..1594de7 100644
--- a/y2017/constants.cc
+++ b/y2017/constants.cc
@@ -10,9 +10,9 @@
 #endif
 
 #include "absl/base/call_once.h"
-#include "aos/logging/logging.h"
 #include "aos/network/team_number.h"
 #include "aos/stl_mutex/stl_mutex.h"
+#include "glog/logging.h"
 #include "y2017/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
 #include "y2017/control_loops/drivetrain/polydrivetrain_dog_motor_plant.h"
 
@@ -145,7 +145,7 @@
       break;
 
     default:
-      AOS_LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
+      LOG(FATAL) << "unknown team: " << team;
   }
 
   return r;
@@ -153,7 +153,7 @@
 
 void DoGetValues(const Values **result) {
   uint16_t team = ::aos::network::GetTeamNumber();
-  AOS_LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team);
+  LOG(INFO) << "creating a Constants for team: " << team;
   *result = DoGetValuesForTeam(team);
 }
 
diff --git a/y2018/BUILD b/y2018/BUILD
index 0d0cb5d..9c845fd 100644
--- a/y2018/BUILD
+++ b/y2018/BUILD
@@ -54,7 +54,6 @@
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/logging",
         "//aos/network:team_number",
         "//aos/stl_mutex",
         "//frc971:constants",
@@ -62,6 +61,7 @@
         "//y2018/control_loops/drivetrain:polydrivetrain_plants",
         "//y2018/control_loops/superstructure/arm:dynamics",
         "//y2018/control_loops/superstructure/intake:intake_plants",
+        "@com_github_google_glog//:glog",
     ],
 )
 
diff --git a/y2018/constants.cc b/y2018/constants.cc
index e6951cc..5a180ef 100644
--- a/y2018/constants.cc
+++ b/y2018/constants.cc
@@ -9,9 +9,9 @@
 #include "sanitizer/lsan_interface.h"
 #endif
 
-#include "aos/logging/logging.h"
 #include "aos/network/team_number.h"
 #include "aos/stl_mutex/stl_mutex.h"
+#include "glog/logging.h"
 #include "y2018/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
 #include "y2018/control_loops/drivetrain/polydrivetrain_dog_motor_plant.h"
 
@@ -128,7 +128,7 @@
       break;
 
     default:
-      AOS_LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
+      LOG(FATAL) << "unknown team: " << team;
   }
 
   return r;
@@ -136,7 +136,7 @@
 
 const Values &DoGetValues() {
   const uint16_t team = ::aos::network::GetTeamNumber();
-  AOS_LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team);
+  LOG(INFO) << "creating a Constants for team: " << team;
   return GetValuesForTeam(team);
 }
 
diff --git a/y2019/BUILD b/y2019/BUILD
index b5f42cd..8c250e0 100644
--- a/y2019/BUILD
+++ b/y2019/BUILD
@@ -33,7 +33,6 @@
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/logging",
         "//aos/network:team_number",
         "//aos/stl_mutex",
         "//frc971:constants",
@@ -46,6 +45,7 @@
         "//y2019/control_loops/superstructure/stilts:stilts_plants",
         "//y2019/control_loops/superstructure/wrist:wrist_plants",
         "//y2019/vision:constants",
+        "@com_github_google_glog//:glog",
         "@com_google_absl//absl/base",
     ],
 )
diff --git a/y2019/constants.cc b/y2019/constants.cc
index f86110c..cc81f53 100644
--- a/y2019/constants.cc
+++ b/y2019/constants.cc
@@ -8,9 +8,9 @@
 #endif
 
 #include "absl/base/call_once.h"
-#include "aos/logging/logging.h"
 #include "aos/network/team_number.h"
 #include "aos/stl_mutex/stl_mutex.h"
+#include "glog/logging.h"
 #include "y2019/control_loops/superstructure/elevator/integral_elevator_plant.h"
 #include "y2019/control_loops/superstructure/intake/integral_intake_plant.h"
 #include "y2019/control_loops/superstructure/stilts/integral_stilts_plant.h"
@@ -224,7 +224,7 @@
       break;
 
     default:
-      AOS_LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
+      LOG(FATAL) << "unknown team: " << team;
   }
 
   return r;
@@ -232,7 +232,7 @@
 
 void DoGetValues(const Values **result) {
   uint16_t team = ::aos::network::GetTeamNumber();
-  AOS_LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team);
+  LOG(INFO) << "creating a Constants for team: " << team;
   *result = DoGetValuesForTeam(team);
 }
 
diff --git a/y2020/BUILD b/y2020/BUILD
index 61987c9..7da0bc7 100644
--- a/y2020/BUILD
+++ b/y2020/BUILD
@@ -63,7 +63,6 @@
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/logging",
         "//aos/network:team_number",
         "//aos/stl_mutex",
         "//frc971:constants",
@@ -76,6 +75,7 @@
         "//y2020/control_loops/superstructure/hood:hood_plants",
         "//y2020/control_loops/superstructure/intake:intake_plants",
         "//y2020/control_loops/superstructure/turret:turret_plants",
+        "@com_github_google_glog//:glog",
         "@com_google_absl//absl/base",
     ],
 )
diff --git a/y2020/constants.cc b/y2020/constants.cc
index e418831..0b1b50a 100644
--- a/y2020/constants.cc
+++ b/y2020/constants.cc
@@ -8,9 +8,9 @@
 #endif
 
 #include "absl/base/call_once.h"
-#include "aos/logging/logging.h"
 #include "aos/network/team_number.h"
 #include "aos/stl_mutex/stl_mutex.h"
+#include "glog/logging.h"
 #include "y2020/control_loops/superstructure/control_panel/integral_control_panel_plant.h"
 #include "y2020/control_loops/superstructure/hood/integral_hood_plant.h"
 #include "y2020/control_loops/superstructure/intake/integral_intake_plant.h"
@@ -162,7 +162,7 @@
     case Values::kPracticeTeamNumber:
       hood->zeroing_constants.measured_absolute_position = 0.0;
 
-      intake->zeroing_constants.measured_absolute_position = 0.347;
+      intake->zeroing_constants.measured_absolute_position = 0.205469223604347;
 
       turret->potentiometer_offset = 5.3931926228241;
       turret_params->zeroing_constants.measured_absolute_position = 4.22;
@@ -178,7 +178,7 @@
       break;
 
     default:
-      AOS_LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
+      LOG(FATAL) << "unknown team: " << team;
   }
 
   return r;
@@ -188,7 +188,7 @@
 
 void DoGetValues() {
   uint16_t team = ::aos::network::GetTeamNumber();
-  AOS_LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team);
+  LOG(INFO) << "creating a Constants for team: " << team;
   values = DoGetValuesForTeam(team);
 }
 
diff --git a/y2020/constants.h b/y2020/constants.h
index d1689a7..01cd177 100644
--- a/y2020/constants.h
+++ b/y2020/constants.h
@@ -69,9 +69,9 @@
   static constexpr ::frc971::constants::Range kHoodRange() {
     return ::frc971::constants::Range{
         -0.01,  // Back Hard
-        0.65,   // Front Hard
+        0.675,   // Front Hard
         0.00,   // Back Soft
-        0.63    // Front Soft
+        0.67    // Front Soft
     };
   }
 
diff --git a/y2021_bot3/BUILD b/y2021_bot3/BUILD
index 949820a..f068dbe 100644
--- a/y2021_bot3/BUILD
+++ b/y2021_bot3/BUILD
@@ -26,13 +26,13 @@
     ],
     visibility = ["//visibility:public"],
     deps = [
-        "//aos/logging",
         "//aos/mutex",
         "//aos/network:team_number",
         "//frc971:constants",
         "//frc971/control_loops:pose",
         "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
         "//y2021_bot3/control_loops/drivetrain:polydrivetrain_plants",
+        "@com_github_google_glog//:glog",
         "@com_google_absl//absl/base",
     ],
 )
diff --git a/y2021_bot3/constants.cc b/y2021_bot3/constants.cc
index 707ecd6..82e3808 100644
--- a/y2021_bot3/constants.cc
+++ b/y2021_bot3/constants.cc
@@ -8,9 +8,9 @@
 #endif
 
 #include "absl/base/call_once.h"
-#include "aos/logging/logging.h"
 #include "aos/mutex/mutex.h"
 #include "aos/network/team_number.h"
+#include "glog/logging.h"
 
 namespace y2021_bot3 {
 namespace constants {
@@ -41,7 +41,7 @@
       break;
 
     default:
-      AOS_LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
+      LOG(FATAL) << "unknown team: " << team;
   }
 
   return r;
@@ -49,7 +49,7 @@
 
 void DoGetValues(const Values **result) {
   uint16_t team = ::aos::network::GetTeamNumber();
-  AOS_LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team);
+  LOG(INFO) << "creating a Constants for team: " << team;
   *result = DoGetValuesForTeam(team);
 }