A Go implementation of RTKLIB 2.4.3 for GNSS development and research.
GNSSGo is a Go port of the popular RTKLIB C library for GNSS (Global Navigation Satellite System) data processing. It provides tools for real-time and post-processing of GNSS data, supporting various formats and protocols.
RTKLIB is an excellent tool for GNSS development and research. This project recodes RTKLIB in Go to leverage the language's modern features, concurrency model, and cross-platform capabilities.
This library can be imported into your Go applications to add RTK and other GNSS processing capabilities.
- Support for various GNSS systems (GPS, GLONASS, Galileo, QZSS, BeiDou, IRNSS)
- Real-time and post-processing positioning
- Various positioning modes (single, DGPS/DGNSS, Kinematic, Static, PPP-Kinematic, PPP-Static)
- Support for standard formats (RINEX, RTCM, BINEX, etc.)
- Serial, TCP/IP, NTRIP, and file handling
- Thread-safe serial port communication using go.bug.st/serial
See CHANGELOG.md for a detailed history of changes.
- 2023/06/06 1.0 - Initial release
- 2023/06/15 1.1 - Updated to Go 1.21, replaced serial library with go.bug.st/serial
- Go 1.21 or later
To use GNSSGO as a library in your Go project:
# Add the library to your project
go get github.com/bramburn/gnssgo/pkg/gnssgoThen import it in your code:
import "github.com/bramburn/gnssgo/pkg/gnssgo"# Clone the repository
git clone https://github.com/bramburn/gnssgo.git
cd gnssgo
# Build the main library
cd pkg/gnssgo
go build .
cd ../..
# Build an example application
cd app/convbin
go build .
cd ../..
# Build and run the GUI application
cd gui
wails dev
cd ..
# Run tests for the main library
cd unittest
go test .
cd ..This project uses Go workspaces (go.work) to manage multiple modules:
pkg/gnssgo/- The main library module (import asgithub.com/bramburn/gnssgo/pkg/gnssgo)pkg/igs/- IGS product downloader moduleapp/- Applications that use the libraryapp/convbin- RINEX converter application- Other applications (uncomment in go.work to use)
gui/- Wails GUI applicationunittest/- Unit tests for the libraryexamples/- Example code showing how to use the librarytest_import/andtest_import2/- Examples of importing the library
Check out the examples directory for comprehensive examples of how to use GNSSGO in your applications.
In file 'go.work', you can choose your app by uncommenting the app path.
For configuring an app, you can define command line arguments in file 'launch.json' under the .vscode directory.
The project includes a GUI application built with Wails, which provides a user-friendly interface for interacting with the GNSSGO library.
To run the GUI application in development mode:
cd gui
wails devTo build the GUI application for production:
cd gui
wails buildThe built application will be available in the gui/build/bin directory.
// Initialize RTK control structure
var rtk gnssgo.Rtk
// Initialize processing options
var opt gnssgo.PrcOpt
// Set default processing options
opt.Mode = gnssgo.PMODE_KINEMA // Kinematic mode
opt.NavSys = gnssgo.SYS_GPS | gnssgo.SYS_GLO // Use GPS and GLONASS
// Initialize RTK control with options
rtk.InitRtk(&opt)
// Process observation data
rtk.RtkPos(obsData, numObs, &navData)
// Get solution
solution := rtk.RtkSolThe library uses go.bug.st/serial for improved serial port communication:
import (
"github.com/bramburn/gnssgo"
)
func main() {
// Open a serial port stream
// Format: port[:brate[:bsize[:parity[:stopb[:fctr[#port]]]]]]
// Example: COM1:115200:8:N:1:off
var stream gnssgo.Stream
stream.OpenStream(gnssgo.STR_SERIAL, gnssgo.STR_MODE_RW, "COM1:115200:8:N:1")
// Read data
buff := make([]byte, 1024)
n := stream.StreamRead(buff, 1024)
// Close when done
stream.StreamClose()
}// Initialize navigation data structure
var nav gnssgo.Nav
// Initialize observation data structure
var obs gnssgo.Obs
// Read a RINEX navigation file
status := gnssgo.ReadRnx("path/to/nav.rnx", 1, "", nil, &nav, nil)
// Read a RINEX observation file
status := gnssgo.ReadRnx("path/to/obs.rnx", 0, "", &obs, nil, nil)For detailed documentation on the library's functions and types, see the doc.go file.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the same terms as the original RTKLIB. See LICENSE for details.
- Original RTKLIB by T. Takasu
- Go port by Dr. Feng Xuebin, Explore Data Technology (Shenzhen) Ltd.
- Maintained by Bhavesh Ramburn