Skip to content

[AUD-019][High] Prevent LQR Cart-Pole simulator startup abort #314

Description

@gabrielsantosphilips

Audit finding

  • ID: AUD-019
  • Status: Verified defect
  • Severity: High
  • Confidence: High
  • Audited revision: 2f479320d805a1f9f35ebe4afaaeeded48913a94

Problem

The default LQR Cart-Pole simulator aborts during construction before entering the Qt event loop. LqrCartPoleSimulator() calls Configure() and RecomputeGain(), which uses the asserting LQR constructor; the default DARE result is not converged.

Source:

{
LqrCartPoleSimulator::LqrCartPoleSimulator()
{
Configure(LqrCartPoleConfig{});
}
void LqrCartPoleSimulator::Configure(const LqrCartPoleConfig& config)
{
configuration = config;
plant = CartPolePlant(config.plantParams);
RecomputeGain();
}
void LqrCartPoleSimulator::Reset()
{
plant.Reset();
}
void LqrCartPoleSimulator::SetState(const CartPoleState& state)
{
plant.SetState(state);
}
void LqrCartPoleSimulator::RecomputeGain()
{
auto& w = configuration.weights;
StateMatrix Q{
{ w.qX, 0.0f, 0.0f, 0.0f },
{ 0.0f, w.qXDot, 0.0f, 0.0f },
{ 0.0f, 0.0f, w.qTheta, 0.0f },
{ 0.0f, 0.0f, 0.0f, w.qThetaDot },
};

Reproduction

An offscreen startup smoke test exits 134 with the Lqr.hpp assertion r.converged. The other ten simulator executables remained alive until timeout.

Acceptance criteria

  • The default executable constructs and enters its event loop.
  • Use recoverable LQR creation/status handling in the simulator.
  • Validate default plant, discretization, and weights.
  • Add an offscreen construction/startup test to CI.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions