Code Monkey home page Code Monkey logo

pyrtkgps's Introduction

pyrtkgps

pyrtkgps is a library for managing and configuring GPS and GNSS chips. Currently, the main focus of this library is to work with GPS modules manufactured by u-blox.

Credit: The base code for pyrtkgps was initially written for a Real-Time Kinematic GPS experiment at Columbia University.

Current Status

release badge stage badge develop badge license badge pypi badge

Install

pip install pyrtkgps

Usage

The following is an example for configuring the ZED-F9P chip (from u-blox) as a base station. The YAML file can be replaced with a YAML string if needed.

base_station.yml
RAM:
  UBX-CFG-VALSET:
    # enable survey-in mode
    - CFG-TMODE-MODE: 1
    - CFG-TMODE-SVIN_MIN_DUR: 60
    - CFG-TMODE-SVIN_ACC_LIMIT: 50000

    # disable NMEA on uart1
    - CFG-UART1OUTPROT-NMEA: 0

    # enable survey-in status output
    - CFG-MSGOUT-UBX_NAV_SVIN_UART1: 1

    # enable rtcm messages
    - CFG-MSGOUT-RTCM_3X_TYPE1005_UART1: 1
    - CFG-MSGOUT-RTCM_3X_TYPE1074_UART1: 1
    - CFG-MSGOUT-RTCM_3X_TYPE1084_UART1: 1
    - CFG-MSGOUT-RTCM_3X_TYPE1124_UART1: 1
    - CFG-MSGOUT-RTCM_3X_TYPE1230_UART1: 5
base_station.py
from serial import Serial
import pyrtkgps.ublox as ublox
from pyubx2.ubxreader import UBXReader

# connect to the uart1 port with baudrate 38400
uart1 = Serial("/dev/uart1", 38400)

# split the uart1 stream into a stream for each protocol (UBX, RTCM, NMEA)
virtual_streams = ublox.StreamMuxDemux(uart1)

# load the chip configuration from a YAML file (or use a YAML string)
config_file = open("./base_station.yml", "r")

# serialize the configuration file
sr = ublox.UBXSerializer
serialized_config = sr.serialize(config_file)

# close the configuration file
config_file.close()

# write serialized config to the ublox chip 
virtual_streams.UBX.write(serialized_config)

# print UBX output
ubr = UBXReader(virtual_streams.UBX)
while True:
    raw, msg = ubr.read()
    print(msg)

pyrtkgps's People

Contributors

alkeldi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mfkiwl

pyrtkgps's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.