Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么这里一定要在end_psi < 70 * M_PI / 180这种情况下设定这个最后一个路径点的朝向角偏差 #28

Open
james1kobby opened this issue Jun 5, 2024 · 4 comments

Comments

@james1kobby
Copy link

// End state.
(*lower_bound)(end_state_idx) = -1.0; //-OsqpEigen::INFTY;
(*upper_bound)(end_state_idx) = 1.0; //OsqpEigen::INFTY;
(*lower_bound)(end_state_idx + 1) = -OsqpEigen::INFTY;
(*upper_bound)(end_state_idx + 1) = OsqpEigen::INFTY;
if (FLAGS_constraint_end_heading && reference_path_.isBlocked() == nullptr) {
double end_psi = constrainAngle(vehicle_state_.getTargetState().heading - ref_states.back().heading);
if (end_psi < 70 * M_PI / 180) {
(*lower_bound)(end_state_idx + 1) = end_psi - 0.087; // 5 degree.
(*upper_bound)(end_state_idx + 1) = end_psi + 0.087;
}
}
大佬咨询以下,为什么这里一定要在end_psi < 70 * M_PI / 180这种情况下设定这个最后一个路径点的朝向角偏差,这个条件有什么作用呀,还有就是最后一个路径点的横向偏差在-1到1范围内,能不能把这个给调小一点

@LiJiangnanBit
Copy link
Owner

这个是因为在frenet坐标系下建模的,要是角度大于90度,可能就需要折返的path,就办不到了,70度就是设置了一个接近90度的数值,
横向偏差可以缩小,不过会有求解失败的情况。这个版本碰撞约束也是硬约束,硬约束如果没法全满足,会失败。

@james1kobby
Copy link
Author

// Collision.
const auto &bounds = reference_path_.getBounds();
for (size_t i = 0; i < n_; ++i) {
if (i < precise_planning_size_) {
const auto front_bounds = getSoftBounds(bounds[i].front.lb, bounds[i].front.ub, FLAGS_expected_safety_margin);
const auto rear_bounds = getSoftBounds(bounds[i].rear.lb, bounds[i].rear.ub, FLAGS_expected_safety_margin);
(*lower_bound)(precise_collision_idx + 2 * i, 0) = front_bounds.first;
(*upper_bound)(precise_collision_idx + 2 * i, 0) = front_bounds.second;
(*lower_bound)(precise_collision_idx + 2 * i + 1, 0) = rear_bounds.first;
(*upper_bound)(precise_collision_idx + 2 * i + 1, 0) = rear_bounds.second;
} else {
const auto center_bounds = getSoftBounds(bounds[i].center.lb, bounds[i].center.ub, FLAGS_expected_safety_margin);
size_t local_index = i - precise_planning_size_;
(*lower_bound)(rough_collision_idx + local_index, 0) = center_bounds.first;
(*upper_bound)(rough_collision_idx + local_index, 0) = center_bounds.second;
}
}那我现在讲这个碰撞的上下杰,全部改成固定的范围约束比如说是[-2,2],因为我在实际应用中这个获取两端到障碍物的距离,我感觉好难呀,比较慢。我这样做有没有什么很致命的缺陷呀,请教以下;

@james1kobby
Copy link
Author

这个是因为在frenet坐标系下建模的,要是角度大于90度,可能就需要折返的path,就办不到了,70度就是设置了一个接近90度的数值, 横向偏差可以缩小,不过会有求解失败的情况。这个版本碰撞约束也是硬约束,硬约束如果没法全满足,会失败。

还有就是我看你的cost函数里面针对i < precise_planning_size_和i > precise_planning_size_都有设置松弛变量,i > precise_planning_size_的松弛变量,我并没有在约束中看到,你这个的作用是什么呀

@james1kobby
Copy link
Author

这个是因为在frenet坐标系下建模的,要是角度大于90度,可能就需要折返的path,就办不到了,70度就是设置了一个接近90度的数值, 横向偏差可以缩小,不过会有求解失败的情况。这个版本碰撞约束也是硬约束,硬约束如果没法全满足,会失败。

还有就是我看你的cost函数里面针对i < precise_planning_size_和i > precise_planning_size_都有设置松弛变量,i > precise_planning_size_的松弛变量,我并没有在约束中看到,你这个的作用是什么呀

哦哦,我懂了,你这个i > precise_planning_size_的松弛变量也在约束中体现,只不过系数是1,也只是一个而已,所以不用居正表示

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants