Python data processing blocks
Base class for online data processing blocks. |
|
VQF orientation estimation algorithm. |
|
Madgwicks's orientation estimation algorithm. |
|
Mahony's orientation estimation algorithm. |
|
OriEstIMU orientation estimation algorithm. |
|
|
Second-order Butterworth low-pass filter block. |
- class qmt.Block[source]
Base class for online data processing blocks.
- command(command)[source]
This function is called to handle commands, i.e., events that change the state of the block in a certain way.
Commands are always lists and the first entry is the command name. One common example for a command is
['reset']. The default implementation ignores all commands.- Parameters:
command – Command as list. The first element is a string with the command name. Optional further elements depend on the command.
- Returns:
True if the command is handled by the block, False if the command was ignored
- setParams(params)[source]
This function is called to update parameters, i.e., variables that influence how the input data is processed.
The default implementation updates the
paramsproperty if a corresponding key already exists and raises a RuntimeError on other parameters (unless ignoreUnknownParams is set to True). If this is not enough, this function can be overridden to implement custom logic if parameters change.- Parameters:
params – dictionary with the parameters to update
- Returns:
None
- class qmt.OriEstVQFBlock(Ts)[source]
VQF orientation estimation algorithm.
See https://github.com/dlaidig/vqf, https://doi.org/10.1016/j.inffus.2022.10.014, and https://arxiv.org/abs/2203.17024 for more information about this algorithm.
This algorithm is also available as a function:
qmt.oriEstVQF().- Parameters:
Ts – sampling time in seconds
- command(command)[source]
This function is called to handle commands, i.e., events that change the state of the block in a certain way.
Commands are always lists and the first entry is the command name. One common example for a command is
['reset']. The default implementation ignores all commands.- Parameters:
command – Command as list. The first element is a string with the command name. Optional further elements depend on the command.
- Returns:
True if the command is handled by the block, False if the command was ignored
- setParams(params)[source]
This function is called to update parameters, i.e., variables that influence how the input data is processed.
The default implementation updates the
paramsproperty if a corresponding key already exists and raises a RuntimeError on other parameters (unless ignoreUnknownParams is set to True). If this is not enough, this function can be overridden to implement custom logic if parameters change.- Parameters:
params – dictionary with the parameters to update
- Returns:
None
- class qmt.OriEstMadgwickBlock(Ts)[source]
Madgwicks’s orientation estimation algorithm.
See https://doi.org/10.1109/ICORR.2011.5975346 for more information about this algorithm. Based on the C++ implementation by Sebastian Madgwick, available at https://x-io.co.uk/open-source-imu-and-ahrs-algorithms/.
This algorithm is also available as a function:
qmt.oriEstMadgwick().- Parameters:
Ts – sampling time in seconds
- class qmt.OriEstMahonyBlock(Ts)[source]
Mahony’s orientation estimation algorithm.
See https://dx.doi.org/10.1109/TAC.2008.923738 for more information about this algorithm. Based on the C++ implementation by Sebastian Madgwick, available at https://x-io.co.uk/open-source-imu-and-ahrs-algorithms/.
This algorithm is also available as a function:
qmt.oriEstMahony().- Parameters:
Ts – sampling time in seconds
- class qmt.OriEstIMUBlock(Ts)[source]
OriEstIMU orientation estimation algorithm.
See https://dx.doi.org/10.1016/j.ifacol.2017.08.1534 for more information about this algorithm.
This algorithm is also available as a function:
qmt.oriEstIMU().- Parameters:
Ts – sampling time in seconds
- setParams(params)[source]
Supported parameters:
tauAcc: time constants for acc correction (50% time) [must be >0], [in seconds]
tauMag: time constants for mag correction (50% time) [must be >0], [in seconds]
zeta: bias estimation strength [no unit]
accRating: enables raw rating of accelerometer, set to 0 to disable
- class qmt.LowpassFilterBlock(Ts, fc=None, tau=None)[source]
Second-order Butterworth low-pass filter block.
This block uses the filter implementation of the VQF orientation estimation algorithm. The cutoff frequency can either directly be specified in Hz, or a time constant can be given. This time constant corresponds to the cutoff frequency as follows: \(f_\mathrm{c} = \frac{\sqrt{2}}{2\pi\tau}\).
For the first \(\tau\) seconds, the filter output is the mean of all previous samples, to ensure fast initial convergence.
- Parameters:
Ts – sampling time in seconds
fc – cutoff frequency in Hz
tau – time constant in seconds (either
fcortauhas to be None)