Prefix LOG and CHECK with AOS_
This prepares us for introducing glog more widely and transitioning
things over where they make sense.
Change-Id: Ic6c208882407bc2153fe875ffc736d66f5c8ade5
diff --git a/y2018/actors/autonomous_actor.cc b/y2018/actors/autonomous_actor.cc
index 18b6789..dd94083 100644
--- a/y2018/actors/autonomous_actor.cc
+++ b/y2018/actors/autonomous_actor.cc
@@ -60,7 +60,8 @@
bool AutonomousActor::RunAction(
const ::frc971::autonomous::AutonomousActionParams ¶ms) {
const monotonic_clock::time_point start_time = monotonic_now();
- LOG(INFO, "Starting autonomous action with mode %" PRId32 "\n", params.mode);
+ AOS_LOG(INFO, "Starting autonomous action with mode %" PRId32 "\n",
+ params.mode);
Reset();
// Switch
@@ -111,8 +112,8 @@
}
*/
- LOG(INFO, "Done %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Done %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
::aos::time::PhasedLoop phased_loop(::std::chrono::milliseconds(5),
event_loop()->monotonic_now(),
@@ -121,7 +122,7 @@
while (!ShouldCancel()) {
phased_loop.SleepUntilNext();
}
- LOG(DEBUG, "Done running\n");
+ AOS_LOG(DEBUG, "Done running\n");
return true;
}
@@ -169,8 +170,8 @@
StartDrive(0.00, 0.0, kFinalSwitchDrive, kTurn);
if (!WaitForArmTrajectoryClose(0.001)) return true;
- LOG(INFO, "Arm close at %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Arm close at %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
::std::this_thread::sleep_for(chrono::milliseconds(1000));
@@ -256,22 +257,22 @@
StartDrive(0.0, 0.0, kFarScaleFinalTurnDrive, kTurn);
if (!WaitForDriveProfileNear(kFullDriveLength - (kSecondTurnDistance)))
return true;
- LOG(INFO, "Final turn at %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Final turn at %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
StartDrive(0.0, M_PI / 2.0, kFarScaleFinalTurnDrive, kFarScaleSweepingTurn);
if (!WaitForDriveProfileNear(0.15)) return true;
StartDrive(0.0, 0.3, kFarScaleFinalTurnDrive, kFarScaleSweepingTurn);
- LOG(INFO, "Dropping at %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Dropping at %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
set_open_claw(true);
SendSuperstructureGoal();
::std::this_thread::sleep_for(chrono::milliseconds(1000));
- LOG(INFO, "Backing up at %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Backing up at %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
StartDrive(1.5, -0.55, kFarScaleFinalTurnDrive, kFarScaleSweepingTurn);
@@ -312,8 +313,8 @@
if (!WaitForTurnProfileDone()) return true;
::std::this_thread::sleep_for(chrono::milliseconds(500));
- LOG(INFO, "Dropping second box at %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Dropping second box at %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
set_open_claw(true);
SendSuperstructureGoal();
@@ -345,8 +346,8 @@
StartDrive(0.0, -M_PI / 2.0, kFarSwitchTurnDrive, kSweepingTurn);
set_arm_goal_position(arm::UpIndex());
SendSuperstructureGoal();
- LOG(INFO, "Lifting arm at %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Lifting arm at %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
if (!WaitForTurnProfileDone()) return true;
StartDrive(0.0, 0.0, kDrive, kTurn);
@@ -378,8 +379,8 @@
StartDrive(0.0, turn_scalar * (-M_PI / 4.0 - 0.2), kSlowDrive, kSweepingTurn);
if (!WaitForDriveNear(0.2, 0.2)) return true;
set_max_drivetrain_voltage(6.0);
- LOG(INFO, "Lowered drivetrain voltage %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Lowered drivetrain voltage %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
::std::this_thread::sleep_for(chrono::milliseconds(300));
set_open_claw(true);
@@ -430,16 +431,16 @@
set_open_claw(true);
SendSuperstructureGoal();
set_intake_angle(-0.60);
- LOG(INFO, "Dropped first box %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Dropped first box %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
::std::this_thread::sleep_for(chrono::milliseconds(700));
set_grab_box(true);
SendSuperstructureGoal();
- LOG(INFO, "Starting second box drive %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Starting second box drive %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
constexpr double kSecondBoxSwerveAngle = 0.35;
constexpr double kSecondBoxDrive = 1.38;
StartDrive(kSecondBoxDrive, 0.0, kDrive, kFastTurn);
@@ -465,16 +466,16 @@
set_roller_voltage(10.0);
SendSuperstructureGoal();
- LOG(INFO, "Grabbing second box %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Grabbing second box %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
::std::this_thread::sleep_for(chrono::milliseconds(200));
StartDrive(-0.04, 0.0, kThirdBoxSlowBackup, kThirdBoxSlowTurn);
if (!WaitForBoxGrabed()) return true;
set_max_drivetrain_voltage(12.0);
- LOG(INFO, "Got second box %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Got second box %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
::std::this_thread::sleep_for(chrono::milliseconds(500));
set_grab_box(false);
@@ -483,8 +484,8 @@
set_roller_voltage(0.0);
set_disable_box_correct(false);
SendSuperstructureGoal();
- LOG(INFO, "Driving to place second box %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Driving to place second box %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
StartDrive(-kSecondBoxDrive + 0.16, kSecondBoxSwerveAngle, kDrive, kFastTurn);
if (!WaitForDriveNear(0.4, M_PI / 2.0)) return true;
@@ -493,8 +494,8 @@
StartDrive(0.0, -kSecondBoxSwerveAngle - kSecondBoxEndExtraAngle, kDrive,
kFastTurn);
- LOG(INFO, "Starting throw %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Starting throw %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
if (!WaitForDriveNear(0.4, M_PI / 2.0)) return true;
if (!WaitForArmTrajectoryClose(0.25)) return true;
SendSuperstructureGoal();
@@ -505,16 +506,16 @@
set_open_claw(true);
set_intake_angle(-M_PI / 4.0);
- LOG(INFO, "Releasing second box %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Releasing second box %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
SendSuperstructureGoal();
::std::this_thread::sleep_for(chrono::milliseconds(700));
set_open_claw(false);
SendSuperstructureGoal();
- LOG(INFO, "Driving to third box %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Driving to third box %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
StartDrive(kThirdCubeDrive, kSecondBoxEndExtraAngle, kThirdBoxDrive,
kFastTurn);
if (!WaitForDriveNear(kThirdCubeDrive - 0.1, M_PI / 4.0)) return true;
@@ -534,16 +535,16 @@
kThirdBoxSlowTurn);
if (!WaitForDriveProfileDone()) return true;
- LOG(INFO, "Waiting for third box %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Waiting for third box %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
if (!WaitForBoxGrabed()) return true;
- LOG(INFO, "Third box grabbed %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Third box grabbed %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
const bool too_late =
monotonic_now() > start_time + chrono::milliseconds(12500);
if (too_late) {
- LOG(INFO, "Third box too long, going up. %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Third box too long, going up. %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
set_grab_box(false);
set_arm_goal_position(arm::UpIndex());
set_roller_voltage(0.0);
@@ -572,8 +573,8 @@
set_roller_voltage(0.0);
SendSuperstructureGoal();
- LOG(INFO, "Final open %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Final open %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
}
if (!WaitForDriveProfileDone()) return true;