Skip to content

Commit dfa921e

Browse files
authored
docs: README update #9
- Added "How It Works" section in README - Added "Contributing" section in README (including branch name-convention)
2 parents fd26cae + a47bfd6 commit dfa921e

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
[![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3120/)
44
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
5+
[![CI](https://github.com/luk-kop/nmea-gps-emulator/actions/workflows/ci.yml/badge.svg)](https://github.com/luk-kop/nmea-gps-emulator/actions/workflows/ci.yml)
6+
[![CI Multi-Platform](https://github.com/luk-kop/nmea-gps-emulator/actions/workflows/ci-multiplatform.yml/badge.svg)](https://github.com/luk-kop/nmea-gps-emulator/actions/workflows/ci-multiplatform.yml)
7+
[![CodeQL](https://github.com/luk-kop/nmea-gps-emulator/actions/workflows/codeql.yml/badge.svg)](https://github.com/luk-kop/nmea-gps-emulator/actions/workflows/codeql.yml)
8+
[![codecov](https://codecov.io/gh/luk-kop/nmea-gps-emulator/branch/main/graph/badge.svg)](https://codecov.io/gh/luk-kop/nmea-gps-emulator)
59

610
The **NMEA-GPS Emulator** is a simple script that emulates a GPS receiver (simulates unit's movement). Data generated by the script are sent to clients in **NMEA 0183** format.
711
This script can be useful for testing applications or systems that require some unit's GPS position data.
@@ -48,6 +52,38 @@ $GPVTG,90.0,T,,M,10.5,N,19.4,K*51
4852
$GPZDA,173124.000,05,11,2021,0,0*50
4953
```
5054

55+
***
56+
## How It Works
57+
58+
The emulator simulates realistic GPS receiver behavior through several key components:
59+
60+
### Position Calculation
61+
- Uses **pyproj** library for geodetic calculations on the WGS84 ellipsoid
62+
- Calculates new positions based on current speed, heading, and time elapsed
63+
- Converts between geographic coordinates (lat/lon) and projected coordinates for accurate distance calculations
64+
- Updates position every second based on the unit's velocity vector
65+
66+
### NMEA Sentence Generation
67+
- Generates 8 standard NMEA 0183 sentences with proper formatting
68+
- Calculates XOR checksums for each sentence to ensure data integrity
69+
- Simulates realistic GPS data including:
70+
- Satellite information (GPGSV) with pseudo-random satellite positions and signal strengths
71+
- Dilution of Precision (DOP) values for position accuracy estimation
72+
- Time synchronization with system clock
73+
74+
### Threading Architecture
75+
- **Main thread**: Handles user input for interactive speed/course changes
76+
- **Worker threads**: Manage client connections and data transmission
77+
- TCP Server mode: Accepts up to 10 concurrent client connections
78+
- TCP/UDP Stream mode: Maintains persistent connection to specified client
79+
- Serial mode: Transmits data via RS-232 serial port
80+
- Thread-safe communication using events and locks for coordinated shutdown
81+
82+
### Data Transmission
83+
- Sends complete NMEA sentence sets every second
84+
- Automatically updates position before each transmission
85+
- Supports interactive runtime modifications of speed and heading without interrupting data flow
86+
5187
***
5288
## Getting Started
5389

@@ -152,3 +188,23 @@ After starting the script correctly, the following prompt should appear in the O
152188
4 - Quit
153189
>>>
154190
```
191+
192+
***
193+
## Contributing
194+
195+
Contributions are welcome! When creating a pull request, please ensure your branch name follows the naming convention:
196+
197+
**Valid branch name prefixes:**
198+
- `feature/` - New features
199+
- `fix/` or `bugfix/` - Bug fixes
200+
- `hotfix/` - Urgent fixes
201+
- `docs/` - Documentation changes
202+
- `chore/` - Maintenance tasks
203+
- `refactor/` - Code refactoring
204+
- `test/` - Test additions or modifications
205+
- `ci/` - CI/CD changes
206+
- `release/` - Release preparation
207+
208+
**Example:** `feature/add-nmea-sentence` or `fix/serial-port-timeout`
209+
210+
Pull requests with branch names not following this convention will be rejected by CI validation.

0 commit comments

Comments
 (0)