Skip to main content

AEROSIM-TS-73

Project task

Integrate aircraft state at the fixed simulation step

Net forces and moments advance aircraft position, velocity, and attitude continuously and reject invalid state transitions.

AEROSIM-TS-73Canonical ID TASK-0073
Verified flow state
Done
Owner
AeroSim Architecture and Delivery
Component
@corp-v1-aerosim/flight-core — fixed-step aircraft integrator
Repository
corp-v1-aerosim/corp-v1-aerosim

Delivery scope

Implement advanceAircraftState(previous, forces, fixedStepSeconds): AircraftKinematicState with semi-implicit Euler translation and quaternion-based rotation. Normalize the output quaternion, increment simulationTick exactly once, and return a new state object. The function accepts only FlightForceResult from TASK-0001 and an AircraftMassProperties record.

Implementation contract

Implementation artifacts

  • packages/flight-core/src/simulation/advance-aircraft-state.ts
  • packages/flight-core/src/contracts/aircraft-state.ts
  • packages/flight-core/test/simulation/advance-aircraft-state.spec.ts

Inputs

  • AircraftKinematicState {simulationTick,positionM,velocityMps,attitudeQuaternion,angularVelocityRadps}, FlightForceResult, AircraftMassProperties {massKg,inertiaTensorKgM2}, and the configured fixedStepSeconds.

Outputs

  • A new AircraftKinematicState for simulationTick+1 with finite position, velocity, normalized attitudeQuaternion, and angular velocity; previous state and force payload are unchanged.

Failure boundaries

  • Throw AircraftIntegrationError(code='NON_FINITE_INPUT') if any state, force, moment, mass, inertia, or step component is non-finite.
  • Throw AircraftIntegrationError(code='INVALID_MASS_PROPERTIES') for mass <= 0 or a non-positive-definite inertia tensor.
  • Throw AircraftIntegrationError(code='TICK_DISCONTINUITY') if a caller supplies a force result tagged for a tick other than previous.simulationTick.
  • Throw AircraftIntegrationError(code='INVALID_RESULT') and retain the previous state when integration produces a non-finite vector or a quaternion norm outside 1±1e-6 after normalization.

Excluded scope

  • Variable-step integration, interpolation for rendering, collision response, wind calculation, autopilot, and replay persistence are not part of this function.

Verification steps

  • Run packages/flight-core/test/simulation/advance-aircraft-state.spec.ts.
  • Verify committed one-step and 600-step straight, climb, bank, and yaw fixtures including exact tick advancement and quaternion normalization.
  • Inject non-finite state/force fields, invalid mass/inertia, wrong tick, and forced overflow; assert the exact error code and that the previous state is returned unchanged to the coordinator.
  • Repeat each fixture twice and compare every state component within the committed integrator tolerance.

Traceability

Requirements

Dependencies

UI/UX applicability

non_visual

This Task owns technical or behavioral acceptance and does not claim direct visual conformance to the approved UI/UX package.

Acceptance evidence

Verified delivery: application PR #15 reviewed head 1b88b02170a7022a0ac641483a79ea19898f9351, exact-head validation task 1752 succeeded, merged as 6a949da20c4658d53e3231277dbd9ada50025e80; integrated Gitea Actions publish task 1756 and validate task 1757 succeeded. Release completion verified on product 1.0.0.0 at GitOps revision 5d3712d89dfbf7dacd993348e55f497d126c7bf9 with Argo Synced/Healthy, exact image digests, authenticated API/database access, and three-world configured-flight acceptance.

Current evidence boundary

No current implementation, acceptance, release, or deployment evidence is claimed for this planned Task. Any prior implementation may be used only as prototype and discovery evidence.