|
| 1 | +# Summary: Geophysical Measurement Configuration for strapdown-sim |
| 2 | + |
| 3 | +## Changes Made |
| 4 | + |
| 5 | +This update adds interactive configuration support for geophysical measurements (gravity and magnetic anomaly) to the `strapdown-sim config` command. |
| 6 | + |
| 7 | +### 1. Core Library Changes (`core/src/sim.rs`) |
| 8 | + |
| 9 | +#### Added `geophysical` field to `SimulationConfig` |
| 10 | +- New optional field: `pub geophysical: Option<GeophysicalConfig>` |
| 11 | +- Updated `Default` implementation to include `geophysical: None` |
| 12 | +- This allows the main simulation configuration to include geophysical parameters |
| 13 | + |
| 14 | +### 2. CLI Changes (`sim/src/main.rs`) |
| 15 | + |
| 16 | +#### New Prompt Functions |
| 17 | +Added five new interactive prompt functions: |
| 18 | + |
| 19 | +1. **`prompt_enable_geophysical()`** - Asks if user wants to enable geophysical navigation |
| 20 | +2. **`prompt_geo_resolution(measurement_type: &str)`** - Prompts for map resolution (15 options from 1° to 1") |
| 21 | +3. **`prompt_gravity_config()`** - Configures gravity anomaly measurements: |
| 22 | + - Map resolution |
| 23 | + - Measurement bias (mGal) |
| 24 | + - Noise standard deviation (mGal, default: 100.0) |
| 25 | + - Map file path (optional, auto-detect if empty) |
| 26 | +4. **`prompt_magnetic_config()`** - Configures magnetic anomaly measurements: |
| 27 | + - Map resolution |
| 28 | + - Measurement bias (nT) |
| 29 | + - Noise standard deviation (nT, default: 150.0) |
| 30 | + - Map file path (optional, auto-detect if empty) |
| 31 | +5. **`prompt_geo_measurement_frequency()`** - Sets measurement frequency in seconds |
| 32 | + |
| 33 | +#### Updated `create_config_file()` Function |
| 34 | +- Added "Geophysical Navigation Configuration" section |
| 35 | +- Calls new prompt functions after GNSS degradation config |
| 36 | +- Validates that at least one measurement type is enabled |
| 37 | +- Builds and includes `GeophysicalConfig` in final `SimulationConfig` |
| 38 | + |
| 39 | +### 3. Documentation |
| 40 | + |
| 41 | +#### New Documentation File (`docs/GEOPHYSICAL_CONFIG.md`) |
| 42 | +Comprehensive guide covering: |
| 43 | +- Overview of geophysical configuration |
| 44 | +- Step-by-step wizard usage |
| 45 | +- Configuration file format |
| 46 | +- Available resolution options |
| 47 | +- Default values |
| 48 | +- Example usage |
| 49 | +- Notes and requirements |
| 50 | + |
| 51 | +### 4. Example Configuration (`examples/configs/geonav_example.toml`) |
| 52 | +Complete example configuration demonstrating: |
| 53 | +- Gravity anomaly measurements setup |
| 54 | +- Magnetic anomaly measurements setup |
| 55 | +- Integration with closed-loop simulation |
| 56 | +- TOML format with comments |
| 57 | + |
| 58 | +### 5. Test Script (`test_geo_config_wizard.sh`) |
| 59 | +Automated test script to verify the wizard functionality with simulated user input. |
| 60 | + |
| 61 | +## Features |
| 62 | + |
| 63 | +### User-Friendly Configuration |
| 64 | +- Interactive prompts with clear options |
| 65 | +- Default values for common parameters |
| 66 | +- Input validation with helpful error messages |
| 67 | +- Option to quit at any point with 'q' |
| 68 | + |
| 69 | +### Flexible Measurement Configuration |
| 70 | +- Enable/disable gravity measurements independently |
| 71 | +- Enable/disable magnetic measurements independently |
| 72 | +- Must enable at least one type if geophysical navigation is activated |
| 73 | +- Auto-detection of map files if not specified |
| 74 | + |
| 75 | +### Resolution Options |
| 76 | +15 resolution levels available for both gravity and magnetic maps: |
| 77 | +- From coarse (1 degree) to fine (1 arcsecond) |
| 78 | +- Default: One Minute (good balance of accuracy and file size) |
| 79 | + |
| 80 | +### Integration with Existing Workflow |
| 81 | +- Seamlessly integrated into existing config wizard |
| 82 | +- Follows same patterns as other configuration sections |
| 83 | +- Compatible with all simulation modes |
| 84 | +- Works with existing TOML/JSON/YAML config formats |
| 85 | + |
| 86 | +## Usage Example |
| 87 | + |
| 88 | +```bash |
| 89 | +# Run the configuration wizard |
| 90 | +strapdown-sim config |
| 91 | + |
| 92 | +# When prompted: |
| 93 | +# 1. Enable geophysical navigation: y |
| 94 | +# 2. Enable gravity measurements: y |
| 95 | +# - Select resolution: 11 (OneMinute) |
| 96 | +# - Set bias: 0.0 |
| 97 | +# - Set noise std: 100.0 |
| 98 | +# - Map file: (press Enter for auto-detect) |
| 99 | +# 3. Enable magnetic measurements: y |
| 100 | +# - Select resolution: 11 (OneMinute) |
| 101 | +# - Set bias: 0.0 |
| 102 | +# - Set noise std: 150.0 |
| 103 | +# - Map file: (press Enter for auto-detect) |
| 104 | +# 4. Set measurement frequency: 1.0 (seconds) |
| 105 | + |
| 106 | +# Use the generated config |
| 107 | +strapdown-sim --config your_config.toml |
| 108 | +``` |
| 109 | + |
| 110 | +## Configuration File Example |
| 111 | + |
| 112 | +```toml |
| 113 | +[geophysical] |
| 114 | +gravity_resolution = "OneMinute" |
| 115 | +gravity_bias = 0.0 |
| 116 | +gravity_noise_std = 100.0 |
| 117 | +magnetic_resolution = "OneMinute" |
| 118 | +magnetic_bias = 0.0 |
| 119 | +magnetic_noise_std = 150.0 |
| 120 | +geo_frequency_s = 1.0 |
| 121 | +``` |
| 122 | + |
| 123 | +## Benefits |
| 124 | + |
| 125 | +1. **Easier Setup**: No need to manually edit configuration files for geophysical measurements |
| 126 | +2. **Reduced Errors**: Input validation prevents common configuration mistakes |
| 127 | +3. **Better UX**: Interactive wizard guides users through all options |
| 128 | +4. **Documentation**: Clear prompts explain each parameter |
| 129 | +5. **Flexibility**: Users can enable only the measurements they need |
| 130 | + |
| 131 | +## Testing |
| 132 | + |
| 133 | +- ✅ Code compiles without errors |
| 134 | +- ✅ No clippy warnings in modified files |
| 135 | +- ✅ All existing tests pass |
| 136 | +- ✅ Markdown documentation passes linting |
| 137 | +- ✅ Integration with existing config wizard verified |
| 138 | + |
| 139 | +## Files Modified |
| 140 | + |
| 141 | +1. `/home/james/Code/strapdown-rs/core/src/sim.rs` |
| 142 | +2. `/home/james/Code/strapdown-rs/sim/src/main.rs` |
| 143 | + |
| 144 | +## Files Added |
| 145 | + |
| 146 | +1. `/home/james/Code/strapdown-rs/docs/GEOPHYSICAL_CONFIG.md` |
| 147 | +2. `/home/james/Code/strapdown-rs/examples/configs/geonav_example.toml` |
| 148 | +3. `/home/james/Code/strapdown-rs/test_geo_config_wizard.sh` |
| 149 | + |
| 150 | +## Next Steps |
| 151 | + |
| 152 | +Users can now: |
| 153 | +1. Run `strapdown-sim config` to create configurations with geophysical measurements |
| 154 | +2. Refer to `docs/GEOPHYSICAL_CONFIG.md` for detailed documentation |
| 155 | +3. Use `examples/configs/geonav_example.toml` as a template |
| 156 | +4. Test the wizard with `test_geo_config_wizard.sh` |
0 commit comments