Piksi Tools is a Python package developed by Swift Navigation to provide a suite of command line utilities for working with the Piksi GNSS receiver. Whether you are developing applications for precise positioning or simply want to explore GNSS data, Piksi Tools offers a range of features that make it a powerful tool in your GNSS toolkit.
To get started with Piksi Tools, it is recommended to set up a conda environment to avoid modifying the global system state. You can use Miniconda to install conda, and then create and activate a conda environment named “piksi_tools” with Python version 3.7. Once you have activated the environment, you can install Piksi Tools by running “pip install -e .[test]” to set up a development installation in your local environment.
Now that you have Piksi Tools installed, let’s explore three example code implementations that demonstrate its capabilities.
Example 1: Firmware Bootloader
One of the key features of Piksi Tools is the Firmware Bootloader utility. This utility allows you to easily update the firmware of your Piksi GNSS receiver. By leveraging Piksi Tools, you can ensure that your Piksi receiver is always up to date with the latest firmware improvements and bug fixes. Here’s an example of how to use the Firmware Bootloader utility in your Python code:
from piksi_tools.bootloader import FirmwareBootloader
bootloader = FirmwareBootloader()
bootloader.connect("/dev/ttyUSB0")
bootloader.update_firmware("path/to/firmware.bin")
Example 2: Serial Port Data Logging
Piksi Tools also provides a utility for logging data from the Piksi receiver’s serial port. This can be useful for capturing raw GNSS data for further analysis or debugging purposes. Here’s an example of how to use the Serial Port Data Logging utility:
from piksi_tools.serial_link import SerialLink
port = "/dev/ttyUSB0" # replace with the actual serial port
output_file = "data.log"
serial_link = SerialLink(port)
serial_link.start_logging(output_file)
# ...do whatever you want with the serial data...
serial_link.stop_logging()
Example 3: Settings Management
Managing settings on the Piksi receiver can be done easily with Piksi Tools. The Settings utility allows you to read and write settings on the receiver, giving you control over various aspects of its operation. Here’s an example of how to use the Settings utility:
from piksi_tools.settings import SettingsManager
settings_manager = SettingsManager()
settings_manager.connect("/dev/ttyUSB0")
# Read a setting
value = settings_manager.get_setting("gnss.enable")
# Write a setting
settings_manager.set_setting("gnss.enable", 0)
# Commit the changes
settings_manager.commit_changes()
In this article, we explored Piksi Tools, a Python package developed by Swift Navigation for working with the Piksi GNSS receiver. We discussed the setup process, Python version support, and demonstrated three example code implementations that showcased the capabilities of Piksi Tools. Whether you are a GNSS enthusiast or a developer looking to work with GNSS data, Piksi Tools provides a powerful set of tools to streamline your GNSS development process.
Category: GNSS, Python Development
Tags: Piksi Tools, GNSS, GPS, Python, Swift Navigation, Python Packages
Leave a Reply