Skip to main content
Skip table of contents

CloudNav

Overview

Convert sensor raw signals to quaternions

Discussion

This module converts raw sensor signals to quaternions.

Three sensors are supported: an accelerometer, a gyro, and a magnetometer.

An input pin is provided for each sensor

The data coming in on each pin is xData, yData, zData, timeStampLo, timeStampHi, dataValid (6 channels).

Module arguments are a noise measurement for each sensor.

Internally the sample rate of each sensor is 100 Hz and is converted to a sample period in nanoseconds.

The sensor noise arguments are as follows:

ACCEL (12 bits per g) - 1.8 mg(RMS), 11 bit G: Example: (sample_t)(0.0018f * (1 << 11) + 0.5);

GYRO (10 bits rad/s) - 125 mdps(RMS), 10 Bit radians/sec: Example: (sample_t)(sample_t)(0.0022f * (1 << 10) + 0.5);

MAG (12 bits milligauss) - 70 nT RMS: Example: (sample_t)(0.0007f * (1 << 12) + 0.5);

Timestamp is in elapsed nanoseconds

Type Definition

CODE
typedef struct _ModuleCloudNav
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 accelNoise;                             // Accel Noise
    INT32 gyroNoise;                              // Gyro Noise
    INT32 magNoise;                               // Mag Noise
    INT32 bEnableMag;                             // Enable mag
    FLOAT32 magFeedbackGain;                      // Mag feedback gain
    INT32 accelSR;                                // Accel sample rate
    INT32 gyroSR;                                 // Gyro sample rate
    INT32 magSR;                                  // Mag sample rate
    INT32* rawA;                                  // raw accel signals
    INT32* rawG;                                  // raw gyro signals
    INT32* rawM;                                  // raw mag signals
    INT32* ptA;                                   // pt accel signals
    INT32* ptG;                                   // pt gyro signals
    INT32* ptM;                                   // pt mag signals
    void * p_cnsm;                                // Shared memory
    void * p_cnsf;                                // Sensor Fusion memory
    void * p_pdata;                               // Persistent data
    void * p_quantData;                           // Persistent quant data
} ModuleCloudNavClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

accelNoise

int

const

0

2

Unrestricted

gyroNoise

int

const

0

1

Unrestricted

magNoise

int

const

0

12

Unrestricted

bEnableMag

int

const

0

1

Unrestricted

magFeedbackGain

float

const

0

1

Unrestricted

accelSR

int

const

1

104

Unrestricted

gyroSR

int

const

1

104

Unrestricted

magSR

int

const

1

100

Unrestricted

rawA

int*

state

0

[1 x 3]

Unrestricted

rawG

int*

state

0

[1 x 3]

Unrestricted

rawM

int*

state

0

[1 x 3]

Unrestricted

ptA

int*

state

0

[1 x 3]

Unrestricted

ptG

int*

state

0

[1 x 3]

Unrestricted

ptM

int*

state

0

[1 x 3]

Unrestricted

p_cnsm

void *

const

1

Unrestricted

p_cnsf

void *

const

1

Unrestricted

p_pdata

void *

const

1

Unrestricted

p_quantData

void *

const

1

Unrestricted

Pins

Input Pins

Name: accel

Description: Input signal

Data type: float

Channel range: 6

Block size range: 1

Sample rate range: Unrestricted

Complex support: Real

Name: gyro

Description: Input signal

Data type: float

Channel range: 6

Block size range: 1

Sample rate range: Unrestricted

Complex support: Real

Name: mag

Description: Input signal

Data type: float

Channel range: 6

Block size range: 1

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: quat

Description: Output four quaternion signals

Data type: int

Name: calQual

Description: calibration quality

Data type: int

MATLAB Usage

File Name: cloudnav_sensor_fusion_module.m

CODE
 M = cloudnav_sensor_fusion_module(NAME, ACCEL_NOISE, GYRO_NOISE, MAG_NOISE, ENABLE_MAG)
 Converts x,y,z signals into quaternions
 Arguments:
 NAME - name of the module

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.