@@ -155,7 +155,7 @@ bool hasPreviousModulePathShapeChanged(
155
155
{
156
156
// Calculate the lateral distance between each point of the current path and the nearest point of
157
157
// the last path
158
- constexpr double LATERAL_DEVIATION_THRESH = 0.3 ;
158
+ constexpr double LATERAL_DEVIATION_THRESH = 0.1 ;
159
159
for (const auto & p : upstream_module_output.path .points ) {
160
160
const size_t nearest_seg_idx = autoware::motion_utils::findNearestSegmentIndex (
161
161
last_upstream_module_output.path .points , p.point .pose .position );
@@ -184,21 +184,12 @@ bool hasPreviousModulePathShapeChanged(
184
184
return false ;
185
185
}
186
186
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 )
189
189
{
190
+ constexpr double LATERAL_DEVIATION_THRESH = 0.1 ;
190
191
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;
202
193
}
203
194
204
195
bool needPathUpdate (
@@ -371,7 +362,8 @@ void LaneParkingPlanner::onTimer()
371
362
local_planner_data->self_odometry ->pose .pose , modified_goal_opt, parameters_)) {
372
363
return false ;
373
364
}
374
- if (hasDeviatedFromCurrentPreviousModulePath (*local_planner_data, upstream_module_output)) {
365
+ if (hasDeviatedFromPath (
366
+ local_planner_data->self_odometry ->pose .pose .position , upstream_module_output)) {
375
367
RCLCPP_DEBUG (getLogger (), " has deviated from current previous module path" );
376
368
return false ;
377
369
}
@@ -381,8 +373,8 @@ void LaneParkingPlanner::onTimer()
381
373
return true ;
382
374
}
383
375
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_) &&
386
378
current_state != PathDecisionState::DecisionKind::DECIDED) {
387
379
RCLCPP_DEBUG (getLogger (), " has deviated from last previous module path" );
388
380
return true ;
0 commit comments