Skip to content

Instantly share code, notes, and snippets.

@flamanta
Created January 16, 2023 06:40
Show Gist options
  • Save flamanta/b4345cf5b5a85acbcb6889f410864086 to your computer and use it in GitHub Desktop.
Save flamanta/b4345cf5b5a85acbcb6889f410864086 to your computer and use it in GitHub Desktop.
Setting up VN-200 on the Raspberry Pi

Setting up VN-200 on the Raspberry Pi

Prerequisites

  • VN-200 Rugged Development Kit
  • Raspberry Pi
  • VectorNav Programming Library files
  • Wired keyboard and mouse
  • HDMI to Micro-HDMI Adapter
  • External display with HDMI connection, or VGA to HDMI connection

Instructions

  1. Copy the Python folder of the VectorNav Programming Library onto the Raspberry Pi and install the programming library.

     cd vnproglib
     cd python
     python3 setup.py install
    
  2. After successfully installing the Python programming library, copy the compiled program files to your home folder.

     cd /usr/local/lib/python3.7/dist-packages
    
     cp -r vnpy ~
    
  3. Find out the Linux tty interface of the VN-200 INS.

    Plug in a serial cable between the VN-200 and the Raspberry Pi.

    Run the following command:

     sudo dmesg | more | grep tty
    

    The most recent printout in the terminal will indicate the USB device path of the INS.

    For example, a printout of

     [2528.295839] usb 1-1-1: FTDI USB Serial Device now attached to ttyUSB0.
    

    would indicate that the USB device is located at /dev/ttyUSB0.

  4. Connect the VN-200 INS to the Raspberry Pi.

    cd ~
    python3
    
    # Import vnpy library
    >>> from vnpy import *
    
    # Create sensor object and connect to the VN-200 
    # at the baud rate of 115200 (115,200 bytes/s)
    >>> s = VnSensor()
    >>> s.connect('/dev/ttyUSB0', 115200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment