Pozyx

Accurate positioning

Home > Documentation > Python library

Python library

The Pozyx Python library can be downloaded from github .

The functions in the library can be grouped as follows:


All data container classes

sensor_data::Acceleration | sensor_data::AngularVelocity | sensor_data::Coordinates | generic::Data | device::DeviceCoordinates | device::DeviceList | device::DeviceRange | sensor_data::EulerAngles | sensor_data::LinearAcceleration | sensor_data::Magnetic | device::NetworkID | sensor_data::PositionError | sensor_data::Quaternion | sensor_data::RawSensorData | sensor_data::SensorData | generic::SingleRegister | device::UWBSettings | generic::XYZ |


Core functions

These are the core library functions which are sufficient for full control of the Pozyx device. The currently only supported protocol for using Pozyx with Python is the serial interface through the use of the PozyxSerial class.


Function name
def
setWrite
Writes data to Pozyx registers either locally or remotely.
def
getRead
Reads Pozyx register data either locally or remotely.
def
useFunction
Activates a Pozyx register function either locally or remotely.
def
checkForFlag
Performs waitForFlag_safe and checks against errors or timeouts.
def

System functions

This set of functions allow you to configure general system related properties such as the GPIOs, LEDs, interrupts, etc.

Function name
def
clearConfiguration
Clears the Pozyx's flash memory.
def
configInterruptPin
Configures the interrupt pin via the POZYX_INT_CONFIG register.
def
getCalibrationStatus
Obtains the Pozyx's calibration status.
def
getConfigModeGPIO
Obtain the Pozyx's configuration mode of the selected GPIO pin.
def
getConfigPullGPIO
Obtain the Pozyx's selected GPIO pin pull.
def
getErrorCode
Obtains the Pozyx's error code.
def
getFirmwareVersion
Obtains the Pozyx's firmware version.
def
getGPIO
Obtain the Pozyx's value of the selected GPIO pin, being either HIGH or LOW(physically 3.3V or 0V).
def
getHardwareVersion
Obtains the Pozyx's hardware version.
def
getInterruptMask
Obtains the Pozyx's interrupt mask.
def
getInterruptStatus
Obtains the Pozyx's interrupt register.
def
getNumRegistersSaved
Obtains the number of registers saved to the Pozyx's flash memory.
def
getSelftest
Obtains the Pozyx's selftest.
def
getSystemError
Returns the Pozyx's system error string.
def
getWhoAmI
Obtains the Pozyx's WHO_AM_I.
def
isRegisterSaved
Returns whether the given register is saved to the Pozyx's flash memory.
def
resetSystem
Resets the Pozyx device.
def
saveRegisters
Saves the given registers to the Pozyx's flash memory, if these are writable registers.
def
setConfigGPIO
Set the Pozyx's selected GPIO pin configuration(mode and pull).
def
setGPIO
Set the Pozyx's selected GPIO pin output.
def
setInterruptMask
Set the Pozyx's interrupt mask.
def
setLed
Set the Pozyx's selected LED state.
def
setLedConfig
Set the Pozyx's LED configuration.
def
setSensorMode
Set the Pozyx's sensor mode.

Ranging and positioning functions

This group of functions are related to ranging and positioning. They are not grouped in the sensor functions because these functions also require UWB communication.

Function name
def
doPositioning
Performs positioning with the Pozyx.
def
doRanging
Performs ranging with another destination device, resulting in range information.
def
getAnchorSelectionMode
Obtains the Pozyx's anchor selection mode.
def
getCoordinates
Obtains the Pozyx's coordinates.
def
getDeviceRangeInfo
Obtain the range information of the device with selected ID in the Pozyx's device list.
def
getNumberOfAnchors
Obtains the Pozyx's number of selected anchors.
def
getOperationMode
Obtains the Pozyx's mode of operation.
def
getPositionAlgorithm
Obtains the Pozyx's positioning algorithm.
def
getPositionDimension
Obtains the Pozyx's positioning dimension.
def
getPositionError
Obtains the Pozyx's positioning error.
def
getPositioningAnchorIds
Obtain the IDs of the anchors in the Pozyx's device list used for positioning.
def
getRangingProtocol
Obtains the Pozyx's ranging protocol.
def
getUpdateInterval
Obtains the Pozyx's update interval.
def
saveAnchorIds
Saves the anchor IDs used in positioning to the Pozyx's flash memory.
def
setConfigGPIO
Set the Pozyx's selected GPIO pin configuration(mode and pull).
def
setCoordinates
Set the Pozyx's coordinates.
def
setPositionAlgorithm
Set the Pozyx's positioning algorithm.
def
setPositionFilter
Set the Pozyx's positioning filter.
def
setPositioningAnchorIds
Set the anchors the Pozyx will use for positioning.
def
setRangingProtocol
Set the Pozyx's ranging protocol.
def
setSelectionOfAnchors
Set the Pozyx's coordinates.
def
setUpdateInterval
Set the Pozyx's update interval in ms(milliseconds).

