forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(behavior_path_palnner): update geometric parallel parking for pu…
…ll_out module (#1534) Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
- Loading branch information
Showing
8 changed files
with
508 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
planning/behavior_path_planner/src/scene_module/pull_out/geometric_pull_out.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright 2022 TIER IV, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "behavior_path_planner/scene_module/pull_out/geometric_pull_out.hpp" | ||
|
||
#include "behavior_path_planner/scene_module/pull_out/util.hpp" | ||
|
||
using lanelet::utils::getArcCoordinates; | ||
using motion_utils::findNearestIndex; | ||
using tier4_autoware_utils::calcDistance2d; | ||
using tier4_autoware_utils::calcOffsetPose; | ||
namespace behavior_path_planner | ||
{ | ||
using pull_out_utils::combineReferencePath; | ||
using pull_out_utils::getPullOutLanes; | ||
|
||
GeometricPullOut::GeometricPullOut( | ||
rclcpp::Node & node, const PullOutParameters & parameters, | ||
const ParallelParkingParameters & parallel_parking_parameters) | ||
: PullOutPlannerBase{node, parameters}, parallel_parking_parameters_{parallel_parking_parameters} | ||
{ | ||
} | ||
|
||
boost::optional<PullOutPath> GeometricPullOut::plan(Pose start_pose, Pose goal_pose) | ||
{ | ||
PullOutPath output; | ||
|
||
// conbine road lane and shoulder lane | ||
const auto road_lanes = util::getCurrentLanes(planner_data_); | ||
const auto shoulder_lanes = getPullOutLanes(road_lanes, planner_data_); | ||
auto lanes = road_lanes; | ||
lanes.insert(lanes.end(), shoulder_lanes.begin(), shoulder_lanes.end()); | ||
|
||
// todo: set params only once? | ||
planner_.setData(planner_data_, parallel_parking_parameters_); | ||
const bool found_valid_path = | ||
planner_.planPullOut(start_pose, goal_pose, road_lanes, shoulder_lanes); | ||
if (!found_valid_path) { | ||
return {}; | ||
} | ||
|
||
// collsion check with objects in shoulder lanes | ||
const auto arc_path = planner_.getArcPath(); | ||
const auto shoulder_lane_objects = | ||
util::filterObjectsByLanelets(*(planner_data_->dynamic_object), shoulder_lanes); | ||
if (util::checkCollisionBetweenPathFootprintsAndObjects( | ||
vehicle_footprint_, arc_path, shoulder_lane_objects, parameters_.collision_check_margin)) { | ||
return {}; | ||
} | ||
|
||
output.partial_paths = planner_.getPaths(); | ||
output.start_pose = planner_.getArcPaths().at(0).points.back().point.pose; | ||
output.end_pose = planner_.getArcPaths().at(1).points.back().point.pose; | ||
|
||
return output; | ||
} | ||
} // namespace behavior_path_planner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.