在ipopt优化里,曲率约束?
在 /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
为什么这样进行曲率 约束计算而不是 (x'*y''-y'*x'')/( (x')^2+(y')^2) )^(1.5)
It is a approximate term for curvature minimization, not curvature itself
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!