Sensor functions

These are library functions that interact with the Pozyx registers to perform certain actions. For a full overview of all the available registers, please refer to the register overview. These functions are platform-independent and work for every Arduino.

Function name
def
getAcceleration_mg
Obtain the Pozyx's acceleration sensor data in mg.
def
getAllSensorData
Obtains all the Pozyx's sensor data in their default units.
def
getAngularVelocity_dps
Obtain the Pozyx's angular velocity sensor data in dps(degrees per second).
def
getEulerAngles_deg
Obtain the Pozyx's euler angles sensor data in degrees(heading, roll, pitch).
def
getGravityVector_mg
Obtain the Pozyx's gravity vector sensor data in mg.
def
getLinearAcceleration_mg
Obtain the Pozyx's linear acceleration sensor data in mg.
def
getMagnetic_uT
Obtain the Pozyx's magnetic sensor data in uT(microtesla).
def
getPressure_Pa
Obtain the Pozyx's pressure sensor data in Pa(pascal).
def
getQuaternion
Obtain the Pozyx's quaternion sensor data.
def
getSensorMode
Obtains the Pozyx's sensor mode.
def
getTemperature_c
Obtain the Pozyx's temperature sensor data in C(celsius).

Device list functions

Functions that control the device list. The device list holds information such as network id and coordinates about other Pozyx devices in the network.

Function name
def
addDevice
Adds a device to the Pozyx's device list.
def
changeDeviceCoordinates
Changes a device's coordinates in the Pozyx's device list, keeping the rest of the list intact.
def
clearDevices
Clears the Pozyx's device list.
def
configureAnchors
Configures a set of anchors as the relevant anchors on a device.
def
doAnchorCalibration
Performs automatic anchor calibration on the Pozyx.
def
def
getAnchorIds
Obtain the IDs of the anchors in the Pozyx's device list.
def
getDeviceCoordinates
Obtain the coordinates of the device with selected ID in the Pozyx's device list.
def
getDeviceIds
Obtain the IDs of all devices in the Pozyx's device list.
def
getDeviceListSize
Obtain the size of Pozyx's list of added devices.
def
getTagIds
Obtain the IDs of the tags in the Pozyx's device list.
def
printDeviceList
Prints a Pozyx's device list.
def
removeDevice
Removes a device from the Pozyx's device list, keeping the rest of the list intact.
def
saveNetwork
Saves the Pozyx's device list to its flash memory.

Wireless communication functions

Although most functions in the library can be used remotely, these functions are used specifically for wireless communication of your own data.

Function name
def
getLastDataLength
Obtain the size of the most recent data packet received by the Pozyx.
def
getLastNetworkId
Obtain the network ID of the last device Pozyx communicated with.
def
getNetworkId
Obtains the Pozyx's network ID.
def
getTxPower
Obtains the Pozyx's transmitter UWB gain in dB, as a float.
def
getUWBChannel
Obtains the Pozyx's UWB channel.
def
getUWBSettings
Obtains the Pozyx's UWB settings.
def
saveUWBSettings
Saves the Pozyx's UWB settings to its flash memory.
def
setNetworkId
Set the Pozyx's network ID.
def
setTxPower
Set the Pozyx's UWB transceiver gain.
def
setUWBChannel
Set the Pozyx's UWB channel.
def
setUWBSettings
Set the Pozyx's UWB settings.

Home > Documentation > Python library