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/y2017/actors/autonomous_actor.cc b/y2017/actors/autonomous_actor.cc
index fa072ac..a678e79 100644
--- a/y2017/actors/autonomous_actor.cc
+++ b/y2017/actors/autonomous_actor.cc
@@ -49,7 +49,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 (params.mode) {
@@ -129,12 +130,12 @@
StartDrive(kLongPegDrive, -kDriveDirection * M_PI / 4, kGearDrive,
kFirstGearStartTurn);
if (!WaitForDriveNear(100.0, M_PI / 8.0)) return true;
- LOG(INFO, "Turn Middle: %f left to go\n", DriveDistanceLeft());
+ AOS_LOG(INFO, "Turn Middle: %f left to go\n", DriveDistanceLeft());
StartDrive(0.0, 0.0, kGearDrive, kFirstGearTurn);
if (!WaitForTurnProfileDone()) return true;
- LOG(INFO, "Turn profile ended: %f left to go\n", DriveDistanceLeft());
+ AOS_LOG(INFO, "Turn profile ended: %f left to go\n", DriveDistanceLeft());
set_hood_goal(0.43);
set_shooter_velocity(364.0);
@@ -179,8 +180,8 @@
set_gear_servo(0.4);
SendSuperstructureGoal();
- LOG(INFO, "Starting drive back %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Starting drive back %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
StartDrive(-2.75, kDriveDirection * 1.24, kSlowDrive,
kFirstGearStartTurn);
@@ -202,8 +203,8 @@
if (!WaitForDriveNear(0.2, 0.2)) return true;
StartDrive(0.0, -kDriveDirection * 0.15, kSlowDrive, kSmashTurn);
- LOG(INFO, "Starting second shot %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Starting second shot %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
set_indexer_angular_velocity(-2.15 * M_PI);
SendSuperstructureGoal();
if (!WaitForDriveNear(0.2, 0.1)) return true;
@@ -236,11 +237,11 @@
StartDrive(-3.42, kDriveDirection * (M_PI / 10 - 0.057), kSlowDrive,
kFirstTurn);
if (!WaitForDriveNear(3.30, 0.0)) return true;
- LOG(INFO, "Turn ended: %f left to go\n", DriveDistanceLeft());
+ AOS_LOG(INFO, "Turn ended: %f left to go\n", DriveDistanceLeft());
// We can go to 2.50 before we hit the previous profile.
if (!WaitForDriveNear(2.48, 0.0)) return true;
- LOG(INFO, "%f left to go\n", DriveDistanceLeft());
+ AOS_LOG(INFO, "%f left to go\n", DriveDistanceLeft());
set_intake_goal(0.23);
set_turret_goal(0.0);
@@ -279,8 +280,8 @@
set_indexer_angular_velocity(-2.1 * M_PI);
SendSuperstructureGoal();
- LOG(INFO, "Started shooting at %f\n",
- ::aos::time::DurationInSeconds(monotonic_now() - start_time));
+ AOS_LOG(INFO, "Started shooting at %f\n",
+ ::aos::time::DurationInSeconds(monotonic_now() - start_time));
this_thread::sleep_for(start_time + chrono::seconds(9) - monotonic_now());
if (ShouldCancel()) return true;
@@ -300,8 +301,8 @@
} break;
}
- 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(),
@@ -310,7 +311,7 @@
while (!ShouldCancel()) {
phased_loop.SleepUntilNext();
}
- LOG(DEBUG, "Done running\n");
+ AOS_LOG(DEBUG, "Done running\n");
return true;
}
diff --git a/y2017/actors/autonomous_actor.h b/y2017/actors/autonomous_actor.h
index c10b003..f5d4c3f 100644
--- a/y2017/actors/autonomous_actor.h
+++ b/y2017/actors/autonomous_actor.h
@@ -125,7 +125,7 @@
}
if (!new_superstructure_goal.Send()) {
- LOG(ERROR, "Sending superstructure goal failed.\n");
+ AOS_LOG(ERROR, "Sending superstructure goal failed.\n");
}
}
};
diff --git a/y2017/constants.cc b/y2017/constants.cc
index 6f77838..e765acf 100644
--- a/y2017/constants.cc
+++ b/y2017/constants.cc
@@ -146,7 +146,7 @@
break;
default:
- LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
+ AOS_LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
}
return r;
@@ -154,7 +154,7 @@
const Values *DoGetValues() {
uint16_t team = ::aos::network::GetTeamNumber();
- LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team);
+ AOS_LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team);
return DoGetValuesForTeam(team);
}
diff --git a/y2017/control_loops/superstructure/column/column.cc b/y2017/control_loops/superstructure/column/column.cc
index 2a3cde7..ab1ff72 100644
--- a/y2017/control_loops/superstructure/column/column.cc
+++ b/y2017/control_loops/superstructure/column/column.cc
@@ -71,10 +71,10 @@
const double indexer_doffset = indexer_offset - offset_(0, 0);
const double turret_doffset = turret_offset - offset_(1, 0);
- LOG(INFO, "Adjusting indexer offset from %f to %f\n", offset_(0, 0),
- indexer_offset);
- LOG(INFO, "Adjusting turret offset from %f to %f\n", offset_(1, 0),
- turret_offset);
+ AOS_LOG(INFO, "Adjusting indexer offset from %f to %f\n", offset_(0, 0),
+ indexer_offset);
+ AOS_LOG(INFO, "Adjusting turret offset from %f to %f\n", offset_(1, 0),
+ turret_offset);
loop_->mutable_X_hat()(0, 0) += indexer_doffset;
loop_->mutable_X_hat()(2, 0) += turret_doffset + indexer_doffset;
@@ -99,7 +99,7 @@
estimators_[0].UpdateEstimate(new_position);
if (estimators_[0].error()) {
- LOG(ERROR, "zeroing error\n");
+ AOS_LOG(ERROR, "zeroing error\n");
return;
}
@@ -162,13 +162,13 @@
// Limit the goal to min/max allowable positions.
if (zeroed()) {
if ((*goal)(2, 0) > range_.upper) {
- LOG(WARNING, "Goal %s above limit, %f > %f\n", name, (*goal)(2, 0),
- range_.upper);
+ AOS_LOG(WARNING, "Goal %s above limit, %f > %f\n", name, (*goal)(2, 0),
+ range_.upper);
(*goal)(2, 0) = range_.upper;
}
if ((*goal)(2, 0) < range_.lower) {
- LOG(WARNING, "Goal %s below limit, %f < %f\n", name, (*goal)(2, 0),
- range_.lower);
+ AOS_LOG(WARNING, "Goal %s below limit, %f < %f\n", name, (*goal)(2, 0),
+ range_.lower);
(*goal)(2, 0) = range_.lower;
}
} else {
@@ -181,13 +181,13 @@
// Upper - lower hard may be a bit generous, but we are moving slow.
if ((*goal)(2, 0) > kMaxRange) {
- LOG(WARNING, "Goal %s above limit, %f > %f\n", name, (*goal)(2, 0),
- kMaxRange);
+ AOS_LOG(WARNING, "Goal %s above limit, %f > %f\n", name, (*goal)(2, 0),
+ kMaxRange);
(*goal)(2, 0) = kMaxRange;
}
if ((*goal)(2, 0) < -kMaxRange) {
- LOG(WARNING, "Goal %s below limit, %f < %f\n", name, (*goal)(2, 0),
- -kMaxRange);
+ AOS_LOG(WARNING, "Goal %s below limit, %f < %f\n", name, (*goal)(2, 0),
+ -kMaxRange);
(*goal)(2, 0) = -kMaxRange;
}
}
@@ -241,7 +241,7 @@
loop_->mutable_X_hat(4, 0) = 0.0;
loop_->mutable_X_hat(5, 0) = 0.0;
- LOG(INFO, "Resetting\n");
+ AOS_LOG(INFO, "Resetting\n");
stuck_indexer_detector_->mutable_X_hat() = loop_->X_hat();
should_reset_ = false;
saturated_ = false;
@@ -294,9 +294,9 @@
if (turret_position() > range_.upper_hard ||
turret_position() < range_.lower_hard) {
- LOG(ERROR,
- "ColumnProfiledSubsystem at %f out of bounds [%f, %f], ESTOPing\n",
- turret_position(), range_.lower_hard, range_.upper_hard);
+ AOS_LOG(ERROR,
+ "ColumnProfiledSubsystem at %f out of bounds [%f, %f], ESTOPing\n",
+ turret_position(), range_.lower_hard, range_.upper_hard);
return true;
}
@@ -465,7 +465,8 @@
profiled_subsystem_.goal(2, 0) -
kStuckZeroingTrackingError ||
profiled_subsystem_.saturated()) {
- LOG(INFO,
+ AOS_LOG(
+ INFO,
"Turret stuck going positive, switching directions. At %f, goal "
"%f\n",
profiled_subsystem_.turret_position(),
@@ -499,7 +500,8 @@
kStuckZeroingTrackingError ||
profiled_subsystem_.saturated()) {
// The turret got too far behind. Declare it stuck and reverse.
- LOG(INFO,
+ AOS_LOG(
+ INFO,
"Turret stuck going negative, switching directions. At %f, goal "
"%f\n",
profiled_subsystem_.turret_position(),
@@ -530,7 +532,8 @@
if (unsafe_turret_goal->track) {
if (vision_time_adjuster_.valid()) {
- LOG(INFO, "Vision aligning to %f\n", vision_time_adjuster_.goal());
+ AOS_LOG(INFO, "Vision aligning to %f\n",
+ vision_time_adjuster_.goal());
profiled_subsystem_.set_turret_unprofiled_goal(
vision_time_adjuster_.goal() + vision_error_);
}
@@ -552,7 +555,7 @@
} break;
case State::ESTOP:
- LOG(ERROR, "Estop\n");
+ AOS_LOG(ERROR, "Estop\n");
disable = true;
break;
}
@@ -574,8 +577,8 @@
indexer_state_ = IndexerState::REVERSING;
last_transition_time_ = monotonic_now;
profiled_subsystem_.PartialIndexerReset();
- LOG(INFO, "Partial indexer reset while going forwards\n");
- LOG(INFO, "Indexer RUNNING -> REVERSING\n");
+ AOS_LOG(INFO, "Partial indexer reset while going forwards\n");
+ AOS_LOG(INFO, "Indexer RUNNING -> REVERSING\n");
}
break;
case IndexerState::REVERSING:
@@ -588,12 +591,12 @@
monotonic_now > last_transition_time_ + kReverseMinTimeout) ||
monotonic_now > kReverseTimeout + last_transition_time_) {
indexer_state_ = IndexerState::RUNNING;
- LOG(INFO, "Indexer REVERSING -> RUNNING, stuck %d\n",
- profiled_subsystem_.IsIndexerStuck());
+ AOS_LOG(INFO, "Indexer REVERSING -> RUNNING, stuck %d\n",
+ profiled_subsystem_.IsIndexerStuck());
// Only reset if we got stuck going this way too.
if (monotonic_now > kReverseTimeout + last_transition_time_) {
- LOG(INFO, "Partial indexer reset while reversing\n");
+ AOS_LOG(INFO, "Partial indexer reset while reversing\n");
profiled_subsystem_.PartialIndexerReset();
}
last_transition_time_ = monotonic_now;
diff --git a/y2017/control_loops/superstructure/column/column_zeroing.cc b/y2017/control_loops/superstructure/column/column_zeroing.cc
index d5a378c..30500ca 100644
--- a/y2017/control_loops/superstructure/column/column_zeroing.cc
+++ b/y2017/control_loops/superstructure/column/column_zeroing.cc
@@ -25,7 +25,7 @@
void ColumnZeroingEstimator::TriggerError() {
if (!error_) {
- LOG(ERROR, "Manually triggered zeroing error.\n");
+ AOS_LOG(ERROR, "Manually triggered zeroing error.\n");
error_ = true;
}
}
diff --git a/y2017/control_loops/superstructure/hood/hood.cc b/y2017/control_loops/superstructure/hood/hood.cc
index 862a32c..8588a16 100644
--- a/y2017/control_loops/superstructure/hood/hood.cc
+++ b/y2017/control_loops/superstructure/hood/hood.cc
@@ -40,13 +40,13 @@
// enough to find them (and the index pulse which might be right next to
// one).
if ((*goal)(0, 0) > kMaxRange) {
- LOG(WARNING, "Goal %s above limit, %f > %f\n", name, (*goal)(0, 0),
- kMaxRange);
+ AOS_LOG(WARNING, "Goal %s above limit, %f > %f\n", name, (*goal)(0, 0),
+ kMaxRange);
(*goal)(0, 0) = kMaxRange;
}
if ((*goal)(0, 0) < -kMaxRange) {
- LOG(WARNING, "Goal %s below limit, %f < %f\n", name, (*goal)(0, 0),
- kMaxRange);
+ AOS_LOG(WARNING, "Goal %s below limit, %f < %f\n", name, (*goal)(0, 0),
+ kMaxRange);
(*goal)(0, 0) = -kMaxRange;
}
}
@@ -71,7 +71,7 @@
switch (state_) {
case State::UNINITIALIZED:
// Wait in the uninitialized state until the hood is initialized.
- LOG(DEBUG, "Uninitialized, waiting for hood\n");
+ AOS_LOG(DEBUG, "Uninitialized, waiting for hood\n");
if (profiled_subsystem_.initialized()) {
state_ = State::DISABLED_INITIALIZED;
}
@@ -163,7 +163,7 @@
} break;
case State::ESTOP:
- LOG(ERROR, "Estop\n");
+ AOS_LOG(ERROR, "Estop\n");
disable = true;
break;
}
diff --git a/y2017/control_loops/superstructure/intake/intake.cc b/y2017/control_loops/superstructure/intake/intake.cc
index 76c44a4..baa4693 100644
--- a/y2017/control_loops/superstructure/intake/intake.cc
+++ b/y2017/control_loops/superstructure/intake/intake.cc
@@ -39,7 +39,7 @@
switch (state_) {
case State::UNINITIALIZED:
// Wait in the uninitialized state until the intake is initialized.
- LOG(DEBUG, "Uninitialized, waiting for intake\n");
+ AOS_LOG(DEBUG, "Uninitialized, waiting for intake\n");
if (profiled_subsystem_.initialized()) {
state_ = State::DISABLED_INITIALIZED;
}
@@ -101,8 +101,8 @@
// Force the intake to be at least at min_position_ out.
if (profiled_subsystem_.unprofiled_goal(0, 0) < min_position_) {
- LOG(DEBUG, "Limiting intake to %f from %f\n", min_position_,
- profiled_subsystem_.unprofiled_goal(0, 0));
+ AOS_LOG(DEBUG, "Limiting intake to %f from %f\n", min_position_,
+ profiled_subsystem_.unprofiled_goal(0, 0));
profiled_subsystem_.set_unprofiled_goal(min_position_);
}
@@ -114,7 +114,7 @@
} break;
case State::ESTOP:
- LOG(ERROR, "Estop\n");
+ AOS_LOG(ERROR, "Estop\n");
disable = true;
break;
}
diff --git a/y2017/control_loops/superstructure/shooter/shooter.cc b/y2017/control_loops/superstructure/shooter/shooter.cc
index 5023e6f..2b668ae 100644
--- a/y2017/control_loops/superstructure/shooter/shooter.cc
+++ b/y2017/control_loops/superstructure/shooter/shooter.cc
@@ -145,7 +145,7 @@
} else if (!status->ready) {
min_ = ::std::min(min_, wheel_.dt_velocity());
} else if (!last_ready_ && status->ready) {
- LOG(INFO, "Shot min was [%f]\n", min_);
+ AOS_LOG(INFO, "Shot min was [%f]\n", min_);
}
if (output) {
diff --git a/y2017/control_loops/superstructure/superstructure.cc b/y2017/control_loops/superstructure/superstructure.cc
index e7f7ca8..3ad1747 100644
--- a/y2017/control_loops/superstructure/superstructure.cc
+++ b/y2017/control_loops/superstructure/superstructure.cc
@@ -58,7 +58,7 @@
const ::aos::monotonic_clock::time_point monotonic_now =
event_loop()->monotonic_now();
if (WasReset()) {
- LOG(ERROR, "WPILib reset, restarting\n");
+ AOS_LOG(ERROR, "WPILib reset, restarting\n");
hood_.Reset();
intake_.Reset();
shooter_.Reset();
@@ -96,7 +96,7 @@
if (::std::abs(robot_velocity) > 0.2) {
if (unsafe_goal->use_vision_for_shots) {
- LOG(INFO, "Moving too fast, resetting\n");
+ AOS_LOG(INFO, "Moving too fast, resetting\n");
}
distance_average_.Reset();
}
@@ -114,11 +114,12 @@
in_range = false;
}
}
- LOG(DEBUG, "VisionDistance %f, hood %f shooter %f, indexer %f * M_PI\n",
+ AOS_LOG(
+ DEBUG, "VisionDistance %f, hood %f shooter %f, indexer %f * M_PI\n",
status->vision_distance, hood_goal.angle,
shooter_goal.angular_velocity, indexer_goal.angular_velocity / M_PI);
} else {
- LOG(DEBUG, "VisionNotValid %f\n", status->vision_distance);
+ AOS_LOG(DEBUG, "VisionNotValid %f\n", status->vision_distance);
if (unsafe_goal->use_vision_for_shots) {
in_range = false;
indexer_goal.angular_velocity = 0.0;
@@ -174,7 +175,7 @@
// Make some noise if someone left this set...
if (ignore_collisions_) {
- LOG(ERROR, "Collisions ignored\n");
+ AOS_LOG(ERROR, "Collisions ignored\n");
}
intake_.Iterate(unsafe_goal != nullptr ? &(unsafe_goal->intake) : nullptr,
diff --git a/y2017/control_loops/superstructure/superstructure_lib_test.cc b/y2017/control_loops/superstructure/superstructure_lib_test.cc
index d1cb15f..1e763b8 100644
--- a/y2017/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2017/control_loops/superstructure/superstructure_lib_test.cc
@@ -308,18 +308,18 @@
? superstructure::intake::Intake::kOperatingVoltage
: superstructure::intake::Intake::kZeroingVoltage;
- CHECK_LE(::std::abs(superstructure_output_fetcher_->voltage_hood),
- voltage_check_hood);
+ AOS_CHECK_LE(::std::abs(superstructure_output_fetcher_->voltage_hood),
+ voltage_check_hood);
- CHECK_LE(::std::abs(superstructure_output_fetcher_->voltage_intake),
- voltage_check_intake);
+ AOS_CHECK_LE(::std::abs(superstructure_output_fetcher_->voltage_intake),
+ voltage_check_intake);
EXPECT_LE(::std::abs(superstructure_output_fetcher_->voltage_indexer),
voltage_check_indexer)
<< ": check voltage " << voltage_check_indexer;
- CHECK_LE(::std::abs(superstructure_output_fetcher_->voltage_turret),
- voltage_check_turret);
+ AOS_CHECK_LE(::std::abs(superstructure_output_fetcher_->voltage_turret),
+ voltage_check_turret);
::Eigen::Matrix<double, 1, 1> hood_U;
hood_U << superstructure_output_fetcher_->voltage_hood +
@@ -375,15 +375,15 @@
// The hood is special. We don't want to fault when we hit the hard stop.
// We want to freeze the hood at the hard stop.
if (angle_hood > constants::Values::kHoodRange.upper_hard) {
- LOG(INFO, "At the hood upper hard stop of %f\n",
- constants::Values::kHoodRange.upper_hard);
+ AOS_LOG(INFO, "At the hood upper hard stop of %f\n",
+ constants::Values::kHoodRange.upper_hard);
angle_hood = constants::Values::kHoodRange.upper_hard;
hood_plant_->mutable_X(0, 0) = angle_hood;
hood_plant_->mutable_X(1, 0) = 0.0;
hood_plant_->UpdateY(hood_U);
} else if (angle_hood < constants::Values::kHoodRange.lower_hard) {
- LOG(INFO, "At the hood lower hard stop of %f\n",
- constants::Values::kHoodRange.lower_hard);
+ AOS_LOG(INFO, "At the hood lower hard stop of %f\n",
+ constants::Values::kHoodRange.lower_hard);
angle_hood = constants::Values::kHoodRange.lower_hard;
hood_plant_->mutable_X(0, 0) = angle_hood;
hood_plant_->mutable_X(1, 0) = 0.0;
@@ -397,16 +397,16 @@
// The expected zeroing procedure involves yanking on the wires for the
// turret in some cases. So, implement the hard stop like the hood.
if (angle_turret > constants::Values::kTurretRange.upper_hard) {
- LOG(INFO, "At the turret upper hard stop of %f\n",
- constants::Values::kTurretRange.upper_hard);
+ AOS_LOG(INFO, "At the turret upper hard stop of %f\n",
+ constants::Values::kTurretRange.upper_hard);
angle_turret = constants::Values::kTurretRange.upper_hard;
column_plant_->mutable_X(2, 0) = angle_turret;
column_plant_->mutable_X(3, 0) = 0.0;
column_plant_->UpdateY(column_U);
} else if (angle_turret < constants::Values::kTurretRange.lower_hard) {
- LOG(INFO, "At the turret lower hard stop of %f\n",
- constants::Values::kTurretRange.lower_hard);
+ AOS_LOG(INFO, "At the turret lower hard stop of %f\n",
+ constants::Values::kTurretRange.lower_hard);
angle_turret = constants::Values::kTurretRange.lower_hard;
column_plant_->mutable_X(2, 0) = angle_turret;
column_plant_->mutable_X(3, 0) = 0.0;
@@ -1190,9 +1190,9 @@
chrono::milliseconds(1050));
EXPECT_TRUE(unstuck_detection_time - unstuck_start_time >
chrono::milliseconds(400));
- LOG(INFO, "Unstuck time is %" PRId64 "ms",
- static_cast<int64_t>(
- (unstuck_detection_time - unstuck_start_time).count() / 1000000));
+ AOS_LOG(INFO, "Unstuck time is %" PRId64 "ms",
+ static_cast<int64_t>(
+ (unstuck_detection_time - unstuck_start_time).count() / 1000000));
// Now, make sure it transitions to stuck again after a delay.
const auto restuck_start_time = monotonic_now();
diff --git a/y2017/control_loops/superstructure/vision_time_adjuster.cc b/y2017/control_loops/superstructure/vision_time_adjuster.cc
index 4952f6d..a67c5f2 100644
--- a/y2017/control_loops/superstructure/vision_time_adjuster.cc
+++ b/y2017/control_loops/superstructure/vision_time_adjuster.cc
@@ -140,9 +140,9 @@
&drivetrain_angle);
if (column_angle_is_valid && drivetrain_angle_is_valid) {
- LOG(INFO, "Accepting Vision angle of %f, age %f\n",
- most_recent_vision_angle_,
- ::aos::time::DurationInSeconds(monotonic_now - last_target_time));
+ AOS_LOG(INFO, "Accepting Vision angle of %f, age %f\n",
+ most_recent_vision_angle_,
+ ::aos::time::DurationInSeconds(monotonic_now - last_target_time));
most_recent_vision_reading_ = vision_status->angle;
most_recent_vision_angle_ =
vision_status->angle + column_angle + drivetrain_angle;
@@ -151,8 +151,8 @@
}
goal_ = most_recent_vision_angle_ - most_recent_drivetrain_angle_;
- LOG(DEBUG, "Vision angle %f drivetrain %f\n", most_recent_vision_angle_,
- most_recent_drivetrain_angle_);
+ AOS_LOG(DEBUG, "Vision angle %f drivetrain %f\n", most_recent_vision_angle_,
+ most_recent_drivetrain_angle_);
// Now, update the vision valid flag to tell us if we have a valid vision
// angle within the last seven seconds.
diff --git a/y2017/joystick_reader.cc b/y2017/joystick_reader.cc
index a5470d4..3bbbeb2 100644
--- a/y2017/joystick_reader.cc
+++ b/y2017/joystick_reader.cc
@@ -72,7 +72,7 @@
superstructure_status_fetcher_.Fetch();
if (!superstructure_status_fetcher_.get()) {
- LOG(ERROR, "Got no superstructure status packet.\n");
+ AOS_LOG(ERROR, "Got no superstructure status packet.\n");
return;
}
@@ -243,9 +243,9 @@
new_superstructure_goal->indexer.angular_velocity = 0.0;
}
- LOG_STRUCT(DEBUG, "sending goal", *new_superstructure_goal);
+ AOS_LOG_STRUCT(DEBUG, "sending goal", *new_superstructure_goal);
if (!new_superstructure_goal.Send()) {
- LOG(ERROR, "Sending superstructure goal failed.\n");
+ AOS_LOG(ERROR, "Sending superstructure goal failed.\n");
}
}
diff --git a/y2017/vision/target_receiver.cc b/y2017/vision/target_receiver.cc
index 163e1f1..6b86972 100644
--- a/y2017/vision/target_receiver.cc
+++ b/y2017/vision/target_receiver.cc
@@ -56,9 +56,9 @@
&new_vision_status->distance, &new_vision_status->angle);
}
- LOG_STRUCT(DEBUG, "vision", *new_vision_status);
+ AOS_LOG_STRUCT(DEBUG, "vision", *new_vision_status);
if (!new_vision_status.Send()) {
- LOG(ERROR, "Failed to send vision information\n");
+ AOS_LOG(ERROR, "Failed to send vision information\n");
}
}
}
diff --git a/y2017/wpilib_interface.cc b/y2017/wpilib_interface.cc
index 4fac858..e55e350 100644
--- a/y2017/wpilib_interface.cc
+++ b/y2017/wpilib_interface.cc
@@ -260,7 +260,7 @@
auto_mode_message->mode |= 1 << i;
}
}
- LOG_STRUCT(DEBUG, "auto mode", *auto_mode_message);
+ AOS_LOG_STRUCT(DEBUG, "auto mode", *auto_mode_message);
auto_mode_message.Send();
}
}
@@ -315,13 +315,13 @@
void Loop(const int iterations) {
if (iterations != 1) {
- LOG(DEBUG, "Solenoids skipped %d iterations\n", iterations - 1);
+ AOS_LOG(DEBUG, "Solenoids skipped %d iterations\n", iterations - 1);
}
{
superstructure_output_fetcher_.Fetch();
if (superstructure_output_fetcher_.get()) {
- LOG_STRUCT(DEBUG, "solenoids", *superstructure_output_fetcher_);
+ AOS_LOG_STRUCT(DEBUG, "solenoids", *superstructure_output_fetcher_);
lights_->Set(superstructure_output_fetcher_->lights_on);
rgb_lights_->Set(superstructure_output_fetcher_->red_light_on |
superstructure_output_fetcher_->green_light_on |
@@ -387,7 +387,7 @@
private:
virtual void Write(const SuperstructureQueue::Output &output) override {
- LOG_STRUCT(DEBUG, "will output", output);
+ AOS_LOG_STRUCT(DEBUG, "will output", output);
intake_victor_->SetSpeed(::aos::Clip(output.voltage_intake,
-kMaxBringupPower, kMaxBringupPower) /
12.0);
@@ -410,7 +410,7 @@
}
virtual void Stop() override {
- LOG(WARNING, "Superstructure output too old.\n");
+ AOS_LOG(WARNING, "Superstructure output too old.\n");
intake_victor_->SetDisabled();
intake_rollers_victor_->SetDisabled();
indexer_victor_->SetDisabled();