Thank you for your interest in contributing to NeuralFlight! 🧠
We welcome contributions of all kinds: bug reports, feature requests, documentation improvements, and code contributions.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Coding Standards
- Submitting Changes
- Community
This project adheres to a Code of Conduct (see CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
Before creating a bug report:
- Check the existing issues to avoid duplicates
- Try the latest version to see if the issue persists
Good bug reports include:
- Clear, descriptive title
- Steps to reproduce
- Expected vs. actual behavior
- System information (OS, Python version, GPU/CPU)
- Error messages and logs
- Screenshots/GIFs if applicable
Example:
**Title**: Motor imagery demo crashes on macOS with M1
**Description**:
When running `neuralflight-eeg`, the demo crashes immediately after loading the model.
**Steps to reproduce**:
1. Install on macOS 13.0 (M1 chip)
2. Run `pip install -e .`
3. Run `neuralflight-eeg`
4. Program crashes with error: ...
**Expected**: Demo should start and display window
**Actual**: Crashes with PyTorch MPS error
**System**:
- OS: macOS 13.0
- Python: 3.10.8
- PyTorch: 2.0.1
- Chip: Apple M1We love new ideas! Before suggesting:
- Check if it's already been proposed
- Consider if it fits the project's scope (neural control for autonomous systems)
Good feature requests include:
- Clear use case
- Why this feature is valuable
- Proposed implementation (if applicable)
- Alternatives you've considered
Example:
**Feature**: Add support for 4-class motor imagery (left/right hand + feet/rest)
**Use Case**: Enable more complex drone maneuvers (forward/back + left/right)
**Why**: Current 2-class only allows lateral movement. 4-class would enable:
- Forward/backward with feet imagery
- Left/right with hand imagery
- More natural 3D control
**Implementation Ideas**:
- Modify EEGNet output layer to 4 classes
- Update command mapping in config
- Add training option for runs [5,6,9,10,13,14]
**Alternatives**:
- Use head tracking for forward/backward (but defeats BCI-only purpose)Documentation improvements are always welcome:
- Fix typos or unclear explanations
- Add examples or tutorials
- Improve API documentation
- Translate documentation
Small fixes can be submitted directly. Larger changes should be discussed in an issue first.
We welcome code contributions! Areas where we need help:
- Adding new gesture recognition methods
- Improving EEG preprocessing
- Supporting more EEG datasets
- Real drone adapters (DJI Tello, etc.)
- Performance optimizations
- Cross-platform testing
- Unit tests
# Fork on GitHub, then clone your fork
git clone https://github.com/dronefreak/NeuralFlight.git
cd NeuralFlightpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate# Install with dev dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit installgit checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fixBranch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Adding tests
We follow PEP 8 with some modifications:
- Line length: 88 characters (Black default)
- Use type hints for function signatures
- Docstrings for all public functions/classes
We use these tools (run automatically with pre-commit):
# Format code
black src/
# Lint code
ruff check src/
# Type checking (optional but encouraged)
mypy src/Use Google-style docstrings:
def predict_command(eeg_epoch: np.ndarray) -> Tuple[str, float]:
"""
Predict drone command from EEG epoch.
Args:
eeg_epoch: EEG data of shape (n_channels, n_samples)
Returns:
Tuple of (command, confidence) where command is a string
like "strafe_left" and confidence is 0-1
Raises:
ValueError: If eeg_epoch has wrong shape
Example:
>>> epoch = np.random.randn(3, 480)
>>> cmd, conf = predict_command(epoch)
>>> print(f"Command: {cmd}, Confidence: {conf:.2%}")
"""
# ImplementationWhile we don't have comprehensive tests yet (contributions welcome!), ensure:
- Your code runs without errors
- Existing demos still work
- Add manual test instructions in your PR
Future test structure:
pytest tests/ # Run all tests
pytest tests/test_eeg.py # Run specific test file
pytest --cov=neuralflight # With coverageFollow Conventional Commits:
type(scope): short description
Longer description if needed.
Fixes #123
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Code style (formatting, no logic change)refactor: Code restructuringperf: Performance improvementtest: Adding testschore: Maintenance tasks
Examples:
feat(eeg): add 4-class motor imagery support
- Modified EEGNet to handle 4 output classes
- Updated training script for feet/rest imagery
- Added command mapping for forward/backward
Closes #45
---
fix(hand): resolve fist detection on low-light conditions
The distance threshold was too strict for dim lighting.
Increased threshold from 0.15 to 0.18.
Fixes #67
---
docs(readme): add troubleshooting section for macOS M1
Added common PyTorch MPS issues and workarounds.- Update documentation for any new features
- Test thoroughly on your system
- Update CHANGELOG.md if applicable
- Fill out the PR template completely
- Request review from maintainers
When opening a PR, include:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Performance improvement
## Testing
How did you test this?
- [ ] Tested locally
- [ ] Tested on Linux/Mac/Windows
- [ ] All demos work
- [ ] No regressions
## Checklist
- [ ] Code follows project style
- [ ] Documentation updated
- [ ] Pre-commit hooks pass
- [ ] No breaking changes (or documented)
## Screenshots (if applicable)
Add screenshots or GIFs showing the change
## Related Issues
Fixes #123
Related to #456- Maintainers will review within 3-5 business days
- Address review comments promptly
- Be open to suggestions and feedback
- Once approved, we'll merge your PR!
- Your contribution will be acknowledged in release notes
- You'll be added to the contributors list
- Thank you for making NeuralFlight better! 🎉
- GitHub Issues: Bug reports, feature requests
- GitHub Discussions: Questions, ideas, general chat
- Email: kumaar324@gmail.com for private matters
Stuck? Here's how to get help:
- Check documentation
- Search existing issues
- Open a GitHub Discussion
- Ask in your PR if related to your contribution
We value all contributions! Contributors are recognized:
- In release notes
- In the project README
- As GitHub contributors
Current focus areas:
- Stability: Bug fixes and reliability
- Documentation: Clear guides and examples
- Performance: Optimization and efficiency
- Features: New control methods and hardware support
Not sure where to start? Open a GitHub Discussion or reach out to maintainers. We're happy to help new contributors!
Thank you for contributing to NeuralFlight! Together, we're making neural control accessible to everyone. 🧠