IZAR Flight Controller 1.0.0
IZAR Flight Controller running with an ESP32.
utils.h File Reference
#include "mpu6050.h"
#include "sensors_reading/sensors_reading.h"
#include <esp_err.h>
#include <esp_log.h>
#include <unistd.h>
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

float calculate_vertical_speed (float current_altitude, float last_altitude, int64_t current_ms, int64_t last_ms)
 Calculate the vertical speed of the rocket in meters per second (m/s).
esp_err_t format_log_line (char *line_buf, size_t buff_size, int64_t ms, ROCKET_STATUS_T rocket_status, int32_t pressure, float altitude, float vertical_speed, float temperature, mpu6050_acceleration_t acc, mpu6050_rotation_t rot)
 Format the line that will be printed into the SD card file. This file contains all the flight recorded data.

Function Documentation

◆ calculate_vertical_speed()

float calculate_vertical_speed ( float current_altitude,
float last_altitude,
int64_t current_ms,
int64_t last_ms )

Calculate the vertical speed of the rocket in meters per second (m/s).

Parameters
current_altitudelast recorded altitude in meters.
last_altitudeprevious recorded altitude in meters.
current_mscurrent miliseconds since system boot.
last_msmiliseconds since system boot where the last_altitude was recorded.
Returns
float vertical speed of the rocket in meters per second (m/s).
Here is the caller graph for this function:

◆ format_log_line()

esp_err_t format_log_line ( char * line_buf,
size_t buff_size,
int64_t ms,
ROCKET_STATUS_T rocket_status,
int32_t pressure,
float altitude,
float vertical_speed,
float temperature,
mpu6050_acceleration_t acc,
mpu6050_rotation_t rot )

Format the line that will be printed into the SD card file. This file contains all the flight recorded data.

Parameters
line_bufpointer to the buffer where the line will be written.
buff_sizesize of the buffer string in bytes.
msmilliseconds from system bootup where the data was recorded.
rocket_statusrocket status.
pressurerecorded pressures.
altituderecorded altitude.
vertical_speedcalculated vertical speed.
temperaturerecorded temperature.
accrecorded acceleration.
rotrecorded rotation speed.
Returns
esp_err_t ESP_OK on success.

< esp_err_t value indicating success (no error)

Here is the caller graph for this function: