Main Content

ecompass

Compute orientation from accelerometer and magnetometer readings

Since R2024a

  • ecompass Block

Libraries:
Sensor Fusion and Tracking Toolbox / Multisensor Positioning / Navigation Filters
Navigation Toolbox / Multisensor Positioning / Navigation Filters

Description

The ecompass Simulink® block computes orientation using accelerometer and magnetometer readings. You can use the computed orientation to rotate quantities from global coordinate system to sensor body coordinate system.

Ports

Input

expand all

Accelerometer readings in sensor body coordinate system in m/s2, specified as an N-by-3 matrix of real scalar. The columns of the matrix correspond to the x-, y-, and z-axes of the sensor body. The rows in the matrix, N, correspond to individual samples.

Data Types: single | double

Magnetometer readings in sensor body coordinate system in µT, specified as an N-by-3 matrix. The columns of the matrix correspond to the x-, y-, and z-axes of the sensor body. The rows in the matrix, N, correspond to individual samples.

Data Types: single | double

Output

expand all

Orientation that can rotate quantities from a global coordinate system to a sensor body coordinate system, returned as an N-by-4 matrix of quaternions or 3-by-3-by-N array of rotation matrices. N denotes the number of samples. Orientations are the rotation that takes a quantity from the local navigation coordinate system to the body coordinate system.

  • If the Orientation format is specified as quaternion, the block returns the orientation as an N-by-4 matrix of quaternions.

  • If the Orientation format is specified as Rotation matrix, the block returns the orientation as an 3-by-3-by-N array of rotation matrices.

Data Types: single | double

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

Navigation reference frame, specified as NED for North-East-Down frame or ENU for East-North-Up frame.

Format used to describe orientation, specified as 'quaternion' or 'Rotation matrix'.

  • Interpreted execution — Simulate the model using the MATLAB® interpreter. This option shortens startup time. In Interpreted execution mode, you can debug the source code of the block.

  • Code generation — Simulate the model using generated C code. The first time that you run a simulation, Simulink generates C code for the block. The C code is reused for subsequent simulations if the model does not change. This option requires additional startup time.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2024a