Skip to content

MuddSub/dvl-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dvl-python Python library to serial interface with Water Linked DVLs

⚠️ 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.

Resources

Requirements

  • Python 3.*
  • crcmod
  • pyserial
pip install crcmod pyserial

You might also need additional permission to access the port on the system you're running the script

Supported DVLs

  • Water Linked DVL A50

Setup

Download or clone the repo.

git clone https://github.com/waterlinked/dvl-python.git

Make 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 .

Quick start

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}

Usage

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

Examples showing how to use the API is available in the examples/ folder.

About

Python code for interfacing Water Linked DVLs using serial port

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%