rostopic echo /amcl_pose/pose/pose/position > record3.txt
//python2
import matplotlib.pyplot as plt
import time
f=open("record2.txt","r")
x=[]
y=[]
while True:
try:
string=f.readline()
# print(string)
if string[0]=="x":
# print("1")
x.append(float(string[3:-1]))
elif string[0]=="y":
y.append(float(string[3:-1]))
except:
break
# time.sleep(1)
f.close()
plt.plot(x,y,"r-")
plt.show()