- Move all configs from tests/configs/ to tests/
- Rename configs to match test filenames (test_NAME.toml)
- Remove unused configs (earth_mars_simple, simple_root_transition, interplanetary_transfer)
- Combine earth_circular and mars_circular into test_orbital_period.toml
- Duplicate earth_circular.toml as test_energy.toml
- Remove invalid parent test case from test_invalid_parent_assignment.cpp
- Update all test files to reference new config paths
- Delete tests/configs/ directory
- Delete 'Earth should not become child of spacecraft' test (spacecraft are now in separate array)
- Delete 'detect placeholder config values' test (validation now happens at load time)
- Added orbital_mechanics module with orbital_elements_to_cartesian()
- Updated initialize_orbital_objects() to use orbital mechanics
- Added validate_initial_positions() for post-initialization checking
- Fixed test files to use global_position/global_velocity
- Updated config loader to support spacecraft altitude parameter
- Fixed orbital_mechanics.cpp velocity calculation bug (removed duplicate scaling)
- Updated Makefile to include orbital_mechanics.o in test build
- Renamed simulation.h OrbitalMetrics to OrbitalAnalysis to avoid conflict
- Added docs/parabolic_union_implementation.md for parabolic orbit support plan
Note: Test configs still need manual fix for orbit table TOML syntax
Merge spacecraft management into simulation module:
- Move Spacecraft struct from maneuver.h to spacecraft.h
- Add spacecraft array to SimulationState (spacecraft, craft_count, max_craft)
- Remove separate SpacecraftState struct and related functions
- Update create_simulation() to require max_craft parameter
- Move spacecraft update logic into update_simulation()
- Make load_spacecraft_config() internal helper, called by load_system_config()
- Update all test files to use new API with 3-parameter create_simulation()
- Handle max_craft=0 case gracefully (no spacecraft allocation)
Test results: 26/27 passing (1 pre-existing SOI test unrelated to changes)
Added validation in config_loader to prevent bodies from starting too close
to their parent bodies (distance must be >= parent.radius + body.radius).
Changes:
- src/config_loader.cpp: Add parent-child distance validation before initialization
- tests/configs/earth_mars_simple.toml: Fix spacecraft position to LEO altitude
(Earth position + 6.571e6 m offset = 1.49606571e11 m)
- tests/test_invalid_parent_assignment.cpp: Update test 3 to use radius-based validation
- docs/mission_planning.md: Add TODO about spacecraft config pattern changes
Test results:
- Test 1: ✅ PASS (Earth no longer becomes child of spacecraft)
- Test 2: ✅ PASS (Mass hierarchy preserved)
- Test 3: ✅ PASS (Spacecraft at valid LEO position)
- Test 4: ❌ FAIL (mutual SOI bug, as expected)
This prevents the spacecraft initialization bug where Earth would incorrectly
become a child of the spacecraft due to distance=0.
Added comprehensive tests to capture parent-child relationship bugs:
- Test 1: Detect Earth becoming child of spacecraft (exact FIXME bug)
- Test 2: Validate mass hierarchy (massive bodies never have small parents)
- Test 3: Detect invalid config placeholder values (bodies at same position)
- Test 4: Mutual SOI edge case (similar-mass planets within SOI)
All tests fail as expected, documenting bugs for future fixes.
Tests 1-3 will pass after spacecraft separation fix.
Test 4 captures separate mutual SOI issue.
Files:
- docs/test_plan_invalid_parent_assignment.md (test plan)
- tests/test_invalid_parent_assignment.cpp (4 test cases)
- tests/configs/mutual_soi_close.toml (edge case config)