31 lines
827 B
C#
31 lines
827 B
C#
namespace MultiWheelC.TrajectoryPlanning.EMPlanner;
|
|
|
|
internal static class OsqpStatusMapper
|
|
{
|
|
public static QpSolveStatus Map(int nativeStatusValue)
|
|
{
|
|
switch (nativeStatusValue)
|
|
{
|
|
case 1:
|
|
return QpSolveStatus.Solved;
|
|
case 2:
|
|
return QpSolveStatus.SolvedInaccurate;
|
|
case 3:
|
|
case 4:
|
|
return QpSolveStatus.PrimalInfeasible;
|
|
case 5:
|
|
case 6:
|
|
return QpSolveStatus.DualInfeasible;
|
|
case 7:
|
|
return QpSolveStatus.MaximumIterations;
|
|
case 8:
|
|
return QpSolveStatus.TimeLimit;
|
|
case 9:
|
|
case 10:
|
|
case 11:
|
|
default:
|
|
return QpSolveStatus.NativeError;
|
|
}
|
|
}
|
|
}
|