⚠️ This library is in development and is not yet production ready
Python code to serial interface with Water Linked DVLs.
The library makes setting up a serial connection with the DVL simpler. Handles the parsing, checks validity and returns a Dictionary.
- Python 3.*
- crcmod
- pyserial
pip install crcmod pyserialYou might also need additional permission to access the port on the system you're running the script
- Water Linked DVL A50
Download or clone the repo.
git clone https://github.com/waterlinked/dvl-python.gitMake sure you're in the folder with the setup.py file. Install the module (Note the period at the end of the command. The -e will let you edit the module as you wish.):
pip install -e .Connecting to a dvl and reading data:
$ python3
>>> from wldvl import WlDVL
>>> dvl = WlDVL("/dev/ttyUSB0")
>>> dvl.read()
{'fom': 0.002, 'time': 40.57, 'vy': 0.004, 'vz': -0.002, 'vx': -0.003, 'valid': True, 'altitude': 0.14}The WlDVL class provides an easy interface to receive data with a Water Linked DVL.
A WlDVL object is initialized with the serial device port:
from wldvl import WlDVL
dvl = WlDVL("/dev/ttyUSB0")To retrieve data as a dictionary:
dvl.read()This should give you a dictionary formated as follows:
{
'time': 40.75,
'vx': 0.001,
'vy': 0.004,
'vz': -0.001,
'fom': 0.002,
'altitude': 0.13,
'valid': True
}Examples showing how to use the API is available in the examples/ folder.