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;
diff --git a/y2018/actors/autonomous_actor.h b/y2018/actors/autonomous_actor.h
index 4cedff3..3ef7677 100644
--- a/y2018/actors/autonomous_actor.h
+++ b/y2018/actors/autonomous_actor.h
@@ -95,7 +95,7 @@
new_superstructure_goal->trajectory_override = false;
if (!new_superstructure_goal.Send()) {
- LOG(ERROR, "Sending superstructure goal failed.\n");
+ AOS_LOG(ERROR, "Sending superstructure goal failed.\n");
}
}
@@ -151,9 +151,9 @@
arm_goal_position_ &&
superstructure_status_fetcher_->arm.path_distance_to_go <
arm_threshold) {
- LOG(INFO, "Arm finished first: %f, drivetrain %f distance\n",
- superstructure_status_fetcher_->arm.path_distance_to_go,
- ::std::abs(distance_to_go));
+ AOS_LOG(INFO, "Arm finished first: %f, drivetrain %f distance\n",
+ superstructure_status_fetcher_->arm.path_distance_to_go,
+ ::std::abs(distance_to_go));
return true;
}
@@ -161,10 +161,10 @@
if (::std::abs(profile_distance_to_go) <
drive_threshold + kProfileTolerance &&
::std::abs(distance_to_go) < drive_threshold + kPositionTolerance) {
- LOG(INFO,
- "Drivetrain finished first: arm %f, drivetrain %f distance\n",
- superstructure_status_fetcher_->arm.path_distance_to_go,
- ::std::abs(distance_to_go));
+ AOS_LOG(INFO,
+ "Drivetrain finished first: arm %f, drivetrain %f distance\n",
+ superstructure_status_fetcher_->arm.path_distance_to_go,
+ ::std::abs(distance_to_go));
return true;
}
}
diff --git a/y2018/constants.cc b/y2018/constants.cc
index 5fb7161..97a62a1 100644
--- a/y2018/constants.cc
+++ b/y2018/constants.cc
@@ -128,7 +128,7 @@
break;
default:
- LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
+ AOS_LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
}
return r;
@@ -136,7 +136,7 @@
const Values &DoGetValues() {
const 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 GetValuesForTeam(team);
}
diff --git a/y2018/control_loops/superstructure/arm/arm.cc b/y2018/control_loops/superstructure/arm/arm.cc
index d3cb262..2ae1996 100644
--- a/y2018/control_loops/superstructure/arm/arm.cc
+++ b/y2018/control_loops/superstructure/arm/arm.cc
@@ -36,8 +36,8 @@
points_(PointList()) {
int i = 0;
for (const auto &trajectory : trajectories_) {
- LOG(INFO, "trajectory length for edge node %d: %f\n", i,
- trajectory.trajectory.path().length());
+ AOS_LOG(INFO, "trajectory length for edge node %d: %f\n", i,
+ trajectory.trajectory.path().length());
++i;
}
}
@@ -113,7 +113,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");
state_ = State::ZEROING;
proximal_zeroing_estimator_.Reset();
distal_zeroing_estimator_.Reset();
@@ -188,7 +188,7 @@
// TODO(austin): Pick some sane limits.
if (proximal_zeroing_estimator_.error() ||
distal_zeroing_estimator_.error()) {
- LOG(ERROR, "Zeroing error ESTOP\n");
+ AOS_LOG(ERROR, "Zeroing error ESTOP\n");
state_ = State::ESTOP;
} else if (outputs_disabled && brownout_count_ > kMaxBrownoutCount) {
state_ = State::DISABLED;
@@ -213,7 +213,7 @@
break;
case State::ESTOP:
- LOG(ERROR, "Estop\n");
+ AOS_LOG(ERROR, "Estop\n");
break;
}
@@ -338,9 +338,9 @@
if (state_ == State::RUNNING && unsafe_goal != nullptr) {
if (current_node_ != filtered_goal) {
- LOG(INFO, "Goal is different\n");
+ AOS_LOG(INFO, "Goal is different\n");
if (filtered_goal >= search_graph_.num_vertexes()) {
- LOG(ERROR, "goal node out of range ESTOP\n");
+ AOS_LOG(ERROR, "goal node out of range ESTOP\n");
state_ = State::ESTOP;
} else if (follower_.path_distance_to_go() > 1e-3) {
// Still on the old path segment. Can't change yet.
@@ -360,9 +360,9 @@
// Ok, now we know which edge we are on. Figure out the path and
// trajectory.
const SearchGraph::Edge &next_edge = search_graph_.edges()[min_edge];
- LOG(INFO, "Switching from node %d to %d along edge %d\n",
- static_cast<int>(current_node_), static_cast<int>(next_edge.end),
- static_cast<int>(min_edge));
+ AOS_LOG(INFO, "Switching from node %d to %d along edge %d\n",
+ static_cast<int>(current_node_),
+ static_cast<int>(next_edge.end), static_cast<int>(min_edge));
vmax_ = trajectories_[min_edge].vmax;
follower_.SwitchTrajectory(&trajectories_[min_edge].trajectory);
current_node_ = next_edge.end;
@@ -376,7 +376,7 @@
: (state_ == State::GOTO_PATH ? kGotoPathVMax() : kPathlessVMax());
follower_.Update(arm_ekf_.X_hat(), disable, kDt(), vmax_,
max_operating_voltage);
- LOG(INFO, "Max voltage: %f\n", max_operating_voltage);
+ AOS_LOG(INFO, "Max voltage: %f\n", max_operating_voltage);
status->goal_theta0 = follower_.theta(0);
status->goal_theta1 = follower_.theta(1);
status->goal_omega0 = follower_.omega(0);
diff --git a/y2018/control_loops/superstructure/arm/trajectory.cc b/y2018/control_loops/superstructure/arm/trajectory.cc
index 2157ca7..bd67ce3 100644
--- a/y2018/control_loops/superstructure/arm/trajectory.cc
+++ b/y2018/control_loops/superstructure/arm/trajectory.cc
@@ -492,7 +492,6 @@
U_ff_.setZero();
U_.setZero();
U_unsaturated_.setZero();
- LOG(INFO, "Disabled\n");
} else {
const ::Eigen::Matrix<double, 6, 1> R =
trajectory_->R(theta_, ::Eigen::Matrix<double, 2, 1>::Zero());
diff --git a/y2018/control_loops/superstructure/intake/intake.cc b/y2018/control_loops/superstructure/intake/intake.cc
index 6707356..6c07a49 100644
--- a/y2018/control_loops/superstructure/intake/intake.cc
+++ b/y2018/control_loops/superstructure/intake/intake.cc
@@ -107,7 +107,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");
zeroing_estimator_.Reset();
controller_.Reset();
state_ = State::ZEROING;
@@ -116,7 +116,7 @@
case State::ZEROING:
// Zero by not moving.
if (zeroing_estimator_.zeroed()) {
- LOG(INFO, "Now zeroed\n");
+ AOS_LOG(INFO, "Now zeroed\n");
controller_.UpdateOffset(zeroing_estimator_.offset());
state_ = State::RUNNING;
}
@@ -124,23 +124,23 @@
case State::RUNNING:
if (!(zeroing_estimator_.zeroed())) {
- LOG(ERROR, "Zeroing estimator is no longer zeroed\n");
+ AOS_LOG(ERROR, "Zeroing estimator is no longer zeroed\n");
state_ = State::UNINITIALIZED;
}
if (zeroing_estimator_.error()) {
- LOG(ERROR, "Zeroing estimator error\n");
+ AOS_LOG(ERROR, "Zeroing estimator error\n");
state_ = State::UNINITIALIZED;
}
// ESTOP if we hit the hard limits.
if ((status->motor_position) > controller_.intake_range_.upper ||
(status->motor_position) < controller_.intake_range_.lower) {
- LOG(ERROR, "Hit hard limits\n");
+ AOS_LOG(ERROR, "Hit hard limits\n");
state_ = State::ESTOP;
}
break;
case State::ESTOP:
- LOG(ERROR, "Estop\n");
+ AOS_LOG(ERROR, "Estop\n");
break;
}
diff --git a/y2018/control_loops/superstructure/superstructure.cc b/y2018/control_loops/superstructure/superstructure.cc
index 572a7b0..a2dcaf6 100644
--- a/y2018/control_loops/superstructure/superstructure.cc
+++ b/y2018/control_loops/superstructure/superstructure.cc
@@ -48,7 +48,7 @@
const 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");
intake_left_.Reset();
intake_right_.Reset();
arm_.Reset();
@@ -299,7 +299,7 @@
new_status_light->blue = blue;
if (!new_status_light.Send()) {
- LOG(ERROR, "Failed to send lights.\n");
+ AOS_LOG(ERROR, "Failed to send lights.\n");
}
}
diff --git a/y2018/control_loops/superstructure/superstructure_lib_test.cc b/y2018/control_loops/superstructure/superstructure_lib_test.cc
index 1d4cf5d..162db33 100644
--- a/y2018/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2018/control_loops/superstructure/superstructure_lib_test.cc
@@ -89,7 +89,7 @@
const double voltage_check =
superstructure::intake::IntakeSide::kOperatingVoltage();
- CHECK_LE(::std::abs(intake_voltage.voltage_elastic), voltage_check);
+ AOS_CHECK_LE(::std::abs(intake_voltage.voltage_elastic), voltage_check);
::Eigen::Matrix<double, 1, 1> U;
U << intake_voltage.voltage_elastic + plant_.voltage_offset();
@@ -155,8 +155,8 @@
constexpr double voltage_check =
superstructure::arm::Arm::kOperatingVoltage();
- CHECK_LE(::std::abs(U(0)), voltage_check);
- CHECK_LE(::std::abs(U(1)), voltage_check);
+ AOS_CHECK_LE(::std::abs(U(0)), voltage_check);
+ AOS_CHECK_LE(::std::abs(U(1)), voltage_check);
if (release_arm_brake) {
X_ = arm::Dynamics::UnboundedDiscreteDynamics(X_, U, 0.00505);
@@ -240,7 +240,7 @@
left_intake_.GetSensorValues(&position->left_intake);
right_intake_.GetSensorValues(&position->right_intake);
arm_.GetSensorValues(&position->arm);
- LOG_STRUCT(INFO, "sim position", *position);
+ AOS_LOG_STRUCT(INFO, "sim position", *position);
position.Send();
}
diff --git a/y2018/joystick_reader.cc b/y2018/joystick_reader.cc
index b4c4efa..54c5f8d 100644
--- a/y2018/joystick_reader.cc
+++ b/y2018/joystick_reader.cc
@@ -116,7 +116,7 @@
superstructure_status_fetcher_.Fetch();
if (!superstructure_status_fetcher_.get() ||
!superstructure_position_fetcher_.get()) {
- LOG(ERROR, "Got no superstructure status packet.\n");
+ AOS_LOG(ERROR, "Got no superstructure status packet.\n");
return;
}
@@ -307,7 +307,7 @@
}
if (data.IsPressed(kWinch)) {
- LOG(INFO, "Winching\n");
+ AOS_LOG(INFO, "Winching\n");
new_superstructure_goal->voltage_winch = 12.0;
} else {
new_superstructure_goal->voltage_winch = 0.0;
@@ -333,9 +333,9 @@
new_superstructure_goal->grab_box = grab_box;
- 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");
}
video_tx_->Send(vision_control_);
diff --git a/y2018/vision/image_streamer.cc b/y2018/vision/image_streamer.cc
index c4320f2..4050260 100644
--- a/y2018/vision/image_streamer.cc
+++ b/y2018/vision/image_streamer.cc
@@ -87,7 +87,7 @@
}
size_t Recv(void *data, int size) {
- return PCHECK(recv(fd(), static_cast<char *>(data), size, 0));
+ return AOS_PCHECK(recv(fd(), static_cast<char *>(data), size, 0));
}
};
@@ -312,7 +312,7 @@
params0, "/dev/video0", &tcp_server_, true,
[&camera0, &camera1, &status_socket, &vision_status]() {
vision_status.set_low_frame_count(vision_status.low_frame_count() + 1);
- LOG(INFO, "Got a frame cam0\n");
+ AOS_LOG(INFO, "Got a frame cam0\n");
if (camera0->active()) {
status_socket.Send(vision_status);
}
@@ -325,7 +325,7 @@
[&camera0, &camera1, &status_socket, &vision_status]() {
vision_status.set_high_frame_count(vision_status.high_frame_count() +
1);
- LOG(INFO, "Got a frame cam1\n");
+ AOS_LOG(INFO, "Got a frame cam1\n");
if (camera1->active()) {
status_socket.Send(vision_status);
}
@@ -343,7 +343,8 @@
cam0_active = true;
camera0->set_active(true);
}
- LOG(INFO, "Got control packet, cam%d active\n", cam0_active ? 0 : 1);
+ AOS_LOG(INFO, "Got control packet, cam%d active\n",
+ cam0_active ? 0 : 1);
});
// Default to camera0
diff --git a/y2018/vision/vision_status.cc b/y2018/vision/vision_status.cc
index 3d3faf5..2f358c5 100644
--- a/y2018/vision/vision_status.cc
+++ b/y2018/vision/vision_status.cc
@@ -30,9 +30,9 @@
auto new_vision_status = vision_status_sender_.MakeMessage();
new_vision_status->high_frame_count = status.high_frame_count();
new_vision_status->low_frame_count = status.low_frame_count();
- 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/y2018/wpilib_interface.cc b/y2018/wpilib_interface.cc
index 903301e..b93d2b0 100644
--- a/y2018/wpilib_interface.cc
+++ b/y2018/wpilib_interface.cc
@@ -395,13 +395,13 @@
int32_t status = 0;
HAL_CompressorHandle compressor_ = HAL_InitializeCompressor(0, &status);
if (status != 0) {
- LOG(ERROR, "Compressor status is nonzero, %d\n",
- static_cast<int>(status));
+ AOS_LOG(ERROR, "Compressor status is nonzero, %d\n",
+ static_cast<int>(status));
}
HAL_SetCompressorClosedLoopControl(compressor_, true, &status);
if (status != 0) {
- LOG(ERROR, "Compressor status is nonzero, %d\n",
- static_cast<int>(status));
+ AOS_LOG(ERROR, "Compressor status is nonzero, %d\n",
+ static_cast<int>(status));
}
event_loop_->AddPhasedLoop([this](int iterations) { Loop(iterations); },
@@ -443,13 +443,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);
}
{
drivetrain_fetcher_.Fetch();
if (drivetrain_fetcher_.get()) {
- LOG_STRUCT(DEBUG, "solenoids", *drivetrain_fetcher_);
+ AOS_LOG_STRUCT(DEBUG, "solenoids", *drivetrain_fetcher_);
left_drivetrain_shifter_->Set(!drivetrain_fetcher_->left_high);
right_drivetrain_shifter_->Set(!drivetrain_fetcher_->right_high);
}
@@ -458,7 +458,7 @@
{
superstructure_fetcher_.Fetch();
if (superstructure_fetcher_.get()) {
- LOG_STRUCT(DEBUG, "solenoids", *superstructure_fetcher_);
+ AOS_LOG_STRUCT(DEBUG, "solenoids", *superstructure_fetcher_);
claw_->Set(!superstructure_fetcher_->claw_grabbed);
arm_brakes_->Set(superstructure_fetcher_->release_arm_brake);
@@ -472,7 +472,7 @@
pcm_->Flush();
to_log.read_solenoids = pcm_->GetAll();
- LOG_STRUCT(DEBUG, "pneumatics info", to_log);
+ AOS_LOG_STRUCT(DEBUG, "pneumatics info", to_log);
}
monotonic_clock::time_point monotonic_now = event_loop_->monotonic_now();
@@ -502,10 +502,10 @@
light_flash_ = 0;
}
- LOG_STRUCT(DEBUG, "color", color);
+ AOS_LOG_STRUCT(DEBUG, "color", color);
SetColor(color);
} else {
- LOG_STRUCT(DEBUG, "color", *status_light_fetcher_);
+ AOS_LOG_STRUCT(DEBUG, "color", *status_light_fetcher_);
SetColor(*status_light_fetcher_);
}
}
@@ -601,7 +601,7 @@
private:
virtual void Write(const SuperstructureQueue::Output &output) override {
- LOG_STRUCT(DEBUG, "will output", output);
+ AOS_LOG_STRUCT(DEBUG, "will output", output);
left_intake_elastic_victor_->SetSpeed(
::aos::Clip(-output.left_intake.voltage_elastic, -kMaxBringupPower,
@@ -637,7 +637,7 @@
}
virtual void Stop() override {
- LOG(WARNING, "Superstructure output too old.\n");
+ AOS_LOG(WARNING, "Superstructure output too old.\n");
left_intake_rollers_victor_->SetDisabled();
right_intake_rollers_victor_->SetDisabled();