Hummingbird Flight Software
Flight software for the Hummingbird FCU quadcopter flight controller. Designed to run on the Teensy 4.1. Developed with VSCode+PlatformIO.
Classes | Macros
vectors.h File Reference
#include <Arduino.h>
#include "hummingbird_config.h"

Go to the source code of this file.

Classes

class  Vectorf
 A vector object is definied by it's rows/length. More...
 
class  Vectord
 A vector object is definied by it's rows/length. More...
 

Macros

#define VECTOR_ELEMENT(VEC, i)   VEC[i]
 A vector object is definied by it's rows/length. More...
 

Macro Definition Documentation

◆ VECTOR_ELEMENT

#define VECTOR_ELEMENT (   VEC,
 
)    VEC[i]

A vector object is definied by it's rows/length.

When a vector object is created, the array is allocated on the heap (RAM2 for Teensy 4.1) with the C++ 'new' keyword. See the following resource to learn more: https://www.techiedelight.com/dynamic-memory-allocation-in-c-for-2d-3d-array/ Macro to extract the value in vector "VEC" at "VEC(i)" with length "len." This macro makes array/vector indexing a bit easier and consistent with the MATRIX_ELEMENT macro. IT IS UP TO THE USER TO ENSURE THAT THE INDEX IS LESS THAN THE VECTOR LENGTH!

Parameters
VECVectorf variable name
iVectorf index