Add BurnResult struct (position, velocity, true_anomaly) to Maneuver.
Capture pre-burn state in update_spacecraft_physics() before applying
delta-v, enabling tests to assert exact burn-time periapsis location
and true anomaly with tight tolerances (R_TOL, ANG_TOL) instead of
propagation-level tolerances inflated by post-burn state drift.
Refactor test_periapsis_burn.cpp to use burn_result:
- Burn radius now asserts exactly at periapsis (R_TOL)
- True anomaly now asserts exactly 0 (ANG_TOL)
- Both sequential burns confirmed at same periapsis location
- 822 assertions passing (up from 813)
Phase A: Extend sim_engine.py with maneuver trigger detection
- Add TriggerType enum, Maneuver dataclass
- Implement check_maneuver_trigger() matching C++ sub-step logic
- Integrate maneuver execution into update_spacecraft()
- Add maneuvers_from_config() for TOML parsing
- Create precalc_periapsis_burn.py for expected value generation
Phase B: Refactor test_periapsis_burn.cpp
- Merge 4 TEST_CASEs into 1 SCENARIO with 5 SECTIONs
- Shared fixture setup in SCENARIO body
- Replace Approx() with WithinAbs() using named tolerance constants
- Use precalculated expected values for quantitative assertions
- Integer comparisons use REQUIRE() not WithinAbs()
- Add BurnResult plan comment for future burn-time state capture
TOML config converted to TOML 1.0 inline table syntax.
- Move RendezvousState and RendezvousTarget from rendezvous_types.h to orbital_objects.h
- Remove rendezvous_types.h entirely
- Simplify rendezvous.h to depend on orbital_objects.h
- Delete spacecraft.h and spacecraft.cpp (consolidated into orbital_objects.h)
- Update all include paths across codebase
- All tests pass (4 pre-existing failures unchanged)
- Add scheduled_dt field to Maneuver struct for precise timing
- Propagate spacecraft to exact trigger position before burn execution
- Handle 2π→0 wraparound in trigger crossing detection
- Add spacecraft tracking to prevent double-propagation in same frame
- Fix test configs and tolerances for new behavior
All 143 tests passing.
Added test cases that reveal the bug where periapsis burns execute
at apoapsis instead of periapsis after the first burn.
Changes:
- Modified tests/test_periapsis_burn.toml to include second spacecraft
(TestSatelliteCrossing) starting at true_anomaly = 1.57
- Replaced test "Prograde burn at periapsis raises apoapsis" with
"Two periapsis burns execute at same location" to verify sequential
periapsis burns one orbit apart both fire at correct location
- Added test "Periapsis burn fires when crossing periapsis" to verify burn
triggers when spacecraft crosses periapsis from 90 degrees
Both new tests fail as expected, confirming the bug exists in
cartesian_to_orbital_elements() where argument_of_periapsis is
calculated as π instead of 0 after a burn.
Test status: 4 periapsis tests fail (capturing bug)
Swap order in update_simulation() to check maneuvers before physics update.
This ensures triggers fire at the correct position instead of after the
spacecraft has moved past the trigger point.
Also fix test config to avoid interference between time-based and true
anomaly triggers.
Documents a bug where true anomaly triggers set to 0 (periapsis) don't
execute because the spacecraft moves past periapsis before the trigger
check happens. The trigger check occurs after physics propagation in the
simulation update order.
- test_periapsis_burn.cpp: Three test cases demonstrating expected behavior
1. Verify periapsis distance is preserved after prograde burn (fails - shows bug)
2. Verify apoapsis raises and periapsis stays same (skipped - depends on fix)
3. Verify burn location equals new periapsis (skipped - depends on fix)
- test_periapsis_burn.toml: Test configuration with elliptical orbit satellite
starting at periapsis with a true anomaly trigger at 0