This update adds interactive configuration support for geophysical measurements (gravity and magnetic anomaly) to the strapdown-sim config command.
- New optional field:
pub geophysical: Option<GeophysicalConfig> - Updated
Defaultimplementation to includegeophysical: None - This allows the main simulation configuration to include geophysical parameters
Added five new interactive prompt functions:
prompt_enable_geophysical()- Asks if user wants to enable geophysical navigationprompt_geo_resolution(measurement_type: &str)- Prompts for map resolution (15 options from 1° to 1")prompt_gravity_config()- Configures gravity anomaly measurements:- Map resolution
- Measurement bias (mGal)
- Noise standard deviation (mGal, default: 100.0)
- Map file path (optional, auto-detect if empty)
prompt_magnetic_config()- Configures magnetic anomaly measurements:- Map resolution
- Measurement bias (nT)
- Noise standard deviation (nT, default: 150.0)
- Map file path (optional, auto-detect if empty)
prompt_geo_measurement_frequency()- Sets measurement frequency in seconds
- Added "Geophysical Navigation Configuration" section
- Calls new prompt functions after GNSS degradation config
- Validates that at least one measurement type is enabled
- Builds and includes
GeophysicalConfigin finalSimulationConfig
Comprehensive guide covering:
- Overview of geophysical configuration
- Step-by-step wizard usage
- Configuration file format
- Available resolution options
- Default values
- Example usage
- Notes and requirements
Complete example configuration demonstrating:
- Gravity anomaly measurements setup
- Magnetic anomaly measurements setup
- Integration with closed-loop simulation
- TOML format with comments
Automated test script to verify the wizard functionality with simulated user input.
- Interactive prompts with clear options
- Default values for common parameters
- Input validation with helpful error messages
- Option to quit at any point with 'q'
- Enable/disable gravity measurements independently
- Enable/disable magnetic measurements independently
- Must enable at least one type if geophysical navigation is activated
- Auto-detection of map files if not specified
15 resolution levels available for both gravity and magnetic maps:
- From coarse (1 degree) to fine (1 arcsecond)
- Default: One Minute (good balance of accuracy and file size)
- Seamlessly integrated into existing config wizard
- Follows same patterns as other configuration sections
- Compatible with all simulation modes
- Works with existing TOML/JSON/YAML config formats
# Run the configuration wizard
strapdown-sim config
# When prompted:
# 1. Enable geophysical navigation: y
# 2. Enable gravity measurements: y
# - Select resolution: 11 (OneMinute)
# - Set bias: 0.0
# - Set noise std: 100.0
# - Map file: (press Enter for auto-detect)
# 3. Enable magnetic measurements: y
# - Select resolution: 11 (OneMinute)
# - Set bias: 0.0
# - Set noise std: 150.0
# - Map file: (press Enter for auto-detect)
# 4. Set measurement frequency: 1.0 (seconds)
# Use the generated config
strapdown-sim --config your_config.toml[geophysical]
gravity_resolution = "OneMinute"
gravity_bias = 0.0
gravity_noise_std = 100.0
magnetic_resolution = "OneMinute"
magnetic_bias = 0.0
magnetic_noise_std = 150.0
geo_frequency_s = 1.0- Easier Setup: No need to manually edit configuration files for geophysical measurements
- Reduced Errors: Input validation prevents common configuration mistakes
- Better UX: Interactive wizard guides users through all options
- Documentation: Clear prompts explain each parameter
- Flexibility: Users can enable only the measurements they need
- ✅ Code compiles without errors
- ✅ No clippy warnings in modified files
- ✅ All existing tests pass
- ✅ Markdown documentation passes linting
- ✅ Integration with existing config wizard verified
/home/james/Code/strapdown-rs/core/src/sim.rs/home/james/Code/strapdown-rs/sim/src/main.rs
/home/james/Code/strapdown-rs/docs/GEOPHYSICAL_CONFIG.md/home/james/Code/strapdown-rs/examples/configs/geonav_example.toml/home/james/Code/strapdown-rs/test_geo_config_wizard.sh
Users can now:
- Run
strapdown-sim configto create configurations with geophysical measurements - Refer to
docs/GEOPHYSICAL_CONFIG.mdfor detailed documentation - Use
examples/configs/geonav_example.tomlas a template - Test the wizard with
test_geo_config_wizard.sh