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/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();
}