summaryrefslogtreecommitdiff
path: root/run.py
diff options
context:
space:
mode:
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)")