提交 88f9608b 编写于 作者: L Liangliang Zhang

Planning: use log in common.

上级 69c56f6e
......@@ -14,18 +14,22 @@
* limitations under the License.
*****************************************************************************/
#include <glog/logging.h>
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <vector>
#include "boost/format.hpp"
#include "gtest/gtest.h"
#include "modules/common/log.h"
#include "modules/perception/obstacle/fusion/probabilistic_fusion/pbf_sensor_manager.h"
#include "modules/perception/obstacle/fusion/probabilistic_fusion/pbf_sensor_object.h"
#define protected public
#include "modules/perception/obstacle/fusion/probabilistic_fusion/pbf_track.h"
namespace apollo {
namespace perception {
......
......@@ -11,6 +11,7 @@ cc_library(
"feasible_region.h",
],
deps = [
"//modules/common:log",
"//modules/common/proto:pnc_point_proto",
"//modules/planning/common:planning_gflags",
],
......@@ -26,6 +27,7 @@ cc_library(
],
deps = [
"//modules/common",
"//modules/common:log",
"//modules/common/math:linear_interpolation",
"//modules/common/math:path_matcher",
"//modules/common/proto:pnc_point_proto",
......@@ -34,7 +36,6 @@ cc_library(
"//modules/planning/common:planning_gflags",
"//modules/planning/proto:lattice_structure_proto",
"//modules/planning/reference_line",
"@glog",
],
)
......
......@@ -22,7 +22,7 @@
#include <cmath>
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/planning/common/planning_gflags.h"
namespace apollo {
......
......@@ -70,6 +70,7 @@ cc_library(
"lattice_trajectory1d.h",
],
deps = [
"//modules/common:log",
"//modules/planning/math/curve1d",
],
)
......@@ -84,8 +85,8 @@ cc_library(
],
deps = [
"//modules/common",
"//modules/planning/math/curve1d",
"//modules/planning/common:planning_gflags",
"//modules/planning/math/curve1d",
],
)
......
......@@ -20,7 +20,7 @@
#include "modules/planning/lattice/trajectory1d/lattice_trajectory1d.h"
#include "glog/logging.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......
......@@ -24,8 +24,6 @@
#include "modules/common/log.h"
#include "glog/logging.h"
namespace apollo {
namespace planning {
......
......@@ -20,8 +20,6 @@
#include "modules/planning/lattice/trajectory1d/standing_still_trajectory1d.h"
#include "glog/logging.h"
namespace apollo {
namespace planning {
......
......@@ -22,7 +22,7 @@
#include <cmath>
#include "glog/logging.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......@@ -31,7 +31,6 @@ std::shared_ptr<Curve1d> PiecewiseBrakingTrajectoryGenerator::Generate(
const double s_target, const double s_curr, const double v_target,
const double v_curr, const double a_comfort, const double d_comfort,
const double max_time) {
std::shared_ptr<PiecewiseAccelerationTrajectory1d> ptr_trajectory =
std::make_shared<PiecewiseAccelerationTrajectory1d>(s_curr, v_curr);
......@@ -47,7 +46,7 @@ std::shared_ptr<Curve1d> PiecewiseBrakingTrajectoryGenerator::Generate(
if (ptr_trajectory->ParamLength() < max_time) {
ptr_trajectory->AppendSegment(0.0,
max_time - ptr_trajectory->ParamLength());
max_time - ptr_trajectory->ParamLength());
}
return ptr_trajectory;
}
......@@ -64,7 +63,7 @@ std::shared_ptr<Curve1d> PiecewiseBrakingTrajectoryGenerator::Generate(
if (ptr_trajectory->ParamLength() < max_time) {
ptr_trajectory->AppendSegment(0.0,
max_time - ptr_trajectory->ParamLength());
max_time - ptr_trajectory->ParamLength());
}
return ptr_trajectory;
......@@ -85,15 +84,14 @@ std::shared_ptr<Curve1d> PiecewiseBrakingTrajectoryGenerator::Generate(
if (ptr_trajectory->ParamLength() < max_time) {
ptr_trajectory->AppendSegment(0.0,
max_time - ptr_trajectory->ParamLength());
max_time - ptr_trajectory->ParamLength());
}
return ptr_trajectory;
} else {
double s_rampup_rampdown = s_dist - comfort_stop_dist;
double v_max = std::sqrt(
v_curr * v_curr
+ 2.0 * a_comfort * d_comfort * s_rampup_rampdown
/ (a_comfort + d_comfort));
double v_max = std::sqrt(v_curr * v_curr +
2.0 * a_comfort * d_comfort * s_rampup_rampdown /
(a_comfort + d_comfort));
double t_acc = (v_max - v_curr) / a_comfort;
double t_dec = v_max / d_comfort;
......@@ -104,15 +102,15 @@ std::shared_ptr<Curve1d> PiecewiseBrakingTrajectoryGenerator::Generate(
if (ptr_trajectory->ParamLength() < max_time) {
ptr_trajectory->AppendSegment(0.0,
max_time - ptr_trajectory->ParamLength());
max_time - ptr_trajectory->ParamLength());
}
return ptr_trajectory;
}
}
}
double PiecewiseBrakingTrajectoryGenerator::ComputeStopDistance(const double v,
const double dec) {
double PiecewiseBrakingTrajectoryGenerator::ComputeStopDistance(
const double v, const double dec) {
CHECK(dec > 0.0);
return v * v / dec * 0.5;
}
......
......@@ -20,8 +20,6 @@
#include "modules/planning/math/curve1d/quintic_spiral_path.h"
#include "glog/logging.h"
namespace apollo {
namespace planning {
......@@ -168,24 +166,22 @@ double QuinticSpiralPath::DeriveTheta(const std::size_t param_index,
return derivative;
}
double QuinticSpiralPath::DeriveKappaDerivative(
const std::size_t param_index, const double r) const {
double QuinticSpiralPath::DeriveKappaDerivative(const std::size_t param_index,
const double r) const {
double s = param_ * r;
double s2 = s * s;
double s3 = s2 * s;
double s4 = s2 * s2;
double derivative =
5.0 * coef_deriv_[5][param_index] * s4 +
4.0 * coef_deriv_[4][param_index] * s3 +
3.0 * coef_deriv_[3][param_index] * s2 +
2.0 * coef_deriv_[2][param_index] * s +
coef_deriv_[1][param_index];
double derivative = 5.0 * coef_deriv_[5][param_index] * s4 +
4.0 * coef_deriv_[4][param_index] * s3 +
3.0 * coef_deriv_[3][param_index] * s2 +
2.0 * coef_deriv_[2][param_index] * s +
coef_deriv_[1][param_index];
if (param_index == DELTA_S) {
derivative += 5.0 * coef_[5] * 4.0 * s3 * r +
4.0 * coef_[4] * 3.0 * s2 * r +
3.0 * coef_[3] * 2.0 * s * r +
4.0 * coef_[4] * 3.0 * s2 * r + 3.0 * coef_[3] * 2.0 * s * r +
2.0 * coef_[2] * r;
}
return derivative;
......@@ -210,7 +206,7 @@ double QuinticSpiralPath::DeriveDKappaDerivative(const std::size_t param_index,
}
double QuinticSpiralPath::DeriveD2KappaDerivative(const std::size_t param_index,
const double r) const {
const double r) const {
double s = param_ * r;
double s2 = s * s;
......@@ -219,8 +215,7 @@ double QuinticSpiralPath::DeriveD2KappaDerivative(const std::size_t param_index,
6.0 * coef_deriv_[3][param_index];
if (param_index == DELTA_S) {
derivative += 60.0 * coef_[5] * 2.0 * s * r +
24.0 * coef_[4] * r;
derivative += 60.0 * coef_[5] * 2.0 * s * r + 24.0 * coef_[4] * r;
}
return derivative;
}
......
......@@ -24,7 +24,7 @@
#include <cmath>
#include <utility>
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/common/math/angle.h"
#include "modules/common/math/integral.h"
#include "modules/planning/math/curve1d/quintic_polynomial_curve1d.h"
......
......@@ -19,7 +19,6 @@
**/
#include "modules/planning/math/smoothing_spline/spline_1d_constraint.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
namespace apollo {
......
......@@ -19,7 +19,6 @@
**/
#include "modules/planning/math/smoothing_spline/spline_1d_generator.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
namespace apollo {
......
......@@ -19,7 +19,6 @@
**/
#include "modules/planning/math/smoothing_spline/spline_1d_kernel.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
namespace apollo {
......
......@@ -19,7 +19,6 @@
**/
#include "modules/planning/math/smoothing_spline/spline_2d_constraint.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
namespace apollo {
......
......@@ -19,9 +19,10 @@
**/
#include "modules/planning/math/smoothing_spline/spline_2d_kernel.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
#include "modules/common/log.h"
namespace apollo {
namespace planning {
......
......@@ -11,6 +11,7 @@ cc_library(
"navi_path_decider.h",
],
deps = [
"//modules/common:log",
"//modules/common/configs:vehicle_config_helper",
"//modules/common/math",
"//modules/common/status",
......@@ -18,11 +19,10 @@ cc_library(
"//modules/planning/common:frame",
"//modules/planning/common:planning_gflags",
"//modules/planning/common:reference_line_info",
"//modules/planning/navi/decider:navi_obstacle_decider",
"//modules/planning/proto:planning_config_proto",
"//modules/planning/proto:planning_proto",
"//modules/planning/toolkits/optimizers:task",
"//modules/planning/navi/decider:navi_obstacle_decider",
"@glog",
],
)
......@@ -37,6 +37,7 @@ cc_library(
"navi_speed_ts_graph.h",
],
deps = [
"//modules/common:log",
"//modules/common/configs:vehicle_config_helper",
"//modules/common/math",
"//modules/common/status",
......@@ -48,7 +49,6 @@ cc_library(
"//modules/planning/proto:planning_config_proto",
"//modules/planning/proto:planning_proto",
"//modules/planning/toolkits/optimizers:task",
"@glog",
],
)
......@@ -61,8 +61,10 @@ cc_library(
"navi_obstacle_decider.h",
],
deps = [
"//modules/common:log",
"//modules/common/configs:vehicle_config_helper",
"//modules/common/math",
"//modules/common/math:path_matcher",
"//modules/common/status",
"//modules/map/proto:map_proto",
"//modules/planning/common:frame",
......@@ -71,8 +73,6 @@ cc_library(
"//modules/planning/proto:planning_config_proto",
"//modules/planning/proto:planning_proto",
"//modules/planning/toolkits/optimizers:task",
"//modules/common/math:path_matcher",
"@glog",
],
)
......@@ -80,17 +80,16 @@ cc_test(
name = "navi_decider_test",
size = "small",
srcs = [
"navi_obstacle_decider_test.cc",
"navi_path_decider_test.cc",
"navi_speed_decider_test.cc",
"navi_speed_ts_graph_test.cc",
"navi_obstacle_decider_test.cc",
],
data = ["//modules/planning:planning_testdata"],
deps = [
":navi_obstacle_decider",
":navi_path_decider",
":navi_speed_decider",
":navi_obstacle_decider",
"//modules/common:log",
"//modules/common/time",
"//modules/common/util",
"@gtest//:main",
......
......@@ -30,8 +30,7 @@
#include <utility>
#include <vector>
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/common/math/line_segment2d.h"
#include "modules/common/math/linear_interpolation.h"
#include "modules/common/math/path_matcher.h"
......
......@@ -25,8 +25,8 @@
#include <limits>
#include <utility>
#include "glog/logging.h"
#include "modules/common/configs/vehicle_config_helper.h"
#include "modules/common/log.h"
#include "modules/common/math/vec2d.h"
#include "modules/planning/common/planning_gflags.h"
#include "modules/planning/proto/sl_boundary.pb.h"
......
......@@ -25,9 +25,8 @@
#include <cmath>
#include <limits>
#include "glog/logging.h"
#include "modules/common/configs/vehicle_config_helper.h"
#include "modules/common/log.h"
#include "modules/common/math/math_utils.h"
#include "modules/planning/common/planning_gflags.h"
......
......@@ -24,8 +24,6 @@
#include <algorithm>
#include <cmath>
#include "glog/logging.h"
#include "modules/common/log.h"
#include "modules/common/math/math_utils.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册