提交 e9016edb 编写于 作者: J jiangyifei 提交者: Jiangtao Hu

[planning] updated qp st speed with new config.

上级 2a49d7a3
......@@ -336,13 +336,6 @@ DEFINE_string(planning_config_file,
"modules/planning/conf/planning_config.pb.txt",
"planning config file");
DEFINE_string(st_boundary_config_file,
"modules/planning/conf/st_boundary_config_file.pb.txt",
"The config file for st_boundary_config.");
DEFINE_string(qp_spline_st_speed_config_file,
"modules/planning/conf/qp_spline_st_speed_config_file.pb.txt",
"The config file for qp_spline_st_speed_config_file.");
DEFINE_int32(trajectory_point_num_for_debug, 10,
"number of output trajectory points for debugging");
......
......@@ -220,10 +220,6 @@ DECLARE_double(max_deacceleration_for_yellow_light_stop);
DECLARE_string(reference_line_smoother_config_file);
// Optimizers
DECLARE_string(st_boundary_config_file);
DECLARE_string(qp_spline_st_speed_config_file);
DECLARE_int32(trajectory_point_num_for_debug);
DECLARE_string(offline_routing_file);
DECLARE_double(backward_routing_distance);
......
total_path_length: 80.0
total_time: 8.0
output_time_resolution: 0.05
number_of_discrete_graph_s: 80
number_of_discrete_graph_t: 10
number_of_evaluated_graph_t: 20
spline_order: 6
speed_kernel_weight: 0.0
accel_kernel_weight: 0.0
jerk_kernel_weight: 1000.0
follow_weight: 1.0
stop_weight: 1.0
cruise_weight: 1.0
max_speed: 20.0
max_acceleration: 4.5
max_deceleration: -4.5
reference_line_kernel_weight: 1.0
boundary_buffer: 0.1
minimal_follow_time: 3.0
follow_buffer: 1.0
follow_coeff:1.0
follow_speed_threshold: 10.0
follow_speed_damping_factor: 0.7
success_tunnel:0.01
expanding_coeff: 1.2
follow_distance_buffer: 5.0
centric_acceleration_limit: 1.0
kappa_threshold: 0.04
minimal_kappa: 0.00001
maximal_speed: 25.0
speed_limit_on_u_turn: 1.5
point_extension: 1.0
speed_multiply_buffer: 0.9
lowest_speed: 2.5
......@@ -36,10 +36,6 @@ DEFINE_string(test_chassis_file,
DEFINE_string(test_prediction_file, "", "The prediction module test file");
void PlanningTestBase::SetUpTestCase() {
FLAGS_qp_spline_st_speed_config_file =
"modules/planning/testdata/conf/qp_spline_st_speed_config_file.pb.txt";
FLAGS_st_boundary_config_file =
"modules/planning/testdata/conf/st_boundary_config_file.pb.txt";
FLAGS_planning_config_file =
"modules/planning/testdata/conf/planning_config.pb.txt";
FLAGS_adapter_config_path = "modules/planning/testdata/conf/adapter.conf";
......
......@@ -33,14 +33,15 @@ class QpSplinePathOptimizerTest : public ::testing::Test {
virtual void SetUp() {
FLAGS_reference_line_smoother_config_file =
"modules/planning/testdata/conf/reference_line_smoother_config.pb.txt";
FLAGS_qp_spline_path_config_file =
"modules/planning/testdata/qp_spline_path/qp_spline_path_config.pb.txt";
FLAGS_planning_config_file =
"modules/planning/testdata/qp_spline_path/planning_config.pb.txt";
optimizer_.reset(new QpSplinePathOptimizer(""));
frame.reset(new Frame(1));
hdmap::PncMap* pnc_map;
pnc_map = new hdmap::PncMap("modules/planning/testdata/base_map.txt");
Frame::SetMap(pnc_map);
LoadPlanningConfig();
planning_pb = LoadPlanningPb(
"modules/planning/testdata"
"/qp_spline_path/42_apollo_planning.pb.txt");
......@@ -58,6 +59,13 @@ class QpSplinePathOptimizerTest : public ::testing::Test {
return std::move(planning_pb);
}
void LoadPlanningConfig() {
PlanningPb planning_pb;
CHECK(apollo::common::util::GetProtoFromFile(FLAGS_planning_config_file,
&planning_config_))
<< "Failed to open file " << FLAGS_planning_config_file;
}
common::TrajectoryPoint GetInitPoint() {
common::TrajectoryPoint init_point;
common::VehicleState::instance()->Update(
......@@ -82,6 +90,7 @@ class QpSplinePathOptimizerTest : public ::testing::Test {
std::unique_ptr<Frame> frame;
PlanningPb planning_pb;
std::unique_ptr<Optimizer> optimizer_;
PlanningConfig planning_config_;
};
TEST_F(QpSplinePathOptimizerTest, Process) {
......@@ -91,7 +100,7 @@ TEST_F(QpSplinePathOptimizerTest, Process) {
PlanningData* planning_data = frame->mutable_planning_data();
EXPECT_EQ(planning_data->path_data().discretized_path().path_points().size()
, 0);
optimizer_->Init();
optimizer_->Init(planning_config_);
optimizer_->Optimize(frame.get());
common::Path qp_path_ground_truth;
......@@ -110,7 +119,7 @@ TEST_F(QpSplinePathOptimizerTest, Process) {
qp_path_ground_truth.path_point().Get(i);
common::PathPoint computed_point = planning_data
->path_data().discretized_path().path_points()[i];
EXPECT_NEAR(ground_truth_point.x(), computed_point.x(), 1.0e-3);
EXPECT_NEAR(ground_truth_point.x(), computed_point.x(), 1.0e-2);
EXPECT_NEAR(ground_truth_point.y(), computed_point.y(), 1.0e-3);
EXPECT_NEAR(ground_truth_point.kappa(), computed_point.kappa(), 1.0e-3);
EXPECT_NEAR(ground_truth_point.theta(), computed_point.theta(), 1.0e-3);
......
......@@ -43,20 +43,9 @@ QpSplineStSpeedOptimizer::QpSplineStSpeedOptimizer(const std::string& name)
: SpeedOptimizer(name) {}
bool QpSplineStSpeedOptimizer::Init(const PlanningConfig& config) {
// load boundary mapper
if (!common::util::GetProtoFromFile(FLAGS_st_boundary_config_file,
&st_boundary_config_)) {
AERROR << "Failed to load config file: " << FLAGS_st_boundary_config_file;
return false;
}
// load qp_spline_st_speed_config_
if (!common::util::GetProtoFromFile(FLAGS_qp_spline_st_speed_config_file,
&qp_spline_st_speed_config_)) {
AERROR << "Failed to load config file: "
<< FLAGS_qp_spline_st_speed_config_file;
return false;
}
qp_spline_st_speed_config_ =
config.em_planner_config().qp_spline_st_speed_config();
st_boundary_config_ = qp_spline_st_speed_config_.st_boundary_config();
is_init_ = true;
return true;
}
......
......@@ -34,15 +34,10 @@ class QpSplineStSpeedOptimizerTest : public ::testing::Test {
virtual void SetUp() {
FLAGS_reference_line_smoother_config_file =
"modules/planning/testdata/conf/reference_line_smoother_config.pb.txt";
FLAGS_qp_spline_path_config_file =
"modules/planning/testdata/qp_spline_path/qp_spline_path_config.pb.txt";
FLAGS_qp_spline_st_speed_config_file =
"modules/planning/testdata/qp_spline_st_speed"
"/qp_spline_st_speed_config_file.pb.txt";
FLAGS_st_boundary_config_file =
"modules/planning/testdata/qp_spline_st_speed"
"/st_boundary_config_file.pb.txt";
FLAGS_planning_config_file =
"modules/planning/testdata/qp_spline_st_speed/planning_config.pb.txt";
LoadPlanningConfig();
optimizer_.reset(new QpSplineStSpeedOptimizer("ST_SPEED"));
planning_pb = LoadPlanningPb(
"modules/planning/testdata"
......@@ -58,6 +53,13 @@ class QpSplineStSpeedOptimizerTest : public ::testing::Test {
return std::move(planning_pb);
}
void LoadPlanningConfig() {
PlanningPb planning_pb;
CHECK(apollo::common::util::GetProtoFromFile(FLAGS_planning_config_file,
&planning_config_))
<< "Failed to open file " << FLAGS_planning_config_file;
}
void InitFrame() {
frame.reset(new Frame(1));
hdmap::PncMap* pnc_map;
......@@ -99,13 +101,14 @@ class QpSplineStSpeedOptimizerTest : public ::testing::Test {
std::unique_ptr<Frame> frame;
PlanningPb planning_pb;
std::unique_ptr<Optimizer> optimizer_;
PlanningConfig planning_config_;
};
TEST_F(QpSplineStSpeedOptimizerTest, Process) {
PlanningData* planning_data = frame->mutable_planning_data();
EXPECT_EQ(planning_data->speed_data().speed_vector().size()
, 0);
optimizer_->Init();
optimizer_->Init(planning_config_);
optimizer_->Optimize(frame.get());
planning_internal::STGraphDebug st_graph_ground_truth;
......
planner_type : EM
em_planner_config {
optimizer : DP_POLY_PATH_OPTIMIZER
optimizer : DP_ST_SPEED_OPTIMIZER
optimizer : QP_SPLINE_PATH_OPTIMIZER
optimizer : QP_SPLINE_ST_SPEED_OPTIMIZER
dp_poly_path_config {
sample_level: 8
sample_points_num_each_level: 9
step_length_max: 15.0
step_length_min: 8.0
lateral_sample_offset: 0.5
lateral_adjust_coeff: 0.5
eval_time_interval: 0.1
path_resolution: 0.1
}
dp_st_speed_config {
total_path_length: 80
total_time: 8.0
matrix_dimension_s: 200
matrix_dimension_t: 20
speed_weight: 0.0
accel_weight: 10.0
jerk_weight: 10.0
obstacle_weight: 1.0
reference_weight: 0.0
go_down_buffer: 5.0
go_up_buffer: 5.0
default_obstacle_cost: 1e10
obstacle_cost_factor: -300
default_speed_cost: 1.0
exceed_speed_penalty: 10.0
low_speed_penalty: 2.5
accel_penalty: 2.0
decel_penalty: 2.0
positive_jerk_coeff: 1.0
negative_jerk_coeff: 300.0
max_speed: 20.0
max_acceleration: 4.5
max_deceleration: -4.5
st_boundary_config {
boundary_buffer: 0.1
minimal_follow_time: 3.0
follow_buffer: 1.0
follow_coeff:1.0
follow_speed_threshold: 10.0
follow_speed_damping_factor: 0.7
success_tunnel:0.01
expanding_coeff: 1.2
follow_distance_buffer: 5.0
centric_acceleration_limit: 1.0
kappa_threshold: 0.04
minimal_kappa: 0.00001
maximal_speed: 25.0
speed_limit_on_u_turn: 1.5
point_extension: 1.0
speed_multiply_buffer: 0.9
lowest_speed: 2.5
}
}
qp_spline_path_config {
spline_order: 6
number_of_knots: 5
number_of_fx_constraint_knots: 13
time_resolution: 0.1
regularization_weight: 0.1
derivative_weight: 1.0
second_derivative_weight: 0.0
third_derivative_weight: 10.0
reference_line_weight: 0.0
num_refline_point: 10
num_output: 100
}
qp_spline_st_speed_config {
total_path_length: 80.0
total_time: 8.0
output_time_resolution: 0.05
number_of_discrete_graph_s: 80
number_of_discrete_graph_t: 10
number_of_evaluated_graph_t: 20
spline_order: 6
speed_kernel_weight: 0.0
accel_kernel_weight: 0.0
jerk_kernel_weight: 1000.0
follow_weight: 1.0
stop_weight: 1.0
cruise_weight: 1.0
max_speed: 20.0
max_acceleration: 4.5
max_deceleration: -4.5
reference_line_kernel_weight: 1.0
st_boundary_config {
boundary_buffer: 0.1
minimal_follow_time: 3.0
follow_buffer: 1.0
follow_coeff:1.0
follow_speed_threshold: 10.0
follow_speed_damping_factor: 0.7
success_tunnel:0.01
expanding_coeff: 1.2
follow_distance_buffer: 5.0
centric_acceleration_limit: 1.0
kappa_threshold: 0.04
minimal_kappa: 0.00001
maximal_speed: 25.0
speed_limit_on_u_turn: 1.5
point_extension: 1.0
speed_multiply_buffer: 0.9
lowest_speed: 2.5
}
}
}
planner_type : EM
em_planner_config {
optimizer : DP_POLY_PATH_OPTIMIZER
optimizer : DP_ST_SPEED_OPTIMIZER
optimizer : QP_SPLINE_PATH_OPTIMIZER
optimizer : QP_SPLINE_ST_SPEED_OPTIMIZER
dp_poly_path_config {
sample_level: 8
sample_points_num_each_level: 9
step_length_max: 15.0
step_length_min: 8.0
lateral_sample_offset: 0.5
lateral_adjust_coeff: 0.5
eval_time_interval: 0.1
path_resolution: 0.1
}
dp_st_speed_config {
total_path_length: 80
total_time: 8.0
matrix_dimension_s: 200
matrix_dimension_t: 20
speed_weight: 0.0
accel_weight: 10.0
jerk_weight: 10.0
obstacle_weight: 1.0
reference_weight: 0.0
go_down_buffer: 5.0
go_up_buffer: 5.0
default_obstacle_cost: 1e10
obstacle_cost_factor: -300
default_speed_cost: 1.0
exceed_speed_penalty: 10.0
low_speed_penalty: 2.5
accel_penalty: 2.0
decel_penalty: 2.0
positive_jerk_coeff: 1.0
negative_jerk_coeff: 300.0
max_speed: 20.0
max_acceleration: 4.5
max_deceleration: -4.5
st_boundary_config {
boundary_buffer: 0.1
minimal_follow_time: 3.0
follow_buffer: 1.0
follow_coeff:1.0
follow_speed_threshold: 10.0
follow_speed_damping_factor: 0.7
success_tunnel:0.01
expanding_coeff: 1.2
follow_distance_buffer: 5.0
centric_acceleration_limit: 1.0
kappa_threshold: 0.04
minimal_kappa: 0.00001
maximal_speed: 25.0
speed_limit_on_u_turn: 1.5
point_extension: 1.0
speed_multiply_buffer: 0.9
lowest_speed: 2.5
}
}
qp_spline_path_config {
spline_order: 6
number_of_knots: 5
number_of_fx_constraint_knots: 13
time_resolution: 0.1
regularization_weight: 0.1
derivative_weight: 1.0
second_derivative_weight: 0.0
third_derivative_weight: 10.0
reference_line_weight: 0.0
num_refline_point: 10
num_output: 100
}
qp_spline_st_speed_config {
total_path_length: 80.0
total_time: 8.0
output_time_resolution: 0.05
number_of_discrete_graph_s: 80
number_of_discrete_graph_t: 10
number_of_evaluated_graph_t: 20
spline_order: 6
speed_kernel_weight: 0.0
accel_kernel_weight: 0.0
jerk_kernel_weight: 1000.0
follow_weight: 1.0
stop_weight: 1.0
cruise_weight: 1.0
max_speed: 20.0
max_acceleration: 4.5
max_deceleration: -4.5
reference_line_kernel_weight: 1.0
st_boundary_config {
boundary_buffer: 0.1
minimal_follow_time: 3.0
follow_buffer: 1.0
follow_coeff:1.0
follow_speed_threshold: 10.0
follow_speed_damping_factor: 0.7
success_tunnel:0.01
expanding_coeff: 1.2
follow_distance_buffer: 5.0
centric_acceleration_limit: 1.0
kappa_threshold: 0.04
minimal_kappa: 0.00001
maximal_speed: 25.0
speed_limit_on_u_turn: 1.5
point_extension: 1.0
speed_multiply_buffer: 0.9
lowest_speed: 2.5
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册