Commit b19f16d1 authored by stanlew's avatar stanlew
Browse files

Merge branch 'add_decode_python' into 'master'


See merge request rob550-w21/mobilebot!1
parents c70be89d 254bf114
import sys
import numpy as np
import matplotlib.pyplot as plt
import lcm
from lcmtypes import odometry_t
if len(sys.argv) < 2:
sys.stderr.write("usage: <logfile>")
log = lcm.EventLog(sys.argv[1],"r")
data = np.empty((0,4), dtype=float)
init = 0
for event in log:
if == "ODOMETRY":
msg = odometry_t.decode(
if init==0:
start_utime = msg.utime
init = 1
data = np.append(data, np.array([[ \
(msg.utime-start_utime)/1.0E6, \
msg.x, \
msg.y, \
]]), axis=0)
plt.plot(data[:,1], data[:,2], 'r')
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment