summaryrefslogtreecommitdiff
path: root/run.py
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2022-03-28 19:13:51 -0400
committerHolden Rohrer <hr@hrhr.dev>2022-03-28 19:13:51 -0400
commit86128a6f00e11a06ea03e3b249d5f7db3af64a8a (patch)
treeb306b0433f134b887afe9265cd9ee44ef8d34877 /run.py
parented363dcbb5f51c61ad94cfe9b039f3ff8067a363 (diff)
more usable framework
Diffstat (limited to 'run.py')
-rw-r--r--run.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/run.py b/run.py
new file mode 100644
index 0000000..7ff0b74
--- /dev/null
+++ b/run.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python3
+import os
+import re
+import pandas as pd
+import numpy as np
+from regression import velvar, combine_estimates
+
+robot_velvars = {}
+for entry in os.scandir('data'):
+ if not (entry.is_file() and entry.name.endswith('.csv')):
+ continue
+ match = re.match(r'^robot(\d+)_trial(\d+).csv$', entry.name)
+ if match == None:
+ continue
+ robot = int(match.group(1))
+ if not robot in robot_velvars:
+ robot_velvars[robot] = []
+ trial = int(match.group(2))
+ data = pd.read_csv(entry.path).values
+ robot_velvars[robot].append(velvar(data, data[0][0]))
+
+for robot in robot_velvars:
+ est = [x*1000/3.28 for x in combine_estimates(robot_velvars[robot])]
+ print(f"robot {robot}'s kick velocity is {est[0]} ± {np.sqrt(est[1])*2} m/s (p > .95)")