autowarefoundation / autoware.universe

https://autowarefoundation.github.io/autoware.universe/
Apache License 2.0
966 stars 631 forks source link

Handle NaNs when using OSQP #3040

Closed maxime-clem closed 1 year ago

maxime-clem commented 1 year ago

Checklist

Description

OSQP is used to solve optimization problems in several Autoware nodes. In some cases, OSQP can return a result containing NaN values, which is not currently handled correctly and can lead to crashes.

See https://github.com/autowarefoundation/autoware.universe/issues/2925 for the original reported issue.

Purpose

We want Autoware to remain functional even in the case where OSQP returns NaN values.

Possible approaches

Special cases need to be implemented when OSQP returns NaN values.

Definition of done

Handling of NaNs is implemented in the following packages:

soblin commented 1 year ago

I think returning std::optional is an option. Like returning nullopt if not has_solution.