Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Uses N/D for double integration of accelerometer data
- # The DNN system will be integrated into the aircraft
- # computer system along with the INS. It is constantly # updated based on outcomes of the trained model and it # also learns new trails and provide navigational
- # routes
- # The DNN is a feed-forward connectionist model built
- # out of successive pairs of convolutional and
- # maxpooling layers, followed by several fully
- # connected layers. One of the advantages of DNNs over # common alternatives for supervised image
- # classification is generality
- # Using KBNS Method for the estimator corrector
- # mechanism, leads to the optimal estimation of
- # linearized system and measurement system model.
- # Conclusion: This focuses on Y-Axis change along with devaluing
- # Twitter: @yawnalf
- import time
- import serial
- import string
- import pynmea2
- import RPi GPIO as gpio
- #to add the LCD library
- import Adafruit_CharLCD as LCD
- gpio.setmode(gpio.BCM)
- #declaring LCD pins
- lcd_rs = 17
- lcd_en = 18
- lcd_d4 = 27
- lcd_d5 = 22
- lcd_d6 = 23
- lcd_d7 = 10
- lcd_backlight = 2
- lcd_columns = 16 #Lcd column
- lcd_rows = 2 #number of LCD rows
- lcd = LCD.Adafruit_CharLCD(lcd = LCD.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight)
- port = "/dev/ttyAMA0" # the serial port to which the pi is connected.
- #create a serial object
- ser = serial.Serial(port, baudrate = 9600, timeout = 0.5)
- while 1:
- try:
- data = ser.readline()
- except:
- print("loading")
- #wait for the serial port to churn out data
- if data[0:6] == '$GPGGA': # the long and lat data are always contained in the GPGGA string of the NMEA data
- msg = pynmea2.parse(data)
- #parse the latitude and print
- latval = msg.lat
- concatlat = "lat:" + str(latval)
- print concatlat
- lcd.set_cursor(0,0)
- lcd.message(concatlat)
- #parse the longitude and print
- longval = msg.lon
- concatlong = "long:"+ str(longval)
- print concatlong
- lcd.set_cursor(0,1)
- lcd.message(concatlong)
- time.sleep(0.5)#wait a little before picking the next data.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement