Skip to content

Commit

Permalink
feat(lane_change_module): add validation for longitudinal and lateral…
Browse files Browse the repository at this point in the history
… acceleration sampling parameters

Signed-off-by: Kyoichi Sugahara <[email protected]>
  • Loading branch information
kyoichi-sugahara committed Jan 14, 2025
1 parent 5f47ad4 commit 2b1decb
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,28 @@ void LaneChangeModuleManager::updateModuleParams(const std::vector<rclcpp::Param
parameters, ns + "max_longitudinal_acc", p->trajectory.max_longitudinal_acc);
updateParam<double>(
parameters, ns + "lane_changing_decel_factor", p->trajectory.lane_changing_decel_factor);

int longitudinal_acc_sampling_num = 0;
updateParam<int>(parameters, ns + "lon_acc_sampling_num", p->trajectory.lon_acc_sampling_num);
updateParam<int>(parameters, ns + "lat_acc_sampling_num", p->trajectory.lat_acc_sampling_num);
updateParam<int>(parameters, ns + "lon_acc_sampling_num", longitudinal_acc_sampling_num);
if (longitudinal_acc_sampling_num > 0) {
p->trajectory.lon_acc_sampling_num = longitudinal_acc_sampling_num;
} else {
RCLCPP_WARN(
get_logger(),
"Parameter 'lon_acc_sampling_num' is not updated because the value (%d) is not positive",
longitudinal_acc_sampling_num);
}

int lateral_acc_sampling_num = 0;
updateParam<int>(parameters, ns + "lat_acc_sampling_num", lateral_acc_sampling_num);
if (lateral_acc_sampling_num > 0) {
p->trajectory.lat_acc_sampling_num = lateral_acc_sampling_num;
} else {
RCLCPP_WARN(
get_logger(),
"Parameter 'lat_acc_sampling_num' is not updated because the value (%d) is not positive",
lateral_acc_sampling_num);
}

updateParam<double>(
parameters, ns + "th_prepare_length_diff", p->trajectory.th_prepare_length_diff);
Expand Down

0 comments on commit 2b1decb

Please sign in to comment.