GPS change sampling rate (Hz) in code


I’m currently using the Zed Box Orin with an integrated GPS. While utilizing it within a thread, I’ve observed that the GPS only gets info abut the lat, log and speed at 1 Hz, which is suboptimal for my needs—I require it to be at 10 Hz. I attempted to adjust the sampling rate using the following Python code in python:

import subprocess['gpsctl', '-c', '0.1'])  # Time in seconds

Unfortunately, this code didn’t change it. The GPS is capable of running at 20 Hz. Could you please advise on how to adjust the sampling rate in Python? Your assistance would be greatly appreciated.

1 Like

Hi @camikva,

To use the gpsctl tool to change the measure rate of the GPS, please make sure that the gpsd service is running. You can check this by running:

sudo systemctl status gpsd.service

Can you provide the output of the gpsctl command?

Another tool specific to ublox devices (the one present in your ZED Box) can be used, which is ubxtool: ubxtool(1)