sensbiotk.io package

« sensbiotk.driver package | sensbiotk.io package | sensbiotk.io.scripts package »

sensbiotk.io package

Submodules

sensbiotk.io.ahrs module

Loader/Saver for attitude and heading reference system (ahrs)

sensbiotk.io.ahrs.load_ahrs_csvfile(filename)[source]

Load Ahrs data from a CSV file version with the format line :

t qw qx qy qz roll pitch yaw

The colon separation is a tab

Parameters:

filename : str

Name of the CSV file containing ahrs data

Returns:

time : numpy.array

time in sec

quat : numpy.array

[qw, qx, qy, qz]

euler : numpy.array

angles in radians [roll, pitch, yaw]

Examples

>>> timu, quat, euler = load_ahrs_csvfile("data/output_ahrs.csv")
>>> print quat
sensbiotk.io.ahrs.save_ahrs_csvfile(filename, time, quat, ang_euler)[source]

save a ascii csv ahrs file with the format line :

t qw qx qy qz roll pitch yaw

The colon separation is a tab

Parameters:

time : numpy.array

in second

quat : numpy array

[qw, qx qy qz]

ang_euler : numpy array

angles in radians [roll pitch yaw]

filename : str

The ouput .csv file name

Returns:

status : str

‘OK’ / ‘ERROR’

Examples

>>> timu = [0, 1]
>>> quat = [[1,0,0,0], [1,0,0,0]]
>>> euler = [[0,0,0], [0,0,0]]
>>> save_ahrs_csvfile("data/ahrs.csv", timu, quat, euler)

sensbiotk.io.iofox module

Loader for HikoB Fox Node format

sensbiotk.io.iofox.convert_sensors_rawfile(binfilename, accfilename='output_acc.csv', magfilename='output_mag.csv', gyrfilename='output_gyr.csv', presstfilename='output_presst.csv', gpiofilename='output_gpio.csv')[source]

Convert a raw bin HikoB Fox sensors file into an ascii csv files.

Parameters:

binfilename : str

Name of the raw file to load and convert.

accfilename : str

Name of the csv accelerometers imu file

magfilename : str

Name of the csv magnetometers imu file

gyrfilename : str

Name of the csv gyrometers imu file

presstfilename : str

Name of the csv pressure & temperature sensors file

gpiofilename : str

Name of the csv gpio file

Returns :

——- :

status : str

‘OK’ / ‘ERROR’

sensbiotk.io.iofox.load_foxacc_csvfile(filename)[source]

Load Acceleration IMU HikoB Fox Node from a CSV file.

Parameters:

filename : str

Name of the CSV file to load.

Returns:

two numpy array which contains [t,dt] and [accx,accy,accz] :

sensbiotk.io.iofox.load_foxcsvfile(filename)[source]

Load IMU HikoB Fox Node data from a CSV file version 2

id t dt ax ay az mx my mz gx gy gz

columns are separated by a tab

Parameters:

filename : str

Name of the CSV file containing inertial data :

sensbiotk.io.iofox.load_foxgpio_csvfile(filename)[source]

Load Gpio HikoB Fox Node from a CSV file.

Parameters:

filename : str

Name of the CSV file to load.

Returns:

[time, gpio] : np.array

The matrix contains time [time,dt], gpio1 (0/1), gpio2 (0/1) gpio3 (0/1), gpio4 (0/1), gpio5 (0/1)

sensbiotk.io.iofox.load_foxgyr_csvfile(filename)[source]

Load Gyrometers IMU HikoB Fox Node from a CSV file.

Parameters:

filename : str

Name of the CSV file to load.

Returns:

two numpy array which contains [t,dt] and [gyrx,gyry,gyrz] :

sensbiotk.io.iofox.load_foximu_csvfile(filename_acc, filename_mag, filename_gyr, dtime, deg_s=1)[source]

Load IMU HikoB Fox Node from a CSV file version 2

Parameters:

filename_acc : str

Name of the CSV files to load accelerometers

filename_mag : str

Name of the CSV files to load magnetometers

filename_gyr : str

Name of the CSV files to load gyrometers

dtime: float :

sampling period in seconds

deg_s : int

the order of the spline fit used for signal resampling. 1 <= k <= 5

Returns:

[t_interp, acc_interp, mag_interp, gyr_interp] : numpy.array

for numpy array which contains t_interp, acc_interp = [accx,accy,accz], :

mag_interp = [magx,magy,magz], gyr_interp = [gyrx,gyry,gyrz] :

sensbiotk.io.iofox.load_foxmag_csvfile(filename)[source]

Load Magnetometers IMU HikoB Fox Node from a CSV file.

Parameters:

filename : str

Name of the CSV file to load.

Returns:

two numpy array which contains [t,dt] and [magx,magy,magz] :

sensbiotk.io.iofox.load_foxpresst_csvfile(filename)[source]

Load Pression/Temperature HikoB Fox Node from a CSV file.

Parameters:

