diff options
author | Holden Rohrer <hr@hrhr.dev> | 2022-03-28 19:13:51 -0400 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2022-03-28 19:13:51 -0400 |
commit | 86128a6f00e11a06ea03e3b249d5f7db3af64a8a (patch) | |
tree | b306b0433f134b887afe9265cd9ee44ef8d34877 /run.py | |
parent | ed363dcbb5f51c61ad94cfe9b039f3ff8067a363 (diff) |
more usable framework
Diffstat (limited to 'run.py')
-rw-r--r-- | run.py | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -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)") |