cinnaboot
|
4699b08a94
|
Session: Local frame spacecraft maneuvering with planning system
Implemented maneuver planning system for spacecraft with time-based and true anomaly triggers:
**New Module: src/maneuver**
- TriggerType enum (TIME, TRUE_ANOMALY)
- Maneuver struct with burn parameters, trigger conditions, execution state
- Burn execution: apply_impulsive_burn() for 6 directions
- Trigger checking: check_maneuver_trigger() with orbital calculations
**Simulation State Integration:**
- Added maneuver array to SimulationState
- create_simulation() now takes max_maneuvers parameter
- Maneuvers execute automatically in update_simulation()
- Config loading handles [[maneuvers]] sections
**Config File Support:**
- [[maneuvers]] sections with name, spacecraft_name, trigger_type, trigger_value, direction, delta_v
- Validate spacecraft exists before loading
- Validate maneuver names are unique
- Parse trigger_type and direction strings to enums
**Code Quality:**
- Refactored update_simulation into 5 helper functions
- Single responsibility per function
- Cleaner, more readable code
**Test Coverage:**
- 5 new tests for maneuver planning (26 assertions)
- Config loading validation
- Time-based trigger execution
- True anomaly trigger execution
- Single execution guarantee
- Duplicate name validation
**Test Results:** 5/5 tests passing (100%)
- All existing tests continue to pass
**Documentation:**
- docs/maneuver_planning_plan.md - Full design specification
- docs/refactor_update_simulation.md - Refactoring plan
**Total Changes:**
- Files: 18 created/modified
- Net: +823 lines of well-documented, tested code
|
6 months ago |