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

obstacle_avoidance_planner sometimes crash when the vehicle goes beyond goal point #1930

Closed
3 tasks done
VRichardJP opened this issue Sep 21, 2022 · 7 comments
Closed
3 tasks done
Assignees
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) status:stale Inactive or outdated issues. (auto-assigned) type:bug Software flaws or errors.

Comments

@VRichardJP
Copy link
Contributor

VRichardJP commented Sep 21, 2022

Checklist

  • I've read the contribution guidelines.
  • I've searched other issues and no duplicate issues were found.
  • I'm convinced that this is not my fault but a bug.

Description

Several times today, the obstacle_avoidance_planner crashed in my vehicle. With GDB, I identified that full_traj_points trajectory below is sometimes empty:

const auto fine_traj_points = generateFineTrajectoryPoints(path_points, full_traj_points);

I modified the code like so, and the node stopped crashing:

  const auto full_traj_points =
    points_utils::concatTrajectory(optimized_traj_points, extended_traj_points);

  if (full_traj_points.empty()) {
    trajectory_points = points_utils::convertToTrajectoryPoints(path_points);
    return trajectory_points;
  }

  // NOTE: fine_traj_points has no velocity information
  const auto fine_traj_points = generateFineTrajectoryPoints(path_points, full_traj_points);

(however I have no idea if it is the correct way to handle that.)

Expected behavior

No crash

Actual behavior

Crash

Steps to reproduce

Seems to happen when the vehicle goes beyond goal point (in manual driving)

Versions

No response

Possible causes

No response

Additional context

No response

@takayuki5168 takayuki5168 added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Sep 22, 2022
@takayuki5168
Copy link
Contributor

@VRichardJP Thank you so much for your bug report and suggestion for bug fix.
I agree with your suggestion. Could you make a PR?

@VRichardJP
Copy link
Contributor Author

VRichardJP commented Sep 22, 2022

I would be happy to contribute. But is this workaround the good way to handle that situation?

For example a special case for empty trajectories could be added to generateFineTrajectoryPoints() instead. And by extension, to all planner functions that could crash on an empty path.

@takayuki5168
Copy link
Contributor

takayuki5168 commented Sep 23, 2022

@VRichardJP Hmm, I'm not 100% sure, but calculate-and-validate implementation as follows looks better to me.

 const auto full_traj_points =
    points_utils::concatTrajectory(optimized_traj_points, extended_traj_points);

  if (full_traj_points.empty()) {
    trajectory_points = points_utils::convertToTrajectoryPoints(path_points);
    return trajectory_points;
  }

@VRichardJP
Copy link
Contributor Author

as reported in #1956 there are many other cases in which this line will crash: nan values, inf (just some weird path?). I am not sure what is exactly to be tested here.

@BonoloAWF BonoloAWF added the type:bug Software flaws or errors. label Sep 27, 2022
@stale
Copy link

stale bot commented Dec 10, 2022

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Dec 10, 2022
@xmfcx
Copy link
Contributor

xmfcx commented Dec 13, 2022

@VRichardJP could you create a PR for this with your changes? So we can try to address your problems there.

@VRichardJP
Copy link
Contributor Author

The vehicle I had the problem with has been updated with a newer version of the code since then. Even though I did not keep my change after the update, I have never faced the problem again. So I guess it has been fixed somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) status:stale Inactive or outdated issues. (auto-assigned) type:bug Software flaws or errors.
Projects
None yet
Development

No branches or pull requests

4 participants