{"id":20789538,"url":"https://github.com/noahfeldt/gps-from-scratch","last_synced_at":"2026-05-24T13:32:59.812Z","repository":{"id":192307623,"uuid":"686471305","full_name":"NoahFeldt/GPS-From-Scratch","owner":"NoahFeldt","description":"This project aims to implement GPS positioning from scratch with some simplifying assumptions.","archived":false,"fork":false,"pushed_at":"2023-09-02T22:51:24.000Z","size":5252,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T10:27:23.030Z","etag":null,"topics":["gnss","gps","gps-data","gps-location","gps-satellites","python","rtcm","rtcm3","satellite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NoahFeldt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-02T22:49:44.000Z","updated_at":"2023-09-18T13:19:25.000Z","dependencies_parsed_at":"2023-09-04T04:23:15.069Z","dependency_job_id":null,"html_url":"https://github.com/NoahFeldt/GPS-From-Scratch","commit_stats":null,"previous_names":["noahfeldt/gps-from-scratch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoahFeldt%2FGPS-From-Scratch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoahFeldt%2FGPS-From-Scratch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoahFeldt%2FGPS-From-Scratch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoahFeldt%2FGPS-From-Scratch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NoahFeldt","download_url":"https://codeload.github.com/NoahFeldt/GPS-From-Scratch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243135432,"owners_count":20241965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnss","gps","gps-data","gps-location","gps-satellites","python","rtcm","rtcm3","satellite"],"created_at":"2024-11-17T15:24:46.696Z","updated_at":"2025-12-24T13:50:26.487Z","avatar_url":"https://github.com/NoahFeldt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPS-From-Scratch\r\n\r\nThis project aims to implement GPS positioning from scratch with some simplifying assumptions.\r\n\r\n## Prerequisites\r\n\r\nThe scripts in this project depend on the [pyrtcm](https://github.com/semuconsulting/pyrtcm) library for parsing the RTCM3 messages, which is installed with:\r\n\r\n```bash\r\npip install pyrtcm\r\n```\r\n\r\nThe project also depends on the [numpy](https://github.com/numpy/numpy) library for vector and matrix operations:\r\n\r\n```bash\r\npip install numpy\r\n```\r\n\r\nFor plotting graphs [matplotlib](https://github.com/matplotlib/matplotlib) is used:\r\n\r\n```bash\r\npip install matplotlib\r\n```\r\n\r\nAnd finally, [basemap](https://github.com/matplotlib/basemap) is used to plot data on maps:\r\n\r\n```bash\r\npip install basemap\r\n```\r\n\r\n## Usage\r\n\r\nTo run this project, place your RTCM file in the \"data\" directory and run the Python file \"gps_from_scratch.py\" in the \"src\" directory. This action will create some plots from the data in the \"plots\" directory.\r\n\r\n## Explanation\r\n\r\n### GPS Signals\r\n\r\nThis project uses the [RTCM3 protocol](https://en.wikipedia.org/wiki/RTCM_SC-104) to encode the raw GPS data sent by the GPS satellites in messages 1002 and 1019.\r\n\r\nMessage 1002 contains information about the [pseudorange](https://en.wikipedia.org/wiki/Pseudorange), which is the approximate distance from the receiver to the satellites.\r\n\r\nMessage 1019 contains information about the orbit of the satellites, including the [Keplerian elements](https://en.wikipedia.org/wiki/Orbital_elements#Keplerian_elements) used to calculate the position of the satellite at any given time.\r\n\r\n### Simplifying Assumptions\r\n\r\nTo implement GPS positioning in a more approachable manner, some simplifying assumptions were made:\r\n\r\n* Pseudoranges are not corrected for any error except for the clock bias in the receiver. Most importantly, this means that effects such as [atmospheric effects](https://en.wikipedia.org/wiki/Error_analysis_for_the_Global_Positioning_System#Atmospheric_effects) are ignored.\r\n\r\n* The satellite orbits are based only on [Kepler's laws](https://en.wikipedia.org/wiki/Kepler's_laws_of_planetary_motion) and are not corrected. This means that relativistic effects on orbits are ignored, due to their eccentricity being more than zero.\r\n\r\n* The earth is assumed to be perfectly spherical with its center of mass in the center of the sphere, instead of approximating it as an [ellipsoid](https://en.wikipedia.org/wiki/Earth_ellipsoid). This simplification means there will be an error in mapping ECEF coordinates to spherical coordinates.\r\n\r\n## Results\r\n\r\nThe following map shows the distribution of calculated positions based on each measurement:\r\n\r\n![positions](plots/data.rtcm3/positions_map.png)\r\n\r\nAs we can see, the points are scattered a lot due to our simplifying assumptions while being clustered around Denmark, where the RTCM data was recorded. Therefore, we know that we have successfully implemented the elementary mechanisms of GPS positioning.\r\n\r\nThis plot shows the raw pseudorange measurements of different GPS satellites during the recording. It is possible to see when satellites gain and lose connection to the receiver: \r\n\r\n![positions](plots/data.rtcm3/pseudoranges.png)\r\n\r\nThis plot shows the extrapolated orbits in an ECI frame of the GPS satellites whose Keplerian parameters were received during the recording:\r\n\r\n![positions](plots/data.rtcm3/orbits_eci.png)\r\n\r\nSee other plots in the \"plots\" directory.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahfeldt%2Fgps-from-scratch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoahfeldt%2Fgps-from-scratch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahfeldt%2Fgps-from-scratch/lists"}