Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced deprecated matplotlib function #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Extended-Kalman-Filter-CTRV.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from sympy import Symbol, symbols, Matrix, sin, cos
from sympy import init_printing
init_printing(use_latex=True)
from datetime import datetime


# # Extended Kalman Filter Implementation for Constant Turn Rate and Velocity (CTRV) Vehicle Model in Python
Expand Down Expand Up @@ -178,9 +179,17 @@
#path = './../RaspberryPi-CarPC/TinkerDataLogger/DataLogs/2014/'
datafile = '2014-03-26-000-Data.csv'

def bytespdate2num(fmt):
def converter(b):
return mdates.date2num(datetime.strptime(b.decode('utf-8'), fmt))
return converter

date_converter = bytespdate2num('%y%m%d')
time_converter = bytespdate2num('%H%M%S%f')

date, time, millis, ax, ay, az, rollrate, pitchrate, yawrate, roll, pitch, yaw, speed, course, latitude, longitude, altitude, pdop, hdop, vdop, epe, fix, satellites_view, satellites_used, temp = np.loadtxt(datafile, delimiter=',', unpack=True,
converters={1: mdates.strpdate2num('%H%M%S%f'),
0: mdates.strpdate2num('%y%m%d')},
converters={1: time_converter,
0: date_converter},
skiprows=1)

print('Read \'%s\' successfully.' % datafile)
Expand Down