IZAR Flight Controller 1.0.0
IZAR Flight Controller running with an ESP32.
|
#include "mpu6050.h"
#include "sensors_reading/sensors_reading.h"
#include <esp_err.h>
#include <esp_log.h>
#include <unistd.h>
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. |
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).
current_altitude | last recorded altitude in meters. |
last_altitude | previous recorded altitude in meters. |
current_ms | current miliseconds since system boot. |
last_ms | miliseconds since system boot where the last_altitude was recorded. |
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.
line_buf | pointer to the buffer where the line will be written. |
buff_size | size of the buffer string in bytes. |
ms | milliseconds from system bootup where the data was recorded. |
rocket_status | rocket status. |
pressure | recorded pressures. |
altitude | recorded altitude. |
vertical_speed | calculated vertical speed. |
temperature | recorded temperature. |
acc | recorded acceleration. |
rot | recorded rotation speed. |
< esp_err_t value indicating success (no error)