apollo icon indicating copy to clipboard operation
apollo copied to clipboard

在ipopt优化里,曲率约束?

Open longjianquan opened this issue 6 years ago • 3 comments

longjianquan avatar Jan 16 '20 07:01 longjianquan

在 /apollo/modules/planning/math/discretized_points_smoothing/fem_pos_deviation_ipopt_interface.cc中or (size_t i = 0; i + 2 < num_of_points_; ++i) { size_t findex = i * 2; size_t mindex = findex + 2; size_t lindex = mindex + 2; g[curvature_constr_start_index_ + i] = ( ((x[findex] + x[lindex]) - 2.0 * x[mindex]) * ((x[findex] + x[lindex]) - 2.0 * x[mindex]) + ((x[findex + 1] + x[lindex + 1]) - 2.0 * x[mindex + 1]) * ((x[findex + 1] + x[lindex + 1]) - 2.0 * x[mindex + 1])) - x[slack_var_start_index_ + i]; }

// b. curvature constraints double ref_total_length = 0.0; auto pre_point = ref_points_.front(); for (size_t i = 1; i < num_of_points_; ++i) { auto cur_point = ref_points_[i]; double x_diff = cur_point.first - pre_point.first; double y_diff = cur_point.second - pre_point.second; ref_total_length += std::sqrt(x_diff * x_diff + y_diff * y_diff); pre_point = cur_point; } double average_delta_s = ref_total_length / static_cast(num_of_points_ - 1); double curvature_constr_upper = average_delta_s * average_delta_s * curvature_constraint_;

为什么这样进行曲率 约束计算而不是 (x'*y''-y'*x'')/( (x')^2+(y')^2) )^(1.5)

longjianquan avatar Jan 17 '20 10:01 longjianquan

It is a approximate term for curvature minimization, not curvature itself

JasonZhou404 avatar Jun 22 '20 09:06 JasonZhou404

Hi @longjianquan , hope our answer resolved your question. We will close the issue for now. If you have any additional question, please feel free to open a new issue. Our engineer team are more than happy to help that.

Thank you for supporting Apollo!

sjiang2018 avatar Jul 01 '20 22:07 sjiang2018