A high-performance C++ driver suite for GPS, IMU, and UBX modules in rover projects. Optimized for resource-constrained systems like Raspberry Pi.
- High-Performance C++ Drivers: Python-to-C++ conversion for real-time navigation applications
- Modern C++ Standards: C++11-20 features for clean, maintainable code
- Resource Efficient: Optimized for systems with limited resources (1GB RAM)
- Quality Assured: Git pre-commit hooks for code quality control
- Containerized Development: Docker environment for consistent development
Click the thumbnail to watch the IMU Kalman Filter visualization
├── src/ # Source code for GPS, IMU, and UBX drivers
├── include/ # Header files
├── tests/ # Unit tests
├── Dockerfile # Development environment configuration
├── setup.sh # Environment setup script
└── CMakeLists.txt # Build configuration
- Raspberry Pi (or compatible microcontroller)
- GPS Module (e.g., SAM-M8Q)
- IMU Module (e.g., ICM-20948)
- Qwiic cables for connections
- Ubuntu 22.04 LTS (primary focus, others may work)
- Docker
- CMake
- Git
- Python 3.10 (for testing/calibration scripts)
- pre-commit (
pip install pre-commit
)
- Eigen3 (matrix operations, Kalman filter)
- I2C library (module communication)
- UBX protocol library (GPS message parsing)
-
Clone the Repository
git clone https://github.com/luisdavidgarcia/GPS_IMU_C_Driver cd GPS_IMU_C_Driver
-
Setup Environment
./setup.sh # Creates Docker image and installs pre-commit hooks
-
Build the Project within the Docker Container
mkdir build cd build cmake .. make
The project is designed to be built and developed within a Docker container:
- Use VSCode with Remote-Containers extension to work inside the container
- Run pre-commit hooks before committing to ensure code quality
- Follow C++ Google Style Guide and C++ Core Guidelines
- Power: Raspberry Pi 3.3V → GPS module VCC
- Ground: Raspberry Pi GND → GPS module GND
- I2C:
- Raspberry Pi SCL → GPS module SCL
- Raspberry Pi SDA → GPS module SDA
- Daisy Chain: Connect GPS to IMU module using Qwiic cable
- Ensure different I2C addresses for GPS and IMU modules
- No Response: Check wiring and power supply
- Incorrect Readings: Verify calibration and configuration
- I2C Errors: Check addresses and connections
- UBX Parse Errors: Verify message format and checksum
- Use gdb for code debugging
- Check connections and power
- Verify I2C configuration
- Confirm library installations
- Fork and branch for features/fixes
- Make changes and run pre-commit hooks
- Submit PR with clear description
- Address reviewer feedback
- GPS: SparkFun UBX, Melopero SAM-M8Q
- IMU: SparkFun ICM-20948
- Kalman: EKF Navigation, Eigen3
- I2C: I2C on Raspberry Pi, Linux I2C
This project is licensed under the MIT License - see the LICENSE file for details.
Thanks to the open-source projects that inspired this driver suite and to the community for contributions and feedback.