Skip to content

Commit 91c688f

Browse files
Copilotjbrodovsky
andcommitted
Add comprehensive sections to copilot-instructions.md per best practices
Co-authored-by: jbrodovsky <57160841+jbrodovsky@users.noreply.github.com>
1 parent c625fe9 commit 91c688f

1 file changed

Lines changed: 110 additions & 1 deletion

File tree

.github/copilot-instructions.md

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,113 @@ Experimental geophysical navigation using gravity/magnetic anomaly maps:
5353
- Integrates geophysical measurements with INS/GNSS
5454
- Provides alternative PNT in GNSS-denied environments
5555

56-
Additional core capabilities should be implemented as needed either as a new create for larger features or as new modules within an existing crate for smaller features.
56+
Additional core capabilities should be implemented as needed either as a new create for larger features or as new modules within an existing crate for smaller features.
57+
58+
## Dependencies and Prerequisites
59+
60+
### System Dependencies
61+
The project requires the following system libraries for building:
62+
- `pkg-config`
63+
- `libhdf5-dev` and `libhdf5-openmpi-dev` (for HDF5 support)
64+
- `libnetcdf-dev` (for NetCDF geophysical data)
65+
- `zlib1g-dev` (for compression support)
66+
67+
On Ubuntu/Debian systems, install with:
68+
```bash
69+
sudo apt update
70+
sudo apt install -y pkg-config libhdf5-dev libhdf5-openmpi-dev libnetcdf-dev zlib1g-dev
71+
```
72+
73+
### Rust Toolchain
74+
- Minimum Rust version: 1.70+ (stable channel)
75+
- Required components: `clippy`, `rustfmt`
76+
77+
## Build and Test Commands
78+
79+
### Building the Project
80+
Build the entire workspace:
81+
```bash
82+
cargo build --workspace --all-features
83+
```
84+
85+
Build a specific crate:
86+
```bash
87+
cargo build -p strapdown-core
88+
cargo build -p strapdown-sim
89+
cargo build -p strapdown-geonav
90+
```
91+
92+
### Running Tests
93+
Run all tests in the workspace:
94+
```bash
95+
cargo test --workspace --all-features --verbose
96+
```
97+
98+
Run tests for a specific crate:
99+
```bash
100+
cargo test -p strapdown-core
101+
```
102+
103+
### Linting and Formatting
104+
Run clippy for linting:
105+
```bash
106+
cargo clippy --workspace --all-features
107+
```
108+
109+
Format code with rustfmt:
110+
```bash
111+
cargo fmt --all
112+
```
113+
114+
### Running the Simulation
115+
The `strapdown-sim` binary can be run with various options:
116+
```bash
117+
# Build and install the simulation binary
118+
cargo install --path sim
119+
120+
# Run with a configuration file
121+
strapdown-sim --config examples/configs/example.toml
122+
123+
# Run with specific log level
124+
strapdown-sim --config examples/configs/example.toml --log-level debug
125+
```
126+
127+
## Testing Guidelines
128+
129+
### Test Structure
130+
- **Unit tests**: Inline in source files using `#[cfg(test)]` modules
131+
- **Integration tests**: Located in `core/tests/integration_tests.rs`
132+
- Tests should cover edge cases, error handling, and numerical accuracy
133+
134+
### Test Naming
135+
- Test function names should be descriptive: `test_<functionality>_<scenario>`
136+
- Example: `test_wgs84_geodetic_to_ecef_conversion`
137+
138+
### Running Specific Tests
139+
```bash
140+
# Run tests matching a pattern
141+
cargo test test_wgs84
142+
143+
# Run a specific test
144+
cargo test test_specific_function_name
145+
```
146+
147+
## Common Workflows
148+
149+
### Adding a New Module
150+
1. Create the module file in the appropriate crate's `src/` directory
151+
2. Add the module declaration in `lib.rs` or `main.rs`
152+
3. Include comprehensive doc comments with examples
153+
4. Add unit tests within the module
154+
5. Update integration tests if needed
155+
156+
### Working with Simulation Data
157+
- Input data format: CSV files from Sensor Logger app or similar
158+
- CSV columns expected: timestamp, gyro (x,y,z), accel (x,y,z), GPS data, etc.
159+
- See `core/src/sim.rs` for data loading functions
160+
161+
### Adding a New Kalman Filter
162+
- Extend `core/src/kalman.rs` module
163+
- Implement state transition and measurement models
164+
- Follow the existing UKF pattern for consistency
165+
- Add comprehensive tests for filter convergence and accuracy

0 commit comments

Comments
 (0)