Skip to content

Commit 71882fb

Browse files
feat(start_planner,lane_departure_checker): add margin param for lane departure check (autowarefoundation#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 e378edc commit 71882fb

File tree

9 files changed

+16
-1
lines changed

9 files changed

+16
-1
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/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/config/start_planner.param.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
geometric_pull_out_velocity: 1.0
2727
arc_path_interval: 1.0
2828
lane_departure_margin: 0.2
29+
lane_departure_check_expansion_margin: 0.0
2930
backward_velocity: -1.0
3031
pull_out_max_steer_angle: 0.26 # 15deg
3132
# search start pose backward

planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/start_planner_parameters.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct StartPlannerParameters
4747
double collision_check_distance_from_end{0.0};
4848
double th_moving_object_velocity{0.0};
4949
double center_line_path_interval{0.0};
50+
double lane_departure_check_expansion_margin{0.0};
5051

5152
// shift pull out
5253
bool enable_shift_pull_out{false};

planning/behavior_path_start_planner_module/src/manager.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ void StartPlannerModuleManager::init(rclcpp::Node * node)
7171
node->declare_parameter<double>(ns + "arc_path_interval");
7272
p.parallel_parking_parameters.pull_out_lane_departure_margin =
7373
node->declare_parameter<double>(ns + "lane_departure_margin");
74+
p.lane_departure_check_expansion_margin =
75+
node->declare_parameter<double>(ns + "lane_departure_check_expansion_margin");
7476
p.parallel_parking_parameters.pull_out_max_steer_angle =
7577
node->declare_parameter<double>(ns + "pull_out_max_steer_angle"); // 15deg
7678
p.parallel_parking_parameters.center_line_path_interval =

planning/behavior_path_start_planner_module/src/start_planner_module.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ StartPlannerModule::StartPlannerModule(
6262
{
6363
lane_departure_checker_ = std::make_shared<LaneDepartureChecker>();
6464
lane_departure_checker_->setVehicleInfo(vehicle_info_);
65+
lane_departure_checker::Param lane_departure_checker_params;
66+
lane_departure_checker_params.footprint_extra_margin =
67+
parameters->lane_departure_check_expansion_margin;
68+
69+
lane_departure_checker_->setParam(lane_departure_checker_params);
6570

6671
// set enabled planner
6772
if (parameters_->enable_shift_pull_out) {

0 commit comments

Comments
 (0)