Skip to content

Commit

Permalink
feat(static_centerline_optimizer): get behavior_velocity_planner's pa…
Browse files Browse the repository at this point in the history
…th interval from yaml

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
  • Loading branch information
takayuki5168 committed Jan 14, 2024
1 parent 0aa3927 commit 814cd8f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
name="behavior_path_planner_param"
default="$(find-pkg-share autoware_launch)/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/behavior_path_planner.param.yaml"
/>
<arg
name="behavior_velocity_planner_param"
default="$(find-pkg-share autoware_launch)/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/behavior_velocity_planner.param.yaml"
/>
<arg name="path_smoother_param" default="$(find-pkg-share autoware_launch)/config/planning/scenario_planning/lane_driving/motion_planning/path_smoother/elastic_band_smoother.param.yaml"/>
<arg
name="obstacle_avoidance_planner_param"
Expand Down Expand Up @@ -67,6 +71,7 @@
<!-- component param -->
<param from="$(var map_loader_param)"/>
<param from="$(var behavior_path_planner_param)"/>
<param from="$(var behavior_velocity_planner_param)"/>
<param from="$(var path_smoother_param)"/>
<param from="$(var obstacle_avoidance_planner_param)"/>
<param from="$(var mission_planner_param)"/>
Expand Down
1 change: 1 addition & 0 deletions planning/static_centerline_optimizer/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<depend>autoware_auto_perception_msgs</depend>
<depend>autoware_auto_planning_msgs</depend>
<depend>behavior_path_planner</depend>
<depend>behavior_velocity_planner</depend>
<depend>geometry_msgs</depend>
<depend>global_parameter_loader</depend>
<depend>interpolation</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ std::vector<TrajectoryPoint> StaticCenterlineOptimizerNode::plan_path(
const double behavior_path_interval = has_parameter("output_path_interval")
? get_parameter("output_path_interval").as_double()
: declare_parameter<double>("output_path_interval");
const double behavior_vel_interval =
has_parameter("behavior_output_path_interval")
? get_parameter("behavior_output_path_interval").as_double()
: declare_parameter<double>("behavior_output_path_interval");

// extract path with lane id from lanelets
const auto raw_path_with_lane_id = [&]() {
Expand All @@ -439,8 +443,7 @@ std::vector<TrajectoryPoint> StaticCenterlineOptimizerNode::plan_path(
// convert path with lane id to path
const auto raw_path = [&]() {
const auto non_resampled_path = convert_to_path(raw_path_with_lane_id);
// NOTE: The behavior_velocity_planner resamples with the interval 1.0 somewhere.
return motion_utils::resamplePath(non_resampled_path, 1.0);
return motion_utils::resamplePath(non_resampled_path, behavior_vel_interval);
}();
pub_raw_path_->publish(raw_path);
RCLCPP_INFO(get_logger(), "Converted to path and published.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def generate_test_description():
get_package_share_directory("behavior_path_planner"),
"config/behavior_path_planner.param.yaml",
),
os.velocity.join(
get_package_share_directory("behavior_velocity_planner"),
"config/behavior_velocity_planner.param.yaml",
),

Check warning on line 62 in planning/static_centerline_optimizer/test/test_static_centerline_optimizer.test.py

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Large Method

generate_test_description has 71 lines, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
os.path.join(
get_package_share_directory("path_smoother"),
"config/elastic_band_smoother.param.yaml",
Expand Down

0 comments on commit 814cd8f

Please sign in to comment.