16
16
#define BEHAVIOR_PATH_AVOIDANCE_MODULE__HELPER_HPP_
17
17
18
18
#include " behavior_path_avoidance_module/data_structs.hpp"
19
+ #include " behavior_path_avoidance_module/type_alias.hpp"
19
20
#include " behavior_path_avoidance_module/utils.hpp"
20
21
#include " behavior_path_planner_common/utils/utils.hpp"
21
22
22
- #include < motion_utils/distance/distance.hpp>
23
-
24
23
#include < algorithm>
25
24
#include < limits>
26
25
#include < memory>
@@ -32,11 +31,6 @@ namespace behavior_path_planner::helper::avoidance
32
31
33
32
using behavior_path_planner::PathShifter;
34
33
using behavior_path_planner::PlannerData;
35
- using motion_utils::calcDecelDistWithJerkAndAccConstraints;
36
- using motion_utils::calcLongitudinalOffsetPose;
37
- using motion_utils::calcSignedArcLength;
38
- using motion_utils::findNearestIndex;
39
- using tier4_autoware_utils::getPose;
40
34
41
35
class AvoidanceHelper
42
36
{
@@ -181,14 +175,14 @@ class AvoidanceHelper
181
175
double getShift (const Point & p) const
182
176
{
183
177
validate ();
184
- const auto idx = findNearestIndex (prev_reference_path_.points , p);
178
+ const auto idx = motion_utils:: findNearestIndex (prev_reference_path_.points , p);
185
179
return prev_spline_shift_path_.shift_length .at (idx);
186
180
}
187
181
188
182
double getLinearShift (const Point & p) const
189
183
{
190
184
validate ();
191
- const auto idx = findNearestIndex (prev_reference_path_.points , p);
185
+ const auto idx = motion_utils:: findNearestIndex (prev_reference_path_.points , p);
192
186
return prev_linear_shift_path_.shift_length .at (idx);
193
187
}
194
188
@@ -282,8 +276,8 @@ class AvoidanceHelper
282
276
}
283
277
284
278
const auto start_idx = data_->findEgoIndex (path.points );
285
- const auto distance =
286
- calcSignedArcLength ( path.points , start_idx, max_v_point_.value ().first .position );
279
+ const auto distance = motion_utils::calcSignedArcLength (
280
+ path.points , start_idx, max_v_point_.value ().first .position );
287
281
return std::make_pair (distance, max_v_point_.value ().second );
288
282
}
289
283
@@ -294,7 +288,7 @@ class AvoidanceHelper
294
288
const auto & a_now = data_->self_acceleration ->accel .accel .linear .x ;
295
289
const auto & a_lim = use_hard_constraints ? p->max_deceleration : p->nominal_deceleration ;
296
290
const auto & j_lim = use_hard_constraints ? p->max_jerk : p->nominal_jerk ;
297
- const auto ret = calcDecelDistWithJerkAndAccConstraints (
291
+ const auto ret = motion_utils:: calcDecelDistWithJerkAndAccConstraints (
298
292
getEgoSpeed (), target_velocity, a_now, a_lim, j_lim, -1.0 * j_lim);
299
293
300
294
if (!!ret) {
@@ -441,14 +435,15 @@ class AvoidanceHelper
441
435
const auto x_max_accel =
442
436
v_neg_jerk * t_max_accel + p->max_acceleration * std::pow (t_max_accel, 2.0 ) / 2.0 ;
443
437
444
- const auto point =
445
- calcLongitudinalOffsetPose ( path.points , getEgoPosition (), x_neg_jerk + x_max_accel);
438
+ const auto point = motion_utils::calcLongitudinalOffsetPose (
439
+ path.points , getEgoPosition (), x_neg_jerk + x_max_accel);
446
440
if (point.has_value ()) {
447
441
max_v_point_ = std::make_pair (point.value (), v_max);
448
442
return ;
449
443
}
450
444
451
- const auto x_end = calcSignedArcLength (path.points , getEgoPosition (), path.points .size () - 1 );
445
+ const auto x_end =
446
+ motion_utils::calcSignedArcLength (path.points , getEgoPosition (), path.points .size () - 1 );
452
447
const auto t_end =
453
448
(std::sqrt (v0 * v0 + 2.0 * p->max_acceleration * x_end) - v0) / p->max_acceleration ;
454
449
const auto v_end = v0 + p->max_acceleration * t_end;
0 commit comments