Skip to content

Commit

Permalink
feat(behavior_path_planner): add option to insert zero velocity to th…
Browse files Browse the repository at this point in the history
…e center line path (autowarefoundation#5517)

feat(behavior_path_planner): Add option to insert zero velocity to the center line path

This commit adds a new boolean parameter, `insert_zero_velocity`, to the `getCenterLinePath` function in the `utils.hpp` file. When set to `true`, this parameter will insert a zero velocity to each point in the path. In the `utils.cpp` file, this option is used to insert zero velocities to the reference path generated in the `createGoalAroundPath` function.

Signed-off-by: kyoichi-sugahara <[email protected]>
  • Loading branch information
kyoichi-sugahara authored Nov 9, 2023
1 parent 63c1dd6 commit 27f61b0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions planning/behavior_path_planner/src/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,9 +974,11 @@ BehaviorModuleOutput createGoalAroundPath(const std::shared_ptr<const PlannerDat
shorten_lanes, dp.drivable_area_left_bound_offset, dp.drivable_area_right_bound_offset,
dp.drivable_area_types_to_skip);

// TODO(someone): insert 0 velocity on the path
// assumption: this function is called when any of the scene module is running and ego is outside
// of the route
// Insert zero velocity to each point in the path.
for (auto & point : reference_path.points) {
point.point.longitudinal_velocity_mps = 0.0;
}

output.path = std::make_shared<PathWithLaneId>(reference_path);
output.reference_path = std::make_shared<PathWithLaneId>(reference_path);
output.drivable_area_info.drivable_lanes = drivable_lanes;
Expand Down

0 comments on commit 27f61b0

Please sign in to comment.