提交 f003f8d3 编写于 作者: Y Yajia Zhang 提交者: Kecheng Xu

planning: removed forward decleration in speed_optimizer.h

上级 415f70d2
......@@ -38,9 +38,7 @@ namespace planning {
using common::SpeedPoint;
using ConstPathObstacleList = std::vector<const PathObstacle*>;
namespace {
constexpr double kEpsilontol = 1e-6;
}
QpFrenetFrame::QpFrenetFrame(const ReferenceLine& reference_line,
const ConstPathObstacleList& path_obstacles,
......@@ -66,13 +64,14 @@ bool QpFrenetFrame::Init(const uint32_t num_points) {
return false;
}
const double resolution = (end_s_ - start_s_) / num_points;
if (Double::Compare(start_s_, end_s_, 1e-8) > 0) {
AERROR << "Not enough s distance. start_s: " << start_s_
<< ", end_s: " << end_s_;
return false;
}
const double resolution = (end_s_ - start_s_) / num_points;
if (!CalculateDiscretizedVehicleLocation()) {
AERROR << "Fail to calculate discretized vehicle location!";
return false;
......
......@@ -124,14 +124,14 @@ bool QpSplinePathGenerator::Generate(
Eigen::Vector2d xy_point =
CartesianFrenetConverter::CalculateCartesianPoint(
ref_point.heading(), {ref_point.x(), ref_point.y()}, l);
xy_point[0] = xy_point.x() - x_diff;
xy_point[1] = xy_point.y() - y_diff;
xy_point[0] = xy_point[0] - x_diff;
xy_point[1] = xy_point[1] - y_diff;
double theta = CartesianFrenetConverter::CalculateTheta(
ref_point.heading(), ref_point.kappa(), l, dl);
double kappa = CartesianFrenetConverter::CalculateKappa(
ref_point.kappa(), ref_point.dkappa(), l, dl, ddl);
common::PathPoint path_point = common::util::MakePathPoint(
xy_point.x(), xy_point.y(), 0.0, theta, kappa, 0.0, 0.0);
xy_point[0], xy_point[1], 0.0, theta, kappa, 0.0, 0.0);
if (path_points.size() != 0) {
double distance =
common::util::Distance2D(path_points.back(), path_point);
......
......@@ -24,6 +24,8 @@
#include <string>
#include <vector>
#include "modules/planning/common/speed_limit.h"
#include "modules/planning/common/speed/speed_data.h"
#include "modules/planning/optimizer/optimizer.h"
#include "modules/common/status/status.h"
......@@ -32,9 +34,6 @@
namespace apollo {
namespace planning {
class SpeedLimit;
class SpeedData;
class SpeedOptimizer : public Optimizer {
public:
explicit SpeedOptimizer(const std::string& name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册