MPU6050-MotionTracking icon indicating copy to clipboard operation
MPU6050-MotionTracking copied to clipboard

The data_4 dataset contains data which cannot be drifted

Open keszegrobert opened this issue 2 years ago • 0 comments

`--------------------------------------------------------------------------- IndexError Traceback (most recent call last) /var/folders/5d/jppcsct91857cvxdp34vyw780000gp/T/ipykernel_31642/2518927757.py in 1 fig, ax = plt.subplots(figsize=(16, 8)) ----> 2 plot_vel(time,acc,ax,'drift')

/var/folders/5d/jppcsct91857cvxdp34vyw780000gp/T/ipykernel_31642/4091315804.py in plot_vel(time, acc, ax, v_type) 1 def plot_vel(time,acc,ax,v_type): 2 if v_type == 'drift': ----> 3 vel = get_vel_drift(time,acc) 4 ax.set(title="Velocity correct") 5 elif v_type == 'pure':

~/Projects/MPU6050-MotionTracking/Processing data/functions.py in get_vel_drift(time, acc) 265 vel = integral_vel(acc,time,stationary) 266 # Calculate integral drift --> 267 drift = get_drift(vel,stationary,time) 268 # Remove integral drift 269 vel_drift=vel-drift

~/Projects/MPU6050-MotionTracking/Processing data/functions.py in get_drift(data, stationary, time) 203 xyz=[[0,0,0]] 204 drift_data=pd.DataFrame(np.repeat(xyz,len(data),axis=0),columns=['velx','vely','velz']) --> 205 if drift_start[0]>drift_end[0]: 206 drift_start = np.append([0],drift_start) 207 for i in range(len(drift_end)):

IndexError: index 0 is out of bounds for axis 0 with size 0`

keszegrobert avatar Mar 14 '22 17:03 keszegrobert