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

fix(obstacle_avoidance_planner): fix inf loop in mpt #127

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions planning/obstacle_avoidance_planner/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,19 @@ Trajectories ObstacleAvoidancePlanner::optimizeTrajectory(
return getPrevTrajs(path.points);
}

// NOTE: Elastic band sometimes diverges with status = "OSQP_SOLVED".
constexpr double max_path_change_diff = 1.0e4;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらの値どのように決定したのでしょうか?
今回の発生した事象から決めた値でしょうか?
PRかチケットに決定した過程等記載いただくと今後なにかあった際に助かると思います。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そのとおりですね、すみません。
rosbagしかもらっていないのでチケットのリンク分からないためこちらで失礼します。

1e7レベルのオーダーでずれていたので、それより小さく、また現実的な値 (現状のAutowareでは大きくても1e1)の間を取って1e4としました。かなりテンポラリな値です。
Descriptionにも同じ事書きます。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なるほど。
承知しました。
それなら良さそうですね。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

チケット名記載しておきました

for (size_t i = 0; i < eb_traj->size(); ++i) {
const auto & eb_pos = eb_traj->at(i).pose.position;
const auto & path_pos = path.points.at(std::min(i, path.points.size() - 1)).pose.position;

const double diff_x = eb_pos.x - path_pos.x;
const double diff_y = eb_pos.y - path_pos.y;
if (max_path_change_diff < std::abs(diff_x) || max_path_change_diff < std::abs(diff_y)) {
return getPrevTrajs(path.points);
}
}

// EB has to be solved twice before solving MPT with fixed points
// since the result of EB is likely to change with/without fixing (1st/2nd EB)
// that makes MPT fixing points worse.
Expand Down