提交 66e716a6 编写于 作者: J jmtao 提交者: Jiaming Tao

planning creep read from conf

上级 babf1c2b
......@@ -192,7 +192,7 @@ scenario_task_config : {
scenario_task_config : {
task_type : DECIDER_CREEP
decider_creep_config : {
creep_distance_to_stop_line: 1.5
creep_distance_pass_stop_line: 1.5
stop_distance: 0.3
speed_limit: 1.0
max_valid_stop_distance: 0.4
......
......@@ -3,12 +3,13 @@ syntax = "proto2";
package apollo.planning;
message DeciderCreepConfig {
// stop distance(m) to the stop line of next lane overlap while creeping
optional double creep_distance_to_stop_line = 1 [default = 1.0]; // meter
// stop distance(m) to the stop line of next lane overlap while creeping
// stop distance(m) pass the current stop line while creeping
optional double creep_distance_pass_stop_line = 1 [default = 1.0]; // meter
// stop distance(m) to the creeping stop fence while creeping
optional double stop_distance = 2 [default = 0.5]; // meter
optional double speed_limit = 3 [default = 1.0]; // m/s
// max distance(m) to the stop line to be considered as a valid stop for creap
// max distance(m) to the to the creeping stop fence
// to be considered as a valid stop for creep
optional double max_valid_stop_distance = 4 [default = 0.3]; // meter
// min boundary t to ignore obstacles while creeping
optional double min_boundary_t = 5 [default = 6.0]; // second
......
......@@ -32,6 +32,13 @@ using apollo::common::ErrorCode;
using apollo::common::Status;
using apollo::hdmap::PathOverlap;
bool Creep::Init(const ScenarioConfig::ScenarioTaskConfig &config) {
CHECK(config.has_decider_creep_config());
config_ = config.decider_creep_config();
is_init_ = true;
return true;
}
Status Creep::Process(Frame* frame,
ReferenceLineInfo* reference_line_info) {
if (!is_init_) {
......@@ -58,7 +65,7 @@ bool Creep::BuildStopDecision(
CHECK_NOTNULL(reference_line_info);
double adc_front_edge_s = reference_line_info->AdcSlBoundary().end_s();
const double creep_distance = 1.0; // TODO(all)
const double creep_distance = config_.creep_distance_pass_stop_line();
double creep_stop_s = adc_front_edge_s + + creep_distance;
// create virtual stop wall
......@@ -78,8 +85,8 @@ bool Creep::BuildStopDecision(
}
// build stop decision
double stop_buffer = 0.3; // TODO(all)
const double stop_s = creep_stop_s - stop_buffer;
const double stop_distance = config_.stop_distance();
const double stop_s = creep_stop_s - stop_distance;
const auto& reference_line = reference_line_info->reference_line();
auto stop_point = reference_line.GetReferencePoint(stop_s);
double stop_heading = reference_line.GetReferencePoint(stop_s).heading();
......@@ -87,7 +94,7 @@ bool Creep::BuildStopDecision(
ObjectDecisionType stop;
auto stop_decision = stop.mutable_stop();
stop_decision->set_reason_code(StopReasonCode::STOP_REASON_CREEPER);
stop_decision->set_distance_s(-stop_buffer);
stop_decision->set_distance_s(-stop_distance);
stop_decision->set_stop_heading(stop_heading);
stop_decision->mutable_stop_point()->set_x(stop_point.x());
stop_decision->mutable_stop_point()->set_y(stop_point.y());
......
......@@ -22,6 +22,8 @@
#include "cybertron/common/macros.h"
#include "modules/planning/proto/decider_config.pb.h"
#include "modules/map/pnc_map/path.h"
#include "modules/planning/common/frame.h"
#include "modules/planning/common/reference_line_info.h"
......@@ -47,6 +49,7 @@ class Creep : public Decider {
private:
static constexpr const char* CREEP_VO_ID_PREFIX = "CREEP_";
DeciderCreepConfig config_;
};
} // namespace planning
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册