提交 0493e595 编写于 作者: A Aaron Xiao 提交者: Jiangtao Hu

Switch from glog to apollo common log.

上级 7f0c37b8
......@@ -20,7 +20,7 @@
#include "modules/planning/common/frame.h"
#include "glog/logging.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......
......@@ -20,7 +20,7 @@
#include "modules/planning/common/logic_node.h"
#include "glog/logging.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......
......@@ -21,8 +21,8 @@
#include "modules/planning/common/path/discretized_path.h"
#include <utility>
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/planning/common/path/path_point_util.h"
namespace apollo {
......@@ -88,7 +88,7 @@ std::size_t DiscretizedPath::num_of_points() const {
const common::PathPoint& DiscretizedPath::path_point_at(
const std::size_t index) const {
CHECK(index < path_points_.size());
CHECK_LT(index, path_points_.size());
return path_points_[index];
}
......@@ -103,7 +103,7 @@ common::PathPoint DiscretizedPath::end_point() const {
}
common::PathPoint& DiscretizedPath::path_point_at(const std::size_t index) {
CHECK(index < path_points_.size());
CHECK_LT(index, path_points_.size());
return path_points_[index];
}
......
......@@ -20,8 +20,8 @@
#include "modules/planning/common/path/frenet_frame_path.h"
#include <utility>
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/common/proto/path_point.pb.h"
namespace apollo {
......@@ -49,12 +49,12 @@ std::size_t FrenetFramePath::num_points() const { return points_.size(); }
const common::FrenetFramePoint& FrenetFramePath::point_at(
const std::size_t index) const {
CHECK(index < points_.size());
CHECK_LT(index, points_.size());
return points_[index];
}
common::FrenetFramePoint& FrenetFramePath::point_at(const std::size_t index) {
CHECK(index < points_.size());
CHECK_LT(index, points_.size());
return points_[index];
}
......
......@@ -21,8 +21,8 @@
#include "modules/planning/common/path/path_data.h"
#include <sstream>
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/planning/math/double.h"
namespace apollo {
......@@ -64,7 +64,7 @@ bool PathData::get_path_point_with_path_s(
} else {
double s0 = (it_lower - 1)->s();
double s1 = it_lower->s();
CHECK(s0 < s1);
CHECK_LT(s0, s1);
*path_point =
util::interpolate_linear_approximation(*(it_lower - 1), *it_lower, s);
}
......@@ -93,7 +93,7 @@ bool PathData::get_path_point_with_ref_s(
// double ref_s0 = (it_lower - 1)->s();
// double ref_s1 = it_lower->s();
//
// CHECK(ref_s0 < ref_s1);
// CHECK_LT(ref_s0, ref_s1);
// double weight = (ref_s - ref_s0) / (ref_s1 - ref_s0);
// *path_point =
// common::PathPoint::interpolate_linear_approximation(path_.path_point_at(index_lower
......
......@@ -22,7 +22,7 @@
#include <climits>
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/planning/common/path/path_point_util.h"
namespace apollo {
......@@ -120,7 +120,7 @@ void DiscretizedTrajectory::add_trajectory_point(
const TrajectoryPoint& DiscretizedTrajectory::trajectory_point_at(
const std::size_t index) const {
CHECK(index < num_of_points());
CHECK_LT(index, num_of_points());
return _trajectory_points[index];
}
......
......@@ -7,11 +7,11 @@ cc_library(
srcs = [
"double.cc",
],
hdrs = glob([
hdrs = [
"double.h",
]),
],
deps = [
"@glog//:glog",
"//modules/common:log",
],
)
......@@ -20,10 +20,8 @@ cc_library(
srcs = [
"curve_math.cc",
],
hdrs = glob([
hdrs = [
"curve_math.h",
]),
deps = [
],
)
......@@ -32,11 +30,11 @@ cc_library(
srcs = [
"integration.cc",
],
hdrs = glob([
hdrs = [
"integration.h",
]),
],
deps = [
"@glog//:glog",
"//modules/common:log",
],
)
......@@ -45,11 +43,11 @@ cc_library(
srcs = [
"polynomial_xd.cc",
],
hdrs = glob([
hdrs = [
"polynomial_xd.h",
]),
],
deps = [
"@glog//:glog",
"//modules/common:log",
],
)
......@@ -58,9 +56,9 @@ cc_library(
srcs = [
"sl_analytic_transformation.cc",
],
hdrs = glob([
hdrs = [
"sl_analytic_transformation.h",
]),
],
deps = [
":double",
"@eigen//:eigen",
......@@ -69,23 +67,23 @@ cc_library(
cc_library(
name = "interpolation",
hdrs = glob([
hdrs = [
"interpolation.h",
]),
],
deps = [
":hermite_spline",
"//modules/common:log",
"//modules/common/math:math_utils",
"@glog//:glog",
],
)
cc_library(
name = "hermite_spline",
hdrs = glob([
hdrs = [
"hermite_spline.h",
]),
],
deps = [
"@glog//:glog",
"//modules/common:log",
],
)
......
......@@ -7,8 +7,6 @@ cc_library(
hdrs = [
"curve1d.h",
],
deps = [
],
)
cc_library(
......@@ -30,8 +28,8 @@ cc_library(
"quartic_polynomial_curve1d.h",
],
deps = [
"polynomial_curve1d",
"@glog//:glog",
":polynomial_curve1d",
"//modules/common:log",
],
)
......@@ -44,8 +42,8 @@ cc_library(
"quintic_polynomial_curve1d.h",
],
deps = [
"polynomial_curve1d",
"@glog//:glog",
":polynomial_curve1d",
"//modules/common:log",
],
)
......
......@@ -21,7 +21,8 @@
#include "modules/planning/math/curve1d/quartic_polynomial_curve1d.h"
#include <string>
#include "glog/logging.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......@@ -79,7 +80,7 @@ double QuarticPolynomialCurve1d::param_length() const { return param_; }
void QuarticPolynomialCurve1d::compute_coefficients(
const double x0, const double dx0, const double ddx0, const double dx1,
const double ddx1, const double p) {
CHECK(p > 0.0);
CHECK_GT(p, 0.0);
param_ = p;
......
......@@ -20,7 +20,7 @@
#include "modules/planning/math/curve1d/quintic_polynomial_curve1d.h"
#include "glog/logging.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......@@ -88,7 +88,7 @@ double QuinticPolynomialCurve1d::evaluate(const size_t order,
void QuinticPolynomialCurve1d::compute_coefficients(
const double x0, const double dx0, const double ddx0, const double x1,
const double dx1, const double ddx1, const double p) {
CHECK(p > 0.0);
CHECK_GT(p, 0.0);
coef_[5] = x0;
coef_[4] = dx0;
......
......@@ -18,7 +18,7 @@
#include <cmath>
#include "glog/logging.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......
......@@ -11,9 +11,9 @@ cc_library(
"cartesian_frenet_conversion.h",
],
deps = [
"//modules/common:log",
"//modules/common/math:vec2d",
"//modules/common/math:math_utils",
"@glog//:glog",
],
)
......
......@@ -21,8 +21,8 @@
#include "modules/planning/math/frame_conversion/cartesian_frenet_conversion.h"
#include <cmath>
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/common/math/math_utils.h"
namespace apollo {
......
......@@ -23,7 +23,7 @@
#include <utility>
#include "glog/logging.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......@@ -54,8 +54,8 @@ inline HermiteSpline<T, N>::HermiteSpline(std::array<T, (N + 1) / 2> x0,
std::array<T, (N + 1) / 2> x1,
const double z0, const double z1)
: _x0(std::move(x0)), _x1(std::move(x1)), _z0(z0), delta_z_(z1 - z0) {
CHECK((N == 3 || N == 5) &&
"Error: currently we only support cubic and quintic hermite splines!");
CHECK(N == 3 || N == 5)
<< "Error: currently we only support cubic and quintic hermite splines!";
}
template <typename T, std::size_t N>
......@@ -174,7 +174,7 @@ inline T HermiteSpline<T, N>::evaluate(const std::size_t order,
default: { break; }
}
}
CHECK(false && "Error: unsupported order of spline or derivative!");
AFATAL << "Error: unsupported order of spline or derivative!";
T t;
return t;
}
......
......@@ -22,7 +22,7 @@
#include <array>
#include "glog/logging.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......
......@@ -24,7 +24,7 @@
#include <array>
#include <cmath>
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/common/math/math_utils.h"
#include "modules/planning/math/hermite_spline.h"
......@@ -80,9 +80,9 @@ inline std::array<T, N> Interpolation::hermite(const std::array<T, N>& x0,
const std::array<T, N>& x1,
const double p1,
const double p) {
CHECK((N == 2 || N == 3) &&
"Error: currently hermite interpolation "
"only supports cubic and quintic!");
CHECK(N == 2 || N == 3)
<< "Error: currently hermite interpolation only supports cubic and "
"quintic!";
HermiteSpline<T, 2 * N - 1> hermite_spline(x0, x1, p0, p1);
std::array<T, N> x;
......
......@@ -107,7 +107,6 @@ cc_library(
"//modules/common/math/qp_solver",
"//modules/common/math/qp_solver:active_set_qp_solver",
"@eigen//:eigen",
"@glog//:glog",
],
)
......@@ -137,7 +136,6 @@ cc_library(
":spline_2d_seg",
"//modules/planning/math:polynomial_xd",
"@eigen//:eigen",
"@glog//:glog",
],
)
......
......@@ -19,7 +19,8 @@
**/
#include "modules/planning/math/smoothing_spline/affine_constraint.h"
#include "glog/logging.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......@@ -33,7 +34,7 @@ AffineConstraint::AffineConstraint(const Eigen::MatrixXd& constraint_matrix,
: constraint_matrix_(constraint_matrix),
constraint_boundary_(constraint_boundary),
is_equality_(is_equality) {
CHECK(constraint_boundary.rows() == constraint_matrix.rows());
CHECK_EQ(constraint_boundary.rows(), constraint_matrix.rows());
}
void AffineConstraint::set_is_equality(const double is_equality) {
......
......@@ -52,7 +52,6 @@
#include <vector>
#include "Eigen/Core"
#include "glog/logging.h"
#include "modules/common/math/qp_solver/qp_solver.h"
#include "modules/planning/math/smoothing_spline/spline_1d.h"
......
......@@ -148,8 +148,7 @@ std::size_t Spline2d::spline_order() const { return spline_order_; }
std::size_t Spline2d::find_index(const double t) const {
auto upper_bound = std::upper_bound(t_knots_.begin() + 1, t_knots_.end(), t);
return std::min(t_knots_.size() - 1,
static_cast<std::size_t>(upper_bound - t_knots_.begin())) -
1;
static_cast<std::size_t>(upper_bound - t_knots_.begin())) - 1;
}
} // namespace planning
......
......@@ -26,7 +26,6 @@
#include <vector>
#include "Eigen/Core"
#include "glog/logging.h"
#include "modules/planning/math/polynomial_xd.h"
#include "modules/planning/math/smoothing_spline/spline_2d_seg.h"
......
......@@ -40,11 +40,11 @@ cc_library(
deps = [
":spiral_curve",
":spiral_formula",
"//modules/common:log",
"//modules/common/proto:error_code_proto",
"//modules/common/proto:path_point_proto",
"//modules/planning/math:integration",
"@eigen//:eigen",
"@glog//:glog",
],
)
......@@ -59,10 +59,10 @@ cc_library(
deps = [
":spiral_curve",
":spiral_formula",
"//modules/common:log",
"//modules/common/proto:path_point_proto",
"//modules/planning/math:integration",
"@eigen//:eigen",
"@glog//:glog",
],
)
......
......@@ -22,8 +22,8 @@
#include <algorithm>
#include "Eigen/Core"
#include "Eigen/LU"
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/planning/math/integration.h"
#include "modules/planning/math/spiral_curve/spiral_formula.h"
......
......@@ -33,6 +33,7 @@
#define MODULES_PLANNING_MATH_SPIRAL_CURVE_CUBIC_SPIRAL_CURVE_H_
#include <vector>
#include "modules/common/proto/error_code.pb.h"
#include "modules/common/proto/path_point.pb.h"
#include "modules/planning/math/spiral_curve/spiral_curve.h"
......
......@@ -22,8 +22,8 @@
#include <algorithm>
#include "Eigen/Core"
#include "Eigen/LU"
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/planning/math/integration.h"
#include "modules/planning/math/spiral_curve/spiral_formula.h"
......
......@@ -35,6 +35,7 @@
#define MODULES_PLANNING_MATH_SPIRAL_CURVE_QUINTIC_SPIRAL_CURVE_H_
#include <vector>
#include "modules/common/proto/error_code.pb.h"
#include "modules/common/proto/path_point.pb.h"
#include "modules/planning/math/spiral_curve/spiral_curve.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册