]> defiant.homedns.org Git - ros_wild_thumper.git/blobdiff - scripts/get_velocity.py
motor_ctrl: pid tuning
[ros_wild_thumper.git] / scripts / get_velocity.py
diff --git a/scripts/get_velocity.py b/scripts/get_velocity.py
new file mode 100755 (executable)
index 0000000..4f8a77e
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+# -*- coding: iso-8859-15 -*-
+#
+# rostopic echo /odom/twist/twist/linear/x > /tmp/velocity.txt
+
+import sys
+import numpy as np
+
+f = open(sys.argv[1])
+l = []
+for line in f:
+       if "---" in line:
+               continue
+       l.append(float(line))
+
+print "avg=%.2f, var=%f" % (sum(l)/len(l), np.var(l))