Da Vinci Firmware 1
Firmware for the DaVinci-M rocket avionics board.
Loading...
Searching...
No Matches
eye.h File Reference

Utility functions for creating identity matrices of various sizes. More...

#include "rtwtypes.h"
#include <stddef.h>
#include <stdlib.h>
Include dependency graph for eye.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void b_eye (double b_I[36])
 Creates a 6x6 identity matrix.
 
void eye (double b_I[9])
 Creates a 3x3 identity matrix.
 
void eye_2 (double b_I[4])
 Creates a 2x2 identity matrix.
 
void eye_attitude (double b_I[16])
 Creates a 4x4 identity matrix, typically for attitude calculations.
 

Detailed Description

Utility functions for creating identity matrices of various sizes.

Author
Francesco Abate, MSA (Originally generated by MATLAB Coder)
Version
24.2 (MATLAB Coder version)
Date
2025-03-01

This is an auto-generated helper file from MATLAB Coder that provides C equivalents of the MATLAB eye() command. The functions populate a pre-allocated array with the values of an identity matrix.

Matrices are represented as flat, 1D arrays. These functions are used as low-level utilities within the MEKF (Multiplicative Extended Kalman Filter) controller code provided by the MSA subteam.

Definition in file eye.h.

Function Documentation

◆ b_eye()

void b_eye ( double  b_I[36])

Creates a 6x6 identity matrix.

Parameters
[out]b_IPointer to a 36-element array where the 6x6 identity matrix will be stored.
Returns
None

Definition at line 21 of file eye.c.

22{
23 int k;
24 memset(&b_I[0], 0, 36U * sizeof(double));
25 for (k = 0; k < 6; k++) {
26 b_I[k + 6 * k] = 1.0;
27 }
28}

Referenced by mekf().

Here is the caller graph for this function:

◆ eye()

void eye ( double  b_I[9])

Creates a 3x3 identity matrix.

Parameters
[out]b_IPointer to a 9-element array where the 3x3 identity matrix will be stored.
Returns
None

Definition at line 34 of file eye.c.

35{
36 memset(&b_I[0], 0, 9U * sizeof(double));
37 b_I[0] = 1.0;
38 b_I[4] = 1.0;
39 b_I[8] = 1.0;
40}

Referenced by mekf().

Here is the caller graph for this function:

◆ eye_2()

void eye_2 ( double  b_I[4])

Creates a 2x2 identity matrix.

Parameters
[out]b_IPointer to a 4-element array where the 2x2 identity matrix will be stored.
Returns
None

Definition at line 56 of file eye.c.

57{
58 b_I[1] = 0.0;
59 b_I[2] = 0.0;
60 b_I[0] = 1.0;
61 b_I[3] = 1.0;
62}

◆ eye_attitude()

void eye_attitude ( double  b_I[16])

Creates a 4x4 identity matrix, typically for attitude calculations.

Parameters
[out]b_IPointer to a 16-element array where the 4x4 identity matrix will be stored.
Returns
None

Definition at line 46 of file eye.c.

47{
48 memset(&b_I[0], 0, 16U * sizeof(double));
49 b_I[0] = 1.0;
50 b_I[5] = 1.0;
51 b_I[10] = 1.0;
52 b_I[15] = 1.0;
53}

Referenced by attitude_estimation().

Here is the caller graph for this function: