Skip to content

Commit 594c099

Browse files
feat(goal_planner): update lateral_deviation_thresh from 0.3 to 0.1 (#9850)
* fix(goal_planner): Update lateral_deviation_thresh from 0.3 to 0.1 Signed-off-by: Kasunori-Nakajima <kazunori.nakajima@tier4.jp> * unified hasDeviatedFrom{Last|Current}PreviousModulePath Signed-off-by: Kasunori-Nakajima <kazunori.nakajima@tier4.jp> * style(pre-commit): autofix * hasDeviatedFromPath argument modification Signed-off-by: Kasunori-Nakajima <kazunori.nakajima@tier4.jp> * style(pre-commit): autofix --------- Signed-off-by: Kasunori-Nakajima <kazunori.nakajima@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 00892a1 commit 594c099

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/include/autoware/behavior_path_goal_planner_module/goal_planner_module.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,8 @@ bool isOnModifiedGoal(
135135
bool hasPreviousModulePathShapeChanged(
136136
const BehaviorModuleOutput & upstream_module_output,
137137
const BehaviorModuleOutput & last_upstream_module_output);
138-
bool hasDeviatedFromLastPreviousModulePath(
139-
const PlannerData & planner_data, const BehaviorModuleOutput & last_upstream_module_output);
140-
bool hasDeviatedFromCurrentPreviousModulePath(
141-
const PlannerData & planner_data, const BehaviorModuleOutput & upstream_module_output);
138+
bool hasDeviatedFromPath(
139+
const Point & ego_position, const BehaviorModuleOutput & upstream_module_output);
142140

143141
bool needPathUpdate(
144142
const Pose & current_pose, const double path_update_duration, const rclcpp::Time & now,

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

+9-17
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ bool hasPreviousModulePathShapeChanged(
155155
{
156156
// Calculate the lateral distance between each point of the current path and the nearest point of
157157
// the last path
158-
constexpr double LATERAL_DEVIATION_THRESH = 0.3;
158+
constexpr double LATERAL_DEVIATION_THRESH = 0.1;
159159
for (const auto & p : upstream_module_output.path.points) {
160160
const size_t nearest_seg_idx = autoware::motion_utils::findNearestSegmentIndex(
161161
last_upstream_module_output.path.points, p.point.pose.position);
@@ -184,21 +184,12 @@ bool hasPreviousModulePathShapeChanged(
184184
return false;
185185
}
186186

187-
bool hasDeviatedFromLastPreviousModulePath(
188-
const PlannerData & planner_data, const BehaviorModuleOutput & last_upstream_module_output)
187+
bool hasDeviatedFromPath(
188+
const Point & ego_position, const BehaviorModuleOutput & upstream_module_output)
189189
{
190+
constexpr double LATERAL_DEVIATION_THRESH = 0.1;
190191
return std::abs(autoware::motion_utils::calcLateralOffset(
191-
last_upstream_module_output.path.points,
192-
planner_data.self_odometry->pose.pose.position)) > 0.3;
193-
}
194-
195-
bool hasDeviatedFromCurrentPreviousModulePath(
196-
const PlannerData & planner_data, const BehaviorModuleOutput & upstream_module_output)
197-
{
198-
constexpr double LATERAL_DEVIATION_THRESH = 0.3;
199-
return std::abs(autoware::motion_utils::calcLateralOffset(
200-
upstream_module_output.path.points, planner_data.self_odometry->pose.pose.position)) >
201-
LATERAL_DEVIATION_THRESH;
192+
upstream_module_output.path.points, ego_position)) > LATERAL_DEVIATION_THRESH;
202193
}
203194

204195
bool needPathUpdate(
@@ -371,7 +362,8 @@ void LaneParkingPlanner::onTimer()
371362
local_planner_data->self_odometry->pose.pose, modified_goal_opt, parameters_)) {
372363
return false;
373364
}
374-
if (hasDeviatedFromCurrentPreviousModulePath(*local_planner_data, upstream_module_output)) {
365+
if (hasDeviatedFromPath(
366+
local_planner_data->self_odometry->pose.pose.position, upstream_module_output)) {
375367
RCLCPP_DEBUG(getLogger(), "has deviated from current previous module path");
376368
return false;
377369
}
@@ -381,8 +373,8 @@ void LaneParkingPlanner::onTimer()
381373
return true;
382374
}
383375
if (
384-
hasDeviatedFromLastPreviousModulePath(
385-
*local_planner_data, original_upstream_module_output_) &&
376+
hasDeviatedFromPath(
377+
local_planner_data->self_odometry->pose.pose.position, original_upstream_module_output_) &&
386378
current_state != PathDecisionState::DecisionKind::DECIDED) {
387379
RCLCPP_DEBUG(getLogger(), "has deviated from last previous module path");
388380
return true;

0 commit comments

Comments
 (0)