filename: str :

Name of the CSV file to load.

Returns:

time : np.array

The matrix contains time [time,dt], pression (bar) and temperature (degree). id is an int and time,dt,bar and degree are float values.

sensbiotk.io.iofox.save_foxacc_csvfile(accfilename, time, acc)[source]

save a ascii csv file accelerometers IMU HikoB Fox file

Parameters:

accfilename : str

Name of the csv imu file

time : numpy array

[t, dt]

acc : numpy array

[ax ay az]

Returns:

status : str

‘OK’ or ‘ERROR’

sensbiotk.io.iofox.save_foxgyr_csvfile(gyrfilename, time, gyr)[source]

save a ascii csv file gyrometers IMU HikoB Fox file

Parameters:

accfilename : str

Name of the csv imu file

time : numpy array

[t, dt]

gyr : numpy array

[mx my mz]

Returns:

status : str

‘OK’ / ‘ERROR’

sensbiotk.io.iofox.save_foxmag_csvfile(magfilename, time, mag)[source]

save a ascii csv file magnetometers IMU HikoB Fox file

Parameters:

accfilename : str

Name of the csv imu file

time : numpy array

[t, dt]

mag : numpy array

[mx my mz]

Returns:

status : str

‘OK’ or ‘ERROR’

sensbiotk.io.iofox.save_foxsignals_csvfile(time, acc, mag, gyr, filename)[source]
save a ascii csv file with the following structure using
time, acc, mag and gyr numpy arrays:

# id t dt ax ay az mx my mz gx gy gz

Parameters:

time signal : numpy array [t, dt]

acc : numpy array

[ax ay az]

mag : numpy array

[mx my mz]

gyr : numpy array

[gx gy gz]

gpio : numpy array

[gpio0 gpio1 gpio2 gpio3 gpio4]

filename : str

The ouput .csv file name

Returns:

status : str

‘OK’ or ‘ERROR’

sensbiotk.io.iofox_deprec module

Loader for HikoB Fox Node format - deprecated data format

sensbiotk.io.iofox_deprec.convert_fox_rawfile(binfilename, imufilename, presstfilename)[source]

Convert a raw bin HikoB Fox file into an ascii csv files.

Parameters:

binfilename : str

Name of the raw file to load and convert.

imufilename : str

Name of the csv imu file

presstfilename : str

Name of the presst file

Returns:

status : str

“OK” or “ERROR”

sensbiotk.io.iofox_deprec.info_fox_rawfile(binfilename)[source]

Extract info. HikoB Fox Node from a raw bin file.

Parameters:

filename : str

Name of the bin file to load.

sensbiotk.io.iofox_deprec.load_foximu_csvfile(filename)[source]

Load IMU HikoB Fox Node from a CSV file.

Parameters:

filename: str :

Name of the CSV file to load.

Returns:

tabA numpy array which contains id :

sensbiotk.io.iofox_deprec.load_foxpresst_csvfile(filename)[source]

Load Pression/Temperature HikoB Fox Node from a CSV file.

Parameters:

filename: str :

Name of the CSV file to load.

Returns:

time : np.array

The matrix contains time [id,time,dt], pression (bar) and temperature (degree). id is an int and time,dt,bar and degree are float values.

sensbiotk.io.iofox_deprec.save_foximu_csvfile(accfilename, time, acc, mag, gyr, separator='\t')[source]

save a ascii csv file accelerometers IMU HikoB Fox file

Parameters:

accfilename : str

Name of the csv imu file

time : numpy array

[t, dt]

acc : numpy array

[ax ay az]

mag : numpy array

[mx my mz]

gyr : numpy array

[gx gy gz]

Returns:

status : str

“OK” or “ERROR”

sensbiotk.io.uigetfile module

MATLAB-like “uigetfile” function. @author: bsijober

sensbiotk.io.uigetfile.uigetfile(title=None, filetypes=[('All files', '*.*')], initialdir=None)[source]

MATLAB-like “uigetfile” function. Enables the user to graphically choose a file and get its absolute path.

Parameters:

title : string

The displayed GUI title

filetypes : tuple

ex : filetypes = [(“All files”, “.”)]

initialdir : string

Specifies that the files in directory should be displayed when the dialog pops up

Returns:

file_path : string

The GUI selected file path

sensbiotk.io.viz module

Plot for sensors data

sensbiotk.io.viz.plot_imu(num, title, time, acc, mag, gyr)[source]

Plot IMU datas

@param id : plot number, negative for automatic numbering @param title: title of the plot @param time : @param acc : @param mag : @param gyr :

@return: none

sensbiotk.io.viz.plot_show()[source]
sensbiotk.io.viz.test1()[source]

Test plot_imu

@param : none

@return: OK/ERROR

sensbiotk.io.viz.test2()[source]

Test samples time

@param : none

@return: OK/ERROR

sensbiotk.io.viz.test3()[source]

Test plot_imu

@param : none

@return: OK/ERROR

Module contents