feat: solve QPs through OSQP

This commit is contained in:
梁薄云
2026-08-04 00:19:26 +08:00
parent 2051827416
commit a957fda6c5
3 changed files with 461 additions and 2 deletions
@@ -0,0 +1,30 @@
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;
}
}
}