Using GNSS with ZED Box Orin NX

The GNSS module is an optional component of the ZED Box Orin NX, which can greatly enhance the precision of positioning data when used with Real-Time Kinematic (RTK) technology. With RTK, the GNSS module can achieve centimeter-level accuracy, significantly improving upon the typical few-meter accuracy of standard GNSS modules. This makes the GNSS module ideal for a variety of applications that require highly precise positioning information, such as autonomous vehicles, surveying, and precision agriculture.

Installation #

To verify that the GNSS module is properly detected, you can use the following command:

ls /dev/tty*

You should see a file named /dev/ttyACM0 or dev/ttyUSB0 containing the GNSS raw data. The streamed data should look as such:

sudo cat /dev/ttyACM0
$GNTXT,01,01,01,NMEA unknown msg*46
$GNTXT,01,01,01,NMEA unknown msg*46

The next step is to install the gpsd daemon. gpsd is a service daemon that monitors one or more GPSes or AIS receivers and exposes them to external applications by TCP. By setting up gpsd properly with your GNSS receiver, you can easily and efficiently access GNSS data using the API of your choice. In this guide, we will look into retrieving this data in Python and C++.

You can install gpsd with:

sudo apt install gpsd gpsd-clients

gpsd has know incompatibilities when working with systemd, which is the default behavior. For that reason, we strongly advise you NOT to use gpsd with systemd. Usual trouble are that your host will need to reboot every time you want to stop your application and run it again.

The easiest way to run gpsd is with

sudo gpsd -nG -P /run/ /dev/ttyACM0

You can run this in a CRON job :

@reboot sleep 10 && /usr/sbin/gpsd -nG -P /run/ /dev/ttyACM0

You can now test that gpsd is working properly with the xgps tool included in the gpsd-clients package with:


Using GNSS in your applications #

Python #

To access GNSS data in Python, you can use the gpsdclient library. This library provides a Python interface to the gpsd daemon, allowing you to easily retrieve GNSS data in your Python scripts. With gpsdclient, you can access a range of GNSS data, including latitude, longitude, altitude, speed, and more. This makes it a powerful tool for building GNSS-enabled applications in Python.

You can install gpsdclient with:

pip install gpsdclient

Here is an example of a simple script using gpsdclient:

from gpsdclient import GPSDClient

# get your data as json strings:
with GPSDClient(host="") as client:
    for result in client.json_stream():

# or as python dicts (optionally convert time information to `datetime` objects)
with GPSDClient() as client:
    for result in client.dict_stream(convert_datetime=True, filter=["TPV"]):
        print("Latitude: %s" % result.get("lat", "n/a"))
        print("Longitude: %s" % result.get("lon", "n/a"))

# you can optionally filter by report class
with GPSDClient() as client:
    for result in client.dict_stream(filter=["TPV", "SKY"]):

You can find a full code example of how to use the library in our Geotracking samples on GitHub.

C++ #

To access GNSS data in C++, you can use the libgpsmm library.

You can install libgpsmm with:

sudo apt install libgps-dev

Here is an example of a simple script using libgpsmm:

#include <libgpsmm.h>
#include <iostream>

int main() {
    gpsmm gps_data("localhost", DEFAULT_GPSD_PORT);

    if ( | WATCH_JSON) == nullptr) {
        std::cerr << "Failed to open GPS connection." << std::endl;
        return 1;

    while (true) {
        if (gps_data.waiting(500)) {
            if ( == nullptr) {
                std::cerr << "Error while reading GPS data." << std::endl;
            } else {
                std::cout << "Latitude: " << gps_data.fix->latitude << ", Longitude: " << gps_data.fix->longitude << std::endl;

    return 0;

You can find a full code example of how to use the library in our Geotracking samples on GitHub.