asr_vosk: Allow to handle keyword and command in one sentence
[ros_wild_thumper.git] / scripts / get_velocity.py
1 #!/usr/bin/env python
2 # -*- coding: iso-8859-15 -*-
3 #
4 # rostopic echo /odom/twist/twist/linear/x > /tmp/velocity.txt
5
6 import sys
7 import numpy as np
8
9 f = open(sys.argv[1])
10 l = []
11 for line in f:
12         if "---" in line:
13                 continue
14         l.append(float(line))
15
16 print "avg = %.2f, var = %f" % (sum(l)/len(l), np.var(l))