function [raw_time,raw_voltage, raw_current, raw_strpot, raw_encoder, time,voltage,current,strpot,encoder,r0,r1,r2,r3,pitch] = read_hdf_file(filename)
%% read the fault detection file (hdf format)
raw_time = h5read(filename,'/raw motor data/time');
raw_voltage = h5read(filename,'/raw motor data/voltage');
raw_current = h5read(filename,'/raw motor data/current');
raw_strpot = h5read(filename,'/raw motor data/str pot');
raw_encoder = h5read(filename,'/raw motor data/encoder');

time = h5read(filename,'/motor data/time');
voltage = h5read(filename,'/motor data/voltage');
current = h5read(filename,'/motor data/current');
strpot = h5read(filename,'/motor data/str pot');
encoder = h5read(filename,'/motor data/encoder');

r0 = h5read(filename,'/detection residuals/r0');
r1 = h5read(filename,'/detection residuals/r1');
r2 = h5read(filename,'/detection residuals/r2');
r3 = h5read(filename,'/detection residuals/r3');

pitch = h5read(filename,'/ahrs data/pitch');