无人矿卡3.0

无人矿卡3.0
1、代码拉取:buildtool install -m planning
2、创建配置参数路径:mkdir -p profiles/default/modules
3、配置参数拉取:cp -r .aem/envroot/opt/apollo/neo/share/modules/planning/ profiles/default/modules/
配置参数生效: aem profile use default
4、代码修改:
在moudules/planning/traffic_rules/crosswalk/crosswalk.cc/(人行横道不绕行避让行人停车)
添加: stop = true;
在moudules/planning/traffic_rules/crosswalk/traffic_light.cc/(路口减速,通过路口速度设置)
添加:
ReferenceLine* a = reference_line_info->mutable_reference_line();
const std::vector& c = reference_line_info->reference_line().map_path().crosswalk_overlaps();
for (const auto& b : c) {
a->AddSpeedLimit(b.start_s - 3, b.end_s + 3, 3);
}
moudules/planning/tasks/lane_borrow_path搜索:overlaps添加:
&&overlap.first != ReferenceLineInfo::CROSSWALK
||overlap.first == ReferenceLineInfo::CROSSWALK
路口跟车行驶,等待行人通过后跟车通行!!!!
moudules/planning/tasks/lane_borrow_path搜索:ComparePathData屏蔽:增加: return true;
静态障碍物绕行向左转!!!!
/*
ADEBUG << "Comparing " << lhs.path_label() << " and " << rhs.path_label();
static constexpr double kNeighborPathLengthComparisonTolerance = 25.0;
double lhs_path_length = lhs.frenet_frame_path().back().s();
double rhs_path_length = rhs.frenet_frame_path().back().s();
// Select longer path.
// If roughly same length, then select self-lane path.
if (std::fabs(lhs_path_length - rhs_path_length) > kNeighborPathLengthComparisonTolerance) {
return lhs_path_length > rhs_path_length;
}
// If roughly same length, and must borrow neighbor lane,
// then prefer to borrow forward lane rather than reverse lane.
int lhs_on_reverse = ContainsOutOnReverseLane(lhs.path_point_decision_guide());
int rhs_on_reverse = ContainsOutOnReverseLane(rhs.path_point_decision_guide());
// TODO(jiacheng): make this a flag.
if (std::abs(lhs_on_reverse - rhs_on_reverse) > 6) {
return lhs_on_reverse < rhs_on_reverse;
}
// For two lane-borrow directions, based on ADC’s position,
// select the more convenient one.
if (blocking_obstacle) {
// select left/right path based on blocking_obstacle’s position
const double obstacle_l = (blocking_obstacle->PerceptionSLBoundary().start_l()
+ blocking_obstacle->PerceptionSLBoundary().end_l())
/ 2;
ADEBUG << “obstacle[” << blocking_obstacle->Id() << “] l[” << obstacle_l << “]”;
return (obstacle_l > 0.0 ? (lhs.path_label().find(“right”) != std::string::npos)
: (lhs.path_label().find(“left”) != std::string::npos));
} else {
// select left/right path based on ADC’s position
double adc_l = lhs.frenet_frame_path().front().l();
if (adc_l < -1.0) {
return lhs.path_label().find(“right”) != std::string::npos;
} else if (adc_l > 1.0) {
return lhs.path_label().find(“left”) != std::string::npos;
}
}
// If same length, both neighbor lane are forward,
// then select the one that returns to in-lane earlier.
static constexpr double kBackToSelfLaneComparisonTolerance = 20.0;
int lhs_back_idx = GetBackToInLaneIndex(lhs.path_point_decision_guide());
int rhs_back_idx = GetBackToInLaneIndex(rhs.path_point_decision_guide());
double lhs_back_s = lhs.frenet_frame_path()[lhs_back_idx].s();
double rhs_back_s = rhs.frenet_frame_path()[rhs_back_idx].s();
if (std::fabs(lhs_back_s - rhs_back_s) > kBackToSelfLaneComparisonTolerance) {
return lhs_back_idx < rhs_back_idx;
}
// If same length, both forward, back to inlane at same time,
// select the left one to side-pass.
bool lhs_on_leftlane = lhs.path_label().find(“left”) != std::string::npos;
return lhs_on_leftlane;
}

int ContainsOutOnReverseLane(const std::vector& path_point_decision) {
int ret = 0;
for (const auto& curr_decision : path_point_decision) {
if (std::get<1>(curr_decision) == PathData::PathPointType::OUT_ON_REVERSE_LANE) {
++ret;
}
}
return ret; */
return true;
}
在/modules/planning/planning_interface_base/task_base/common/path_util/path_bounds_decider_util.cc删减代码添加3.1:
动态障碍物大于3m/h跟车小于3m/h超车!!!
源代码:
if (!obstacle.IsStatic() ||
obstacle.speed() > FLAGS_static_obstacle_speed_threshold) {
return false;
}
修改后:
if (obstacle.speed() > 3.1) {
return false;
}
在/modules/planning/planning_base/common/obstacle_blocking_analyzer.cc下屏蔽代码:
静态多障碍物绕行!!!
/for (const auto other_obstacle :
reference_line_info.path_decision().obstacles().Items()) {
if (other_obstacle->Id() == obstacle.Id()) {
continue;
}
if (other_obstacle->IsVirtual()) {
continue;
}
if (other_obstacle->Perception().type() !=
apollo::perception::PerceptionObstacle::VEHICLE) {
continue;
}
const auto& other_boundary = other_obstacle->PerceptionSLBoundary();
const auto& this_boundary = obstacle.PerceptionSLBoundary();
if (other_boundary.start_l() > this_boundary.end_l() ||
other_boundary.end_l() < this_boundary.start_l()) {
// not blocking the backside vehicle
continue;
}
double delta_s = other_boundary.start_s() - this_boundary.end_s();
if (delta_s < 0.0 || delta_s > kObstaclesDistanceThreshold) {
continue;
}
return false;
} */
ADEBUG << “IT IS NON-MOVABLE!”;
return true;
}
5、配置参数修改:如果交通灯路口、人行道题目分别出题,且参数为1.5m-2.0m、2.0m-2.5m。已交通灯为准,填写停障距离为:1.5m即可:
stop_distance: 1.5 enabled: true
max_stop_deceleration: 4.0 stop_distance: 1.5
min_pass_s_distance: 1.0 max_stop_deceleration: 4.0
expand_s_distance: 2.0
stop_strict_l_distance: 1.5
stop_loose_l_distance: 6.5
stop_timeout: 100.0
planning.conf需要修改添加的配置参数为:
–speed_bump_speed_limit=2.5(人行道速度为2.5)
–referfece_line_max_forward_heading_diff=2.5(u型弯) --max_stop_distance_obstacle=1.0(路口跟车行驶距离前车距离) --min_stop_distance_obstacle=1.0(路口跟车行驶距离前车距离) --obstacle_lat_buffer=1.5(静态障碍物绕障横向距离参数)
2. 在profiles/default/modules/planning/tasks/speed_bounds_decider/conf/default_conf.pb.txt需要添加:
collision_safety_range: 2(静态障碍物绕行距离前车多远距离开始绕障)
修改:static_obs_nudge_speed_ratio: 0.05(静态障碍物绕行速度限制)
3. /profiles/default/modules/planning/tasks/piecewise_jerk_speed/conf/default_conf.pb.txt下:
acc_weight: 1.0
jerk_weight: 3.0
kappa_penalty_weight: 200.0
ref_s_weight: 1.0(10.0)车辆加速度!!!
ref_v_weight: 10.0
follow_distance_buffer:0.1
4. profiles/default/modules/planning/tasks/lane_borrow_path/conf/default_conf.pb.txt下:
is_allow_lane_borrowing: true
lane_borrow_max_speed: 5.0
long_term_blocking_obstacle_cycle_threshold: 3
path_optimizer_config {
l_weight: 1.0
dl_weight: 20.0
ddl_weight: 1000.0(10)静态障碍物绕行距离限制
dddl_weight: 50000.0(10)静态障碍物绕行距离限制
path_reference_l_weight: 100.0
lateral_derivative_bound_default: 2.0
}
5. /profiles/default/modules/planning/planning_component/conf/discrete_points_smoother_config.pb.txt
max_constraint_interval : 0.25(0.2,U型弯曲率)
longitudinal_boundary_bound : 2.0(0.6U型弯曲率)
max_lateral_boundary_bound : 0.5
min_lateral_boundary_bound : 0.1
curb_shift : 0.2
lateral_buffer : 0.2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值