Skip to content

Commit f75c14b

Browse files
authored
feat(motion_velocity_smoother): tunable deceleration limit for curve … (autowarefoundation#2278)
feat(motion_velocity_smoother): tunable deceleration limit for curve deceleration Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com> Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
1 parent 89d137a commit f75c14b

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

launch/tier4_planning_launch/config/scenario_planning/common/motion_velocity_smoother/motion_velocity_smoother.param.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
min_curve_velocity: 0.5 # min velocity at lateral acceleration limit and steering angle rate limit [m/s]
1313
decel_distance_before_curve: 3.5 # slow speed distance before a curve for lateral acceleration limit
1414
decel_distance_after_curve: 2.0 # slow speed distance after a curve for lateral acceleration limit
15+
min_decel_for_lateral_acc_lim_filter: -2.5 # deceleration limit applied in the lateral acceleration filter to avoid sudden braking [m/ss]
1516

1617
# engage & replan parameters
1718
replan_vel_deviation: 5.53 # velocity deviation to replan initial velocity [m/s]

planning/motion_velocity_smoother/README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,13 @@ After the optimization, a resampling called `post resampling` is performed befor
138138

139139
### Curve parameters
140140

141-
| Name | Type | Description | Default value |
142-
| :---------------------------- | :------- | :--------------------------------------------------------------------- | :------------ |
143-
| `max_lateral_accel` | `double` | Max lateral acceleration limit [m/ss] | 0.5 |
144-
| `min_curve_velocity` | `double` | Min velocity at lateral acceleration limit [m/ss] | 2.74 |
145-
| `decel_distance_before_curve` | `double` | Distance to slowdown before a curve for lateral acceleration limit [m] | 3.5 |
146-
| `decel_distance_after_curve` | `double` | Distance to slowdown after a curve for lateral acceleration limit [m] | 2.0 |
141+
| Name | Type | Description | Default value |
142+
| :------------------------------------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
143+
| `max_lateral_accel` | `double` | Max lateral acceleration limit [m/ss] | 0.5 |
144+
| `min_curve_velocity` | `double` | Min velocity at lateral acceleration limit [m/ss] | 2.74 |
145+
| `decel_distance_before_curve` | `double` | Distance to slowdown before a curve for lateral acceleration limit [m] | 3.5 |
146+
| `decel_distance_after_curve` | `double` | Distance to slowdown after a curve for lateral acceleration limit [m] | 2.0 |
147+
| `min_decel_for_lateral_acc_lim_filter` | `double` | Deceleration limit to avoid sudden braking by the lateral acceleration filter [m/ss]. Strong limitation degrades the deceleration response to the appearance of sharp curves due to obstacle avoidance, etc. | -2.5 |
147148

148149
### Engage & replan parameters
149150

planning/motion_velocity_smoother/config/default_motion_velocity_smoother.param.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
min_curve_velocity: 2.74 # min velocity at lateral acceleration limit [m/ss]
1313
decel_distance_before_curve: 3.5 # slow speed distance before a curve for lateral acceleration limit
1414
decel_distance_after_curve: 2.0 # slow speed distance after a curve for lateral acceleration limit
15+
min_decel_for_lateral_acc_lim_filter: -2.5 # deceleration limit applied in the lateral acceleration filter to avoid sudden braking [m/ss]
1516

1617
# engage & replan parameters
1718
replan_vel_deviation: 5.53 # velocity deviation to replan initial velocity [m/s]

planning/motion_velocity_smoother/include/motion_velocity_smoother/smoother/smoother_base.hpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ class SmootherBase
4545
double stop_decel; // deceleration at a stop point [m/s2] <= 0
4646
double max_jerk;
4747
double min_jerk;
48-
double max_lateral_accel; // max lateral acceleration [m/ss] > 0
49-
double min_curve_velocity; // min velocity at curve [m/s]
48+
double max_lateral_accel; // max lateral acceleration [m/ss] > 0
49+
double min_decel_for_lateral_acc_lim_filter; // deceleration limit applied in the lateral
50+
// acceleration filter to avoid sudden braking.
51+
double min_curve_velocity; // min velocity at curve [m/s]
5052
double decel_distance_before_curve; // distance before slow down for lateral acc at a curve
5153
double decel_distance_after_curve; // distance after slow down for lateral acc at a curve
5254
double max_steering_angle_rate; // max steering angle rate [degree/s]

planning/motion_velocity_smoother/src/smoother/smoother_base.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ SmootherBase::SmootherBase(rclcpp::Node & node)
3737
p.max_jerk = node.declare_parameter("normal.max_jerk", 0.3);
3838
p.min_jerk = node.declare_parameter("normal.min_jerk", -0.1);
3939
p.max_lateral_accel = node.declare_parameter("max_lateral_accel", 0.2);
40+
p.min_decel_for_lateral_acc_lim_filter =
41+
node.declare_parameter("min_decel_for_lateral_acc_lim_filter", -2.5);
4042
p.sample_ds = node.declare_parameter("resample_ds", 0.5);
4143
p.curvature_threshold = node.declare_parameter("curvature_threshold", 0.2);
4244
p.max_steering_angle_rate = node.declare_parameter("max_steering_angle_rate", 5.0);
@@ -106,10 +108,10 @@ boost::optional<TrajectoryPoints> SmootherBase::applyLateralAccelerationFilter(
106108
const double max_lateral_accel_abs = std::fabs(base_param_.max_lateral_accel);
107109

108110
const auto latacc_min_vel_arr =
109-
enable_smooth_limit
110-
? trajectory_utils::calcVelocityProfileWithConstantJerkAndAccelerationLimit(
111-
output, v0, a0, base_param_.min_jerk, base_param_.max_accel, base_param_.min_decel)
112-
: std::vector<double>{};
111+
enable_smooth_limit ? trajectory_utils::calcVelocityProfileWithConstantJerkAndAccelerationLimit(
112+
output, v0, a0, base_param_.min_jerk, base_param_.max_accel,
113+
base_param_.min_decel_for_lateral_acc_lim_filter)
114+
: std::vector<double>{};
113115

114116
for (size_t i = 0; i < output.size(); ++i) {
115117
double curvature = 0.0;

0 commit comments

Comments
 (0)