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/y2019/control_loops/drivetrain/localizer.h b/y2019/control_loops/drivetrain/localizer.h
index 1571fec..d716535 100644
--- a/y2019/control_loops/drivetrain/localizer.h
+++ b/y2019/control_loops/drivetrain/localizer.h
@@ -54,14 +54,14 @@
}
if (!SanitizeTargets(targets)) {
- LOG(ERROR, "Throwing out targets due to in insane values.\n");
+ AOS_LOG(ERROR, "Throwing out targets due to in insane values.\n");
return;
}
if (t > HybridEkf::latest_t()) {
- LOG(ERROR,
- "target observations must be older than most recent encoder/gyro "
- "update.\n");
+ AOS_LOG(ERROR,
+ "target observations must be older than most recent encoder/gyro "
+ "update.\n");
return;
}
@@ -111,15 +111,15 @@
if (!(::std::isfinite(reading.heading) &&
::std::isfinite(reading.distance) &&
::std::isfinite(reading.skew) && ::std::isfinite(reading.height))) {
- LOG(ERROR, "Got non-finite values in target.\n");
+ AOS_LOG(ERROR, "Got non-finite values in target.\n");
return false;
}
if (reading.distance < 0) {
- LOG(ERROR, "Got negative distance.\n");
+ AOS_LOG(ERROR, "Got negative distance.\n");
return false;
}
if (::std::abs(::aos::math::NormalizeAngle(reading.skew)) > M_PI_2) {
- LOG(ERROR, "Got skew > pi / 2.\n");
+ AOS_LOG(ERROR, "Got skew > pi / 2.\n");
return false;
}
}
@@ -284,7 +284,7 @@
}
if (camera_views.size() == 0) {
- LOG(DEBUG, "Unable to identify potential target matches.\n");
+ AOS_LOG(DEBUG, "Unable to identify potential target matches.\n");
// If we can't get a match, provide H = zero, which will make this
// correction step a nop.
*h = [](const State &, const Input &) { return Output::Zero(); };
@@ -305,7 +305,7 @@
for (size_t ii = 0; ii < target_views.size(); ++ii) {
size_t view_idx = best_frames[ii];
if (view_idx < 0 || view_idx >= camera_views.size()) {
- LOG(ERROR, "Somehow, the view scorer failed.\n");
+ AOS_LOG(ERROR, "Somehow, the view scorer failed.\n");
h_functions->push_back(
[](const State &, const Input &) { return Output::Zero(); });
dhdx_functions->push_back([](const State &) {
@@ -319,10 +319,10 @@
const TargetView target_view = target_views[ii];
const Scalar match_score = scores(ii, view_idx);
if (match_score > kRejectionScore) {
- LOG(DEBUG,
- "Rejecting target at (%f, %f, %f, %f) due to high score.\n",
- target_view.reading.heading, target_view.reading.distance,
- target_view.reading.skew, target_view.reading.height);
+ AOS_LOG(DEBUG,
+ "Rejecting target at (%f, %f, %f, %f) due to high score.\n",
+ target_view.reading.heading, target_view.reading.distance,
+ target_view.reading.skew, target_view.reading.height);
h_functions->push_back(
[](const State &, const Input &) { return Output::Zero(); });
dhdx_functions->push_back([](const State &) {
@@ -456,7 +456,7 @@
// If we reach here and best_match = -1, that means that no potential
// targets were generated by the camera, and we should never have gotten
// here.
- CHECK(best_match != -1);
+ AOS_CHECK(best_match != -1);
::aos::SizedArray<bool, max_targets_per_frame> sub_views = used_views;
sub_views[ii] = true;
::std::array<bool, num_targets> sub_targets = used_targets;