59 lines
2.3 KiB
C#
59 lines
2.3 KiB
C#
namespace MultiWheelC.TrajectoryPlanning.EMPlanner;
|
|
|
|
/// <summary>
|
|
/// LS/ST QP 求解器的迭代预算、收敛容差和运行选项。
|
|
/// </summary>
|
|
public sealed class SolverConfiguration
|
|
{
|
|
/// <summary>
|
|
/// 外层顺序凸化最大迭代次数;默认值 5,必须为正整数。
|
|
/// </summary>
|
|
public int MaximumOuterIterations { get; set; }
|
|
/// <summary>
|
|
/// 单次 OSQP 求解的最大迭代次数;默认值 4000,必须为正整数。
|
|
/// </summary>
|
|
public int MaximumOsqpIterations { get; set; }
|
|
/// <summary>
|
|
/// 求解器绝对残差容差;默认值 1e-5,必须为正有限值。
|
|
/// </summary>
|
|
public double AbsoluteTolerance { get; set; }
|
|
/// <summary>
|
|
/// 求解器相对残差容差;默认值 1e-5,必须为正有限值。
|
|
/// </summary>
|
|
public double RelativeTolerance { get; set; }
|
|
/// <summary>
|
|
/// 发布前接受解的严格残差容差;默认值 1e-5,必须为正有限值。
|
|
/// </summary>
|
|
public double StrictResidualTolerance { get; set; }
|
|
/// <summary>
|
|
/// 是否将上一轮可用解作为初值;无单位,默认值 <c>true</c>,仅接受布尔值。
|
|
/// </summary>
|
|
public bool WarmStart { get; set; }
|
|
/// <summary>
|
|
/// 是否请求 OSQP 进行结果修正;无单位,默认值 <c>true</c>,仅接受布尔值。
|
|
/// </summary>
|
|
public bool Polish { get; set; }
|
|
/// <summary>
|
|
/// 是否启用原生求解器诊断输出;无单位,默认值 <c>false</c>,仅接受布尔值。
|
|
/// </summary>
|
|
public bool NativeVerbose { get; set; }
|
|
|
|
/// <summary>
|
|
/// 复制当前求解器配置;输入为当前迭代预算、容差和布尔选项,输出为无共享可变状态的标量快照,不对数值作校验且不产生失败状态。
|
|
/// </summary>
|
|
internal SolverConfiguration Copy()
|
|
{
|
|
return new SolverConfiguration
|
|
{
|
|
MaximumOuterIterations = MaximumOuterIterations,
|
|
MaximumOsqpIterations = MaximumOsqpIterations,
|
|
AbsoluteTolerance = AbsoluteTolerance,
|
|
RelativeTolerance = RelativeTolerance,
|
|
StrictResidualTolerance = StrictResidualTolerance,
|
|
WarmStart = WarmStart,
|
|
Polish = Polish,
|
|
NativeVerbose = NativeVerbose,
|
|
};
|
|
}
|
|
}
|