rough_cal_3d {tagtools}R Documentation

Estimate scale factors and offsets

Description

This function is used to estimate scale factors and offsets for measurements from a triaxial field sensor. This function estimates the scale factor needed to make the magnitude of X close to the expected field strength. It then calls fix_offset_3d to correct any offset errors in X. This function does not try to optimize the results. See spherical_cal for a more powerful data-driven calibration method.

Usage

rough_cal_3d(X, fstr)

Arguments

X

A sensor structure or matrix containing measurements from a triaxial field sensor such as an accelerometer or magnetometer. X can be in any units and frame.

fstr

The expected field strength at the measurement location in the same units as X

Value

A list with 2 elements:

Note

This function requires a lot of data as it is looking for extreme values in each axis. A minimum data size of 1000 samples should be used. This function is only usable for field sensors. It will not work for gyroscope data.

Examples

BW <- beaked_whale
plot(x = c(1:length(BW$M$data)), y = BW$M$data)
rcal <- rough_cal_3d(BW$M$data, fstr = 38.2)
cal <- list(x = c(1:length(rcal$X)), y = rcal$X)
plot(cal)

[Package tagtools version 0.1.0 Index]