Skip to content

Commit 6fe9fc6

Browse files
feat(start_planner,lane_departure_checker): add margin param for lane departure check (#7193)
* add param for lane departure margin Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * json thing Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * docs Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * make separate param for lane departure margin expansion Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * update docs Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> --------- Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
1 parent 8335096 commit 6fe9fc6

File tree

11 files changed

+34
-9
lines changed

11 files changed

+34
-9
lines changed

control/lane_departure_checker/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ This package includes the following features:
9393
| Name | Type | Description | Default value |
9494
| :------------------------- | :----- | :--------------------------------------------------------------------------------- | :------------ |
9595
| footprint_margin_scale | double | Coefficient for expanding footprint margin. Multiplied by 1 standard deviation. | 1.0 |
96+
| footprint_extra_margin | double | Coefficient for expanding footprint margin. When checking for lane departure | 0.0 |
9697
| resample_interval | double | Minimum Euclidean distance between points when resample trajectory.[m] | 0.3 |
9798
| max_deceleration | double | Maximum deceleration when calculating braking distance. | 2.8 |
9899
| delay_time | double | Delay time which took to actuate brake when calculating braking distance. [second] | 1.3 |

control/lane_departure_checker/config/lane_departure_checker.param.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
# Core
1919
footprint_margin_scale: 1.0
20+
footprint_extra_margin: 0.0
2021
resample_interval: 0.3
2122
max_deceleration: 2.8
2223
delay_time: 1.3

control/lane_departure_checker/include/lane_departure_checker/lane_departure_checker.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ typedef boost::geometry::index::rtree<Segment2d, boost::geometry::index::rstar<1
6060
struct Param
6161
{
6262
double footprint_margin_scale;
63+
double footprint_extra_margin;
6364
double resample_interval;
6465
double max_deceleration;
6566
double delay_time;

control/lane_departure_checker/schema/lane_departure_checker.json

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
"default": 1.0,
1212
"description": "Coefficient for expanding footprint margin. Multiplied by 1 standard deviation."
1313
},
14+
"footprint_extra_margin": {
15+
"type": "number",
16+
"default": 10.0,
17+
"description": "Coefficient for expanding footprint margin."
18+
},
1419
"resample_interval": {
1520
"type": "number",
1621
"default": 0.3,
@@ -53,6 +58,7 @@
5358
},
5459
"required": [
5560
"footprint_margin_scale",
61+
"footprint_extra_margin",
5662
"resample_interval",
5763
"max_deceleration",
5864
"max_lateral_deviation",

control/lane_departure_checker/src/lane_departure_checker_node/lane_departure_checker.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ std::vector<LinearRing2d> LaneDepartureChecker::createVehicleFootprints(
261261
const PathWithLaneId & path) const
262262
{
263263
// Create vehicle footprint in base_link coordinate
264-
const auto local_vehicle_footprint = vehicle_info_ptr_->createFootprint();
264+
const auto local_vehicle_footprint =
265+
vehicle_info_ptr_->createFootprint(param_.footprint_extra_margin);
265266

266267
// Create vehicle footprint on each Path point
267268
std::vector<LinearRing2d> vehicle_footprints;

control/lane_departure_checker/src/lane_departure_checker_node/lane_departure_checker_node.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ LaneDepartureCheckerNode::LaneDepartureCheckerNode(const rclcpp::NodeOptions & o
150150

151151
// Core Parameter
152152
param_.footprint_margin_scale = declare_parameter<double>("footprint_margin_scale");
153+
param_.footprint_extra_margin = declare_parameter<double>("footprint_extra_margin");
153154
param_.resample_interval = declare_parameter<double>("resample_interval");
154155
param_.max_deceleration = declare_parameter<double>("max_deceleration");
155156
param_.delay_time = declare_parameter<double>("delay_time");
@@ -403,6 +404,7 @@ rcl_interfaces::msg::SetParametersResult LaneDepartureCheckerNode::onParameter(
403404

404405
// Core
405406
update_param(parameters, "footprint_margin_scale", param_.footprint_margin_scale);
407+
update_param(parameters, "footprint_extra_margin", param_.footprint_extra_margin);
406408
update_param(parameters, "resample_interval", param_.resample_interval);
407409
update_param(parameters, "max_deceleration", param_.max_deceleration);
408410
update_param(parameters, "delay_time", param_.delay_time);

planning/behavior_path_start_planner_module/README.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -494,14 +494,15 @@ See also [[1]](https://www.sciencedirect.com/science/article/pii/S14746670153474
494494

495495
#### parameters for geometric pull out
496496

497-
| Name | Unit | Type | Description | Default value |
498-
| :-------------------------- | :---- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
499-
| enable_geometric_pull_out | [-] | bool | flag whether to enable geometric pull out | true |
500-
| divide_pull_out_path | [-] | bool | flag whether to divide arc paths. The path is assumed to be divided because the curvature is not continuous. But it requires a stop during the departure. | false |
501-
| geometric_pull_out_velocity | [m/s] | double | velocity of geometric pull out | 1.0 |
502-
| arc_path_interval | [m] | double | path points interval of arc paths of geometric pull out | 1.0 |
503-
| lane_departure_margin | [m] | double | margin of deviation to lane right | 0.2 |
504-
| pull_out_max_steer_angle | [rad] | double | maximum steer angle for path generation | 0.26 |
497+
| Name | Unit | Type | Description | Default value |
498+
| :------------------------------------ | :---- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
499+
| enable_geometric_pull_out | [-] | bool | flag whether to enable geometric pull out | true |
500+
| divide_pull_out_path | [-] | bool | flag whether to divide arc paths. The path is assumed to be divided because the curvature is not continuous. But it requires a stop during the departure. | false |
501+
| geometric_pull_out_velocity | [m/s] | double | velocity of geometric pull out | 1.0 |
502+
| arc_path_interval | [m] | double | path points interval of arc paths of geometric pull out | 1.0 |
503+
| lane_departure_margin | [m] | double | margin of deviation to lane right | 0.2 |
504+
| lane_departure_check_expansion_margin | [m] | double | margin to expand the ego vehicle footprint when doing lane departure checks | 0.0 |
505+
| pull_out_max_steer_angle | [rad] | double | maximum steer angle for path generation | 0.26 |
505506

506507
## **backward pull out start point search**
507508

planning/behavior_path_start_planner_module/config/start_planner.param.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
geometric_pull_out_velocity: 1.0
4141
arc_path_interval: 1.0
4242
lane_departure_margin: 0.2
43+
lane_departure_check_expansion_margin: 0.0
4344
backward_velocity: -1.0
4445
pull_out_max_steer_angle: 0.26 # 15deg
4546
# search start pose backward

planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/data_structs.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ struct StartPlannerParameters
7171
behavior_path_planner::utils::path_safety_checker::ObjectTypesToCheck
7272
object_types_to_check_for_path_generation{};
7373
double center_line_path_interval{0.0};
74+
double lane_departure_check_expansion_margin{0.0};
7475

7576
// shift pull out
7677
bool enable_shift_pull_out{false};

planning/behavior_path_start_planner_module/src/manager.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ void StartPlannerModuleManager::init(rclcpp::Node * node)
101101
node->declare_parameter<double>(ns + "arc_path_interval");
102102
p.parallel_parking_parameters.pull_out_lane_departure_margin =
103103
node->declare_parameter<double>(ns + "lane_departure_margin");
104+
p.lane_departure_check_expansion_margin =
105+
node->declare_parameter<double>(ns + "lane_departure_check_expansion_margin");
104106
p.parallel_parking_parameters.pull_out_max_steer_angle =
105107
node->declare_parameter<double>(ns + "pull_out_max_steer_angle"); // 15deg
106108
p.parallel_parking_parameters.center_line_path_interval =
@@ -435,6 +437,9 @@ void StartPlannerModuleManager::updateModuleParams(
435437
updateParam<double>(
436438
parameters, ns + "lane_departure_margin",
437439
p->parallel_parking_parameters.pull_out_lane_departure_margin);
440+
updateParam<double>(
441+
parameters, ns + "lane_departure_check_expansion_margin",
442+
p->lane_departure_check_expansion_margin);
438443
updateParam<double>(
439444
parameters, ns + "pull_out_max_steer_angle",
440445
p->parallel_parking_parameters.pull_out_max_steer_angle);

planning/behavior_path_start_planner_module/src/start_planner_module.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ StartPlannerModule::StartPlannerModule(
6565
{
6666
lane_departure_checker_ = std::make_shared<LaneDepartureChecker>();
6767
lane_departure_checker_->setVehicleInfo(vehicle_info_);
68+
lane_departure_checker::Param lane_departure_checker_params;
69+
lane_departure_checker_params.footprint_extra_margin =
70+
parameters->lane_departure_check_expansion_margin;
71+
72+
lane_departure_checker_->setParam(lane_departure_checker_params);
6873

6974
// set enabled planner
7075
if (parameters_->enable_shift_pull_out) {

0 commit comments

Comments
 (0)