From 9b88f828479c4e746f7c7e6275af4c6abb3c0a7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Federico=20Disar=C3=B2?= <federico.disaro@skywarder.eu>
Date: Mon, 17 Feb 2025 11:50:48 +0100
Subject: [PATCH] minor explainations in the readme

---
 README.md | 18 +++++++++++++-----
 main.m    |  6 ++++--
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index 73a674d..649abc1 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # GNC Recruitment Assigment
 
-In this assigment, the goal is to create a function to detect the apogee of the rocket during the flight and comand the opening of the parachute.
+In this assigment, the goal is to create algorithm able to detect the apogee of the rocket during the flight and comand the opening of the parachute.
 
 The file `main.m` load the logs of a previous flight and then simulates the flight of the rocket. The first part of the script logs the logs of the sensors of a previous flight which will be then used for the simulation.
 
@@ -18,8 +18,16 @@ function [ flag_apogee, data] = apogee_detector( pressure_measurment, IMU_measur
 
 which uses the datas measured during the flight as input and outputs the boolean variable `flag_apogee`, which must be:
 
-* 1  if the function detecs the apogee
-* 0 otherwise
+* 1  during the instants where the rocket is at the apogee
+* 0  otherwise
+
+This algorithm is safe critical, because the detection of the apogeee comands the opening of the parachute. So the algorithm that you will develop should be resilient and work even in off nominal conditions where:
+
+* the apogeee height may change from the one contained in the logs
+* the trajectory of the rocket may change from the one contained in the logs
+* unexpected faults may happen
+
+To take into acount these factors, the function that you will submit will be tested with the logs of a different flight. 
 
 **data:** it is a support variable that you can use if and however you want. It is declared inside `main.m`; if you want to use it you have to declare it there, otherwise you can just leave it as it is.
 
@@ -29,13 +37,13 @@ which uses the datas measured during the flight as input and outputs the boolean
 | :------: |
 |    Pa    |
 
-**IMU_measurment:** the reference axis are the body-axis of the rocket. 
+**IMU_measurment:** the reference axis are the body-axis of the rocket.
 
 | acceleration_X | acceleration_Y | acceleration_Z | angular_speed_X | angular_speed_Y | angular_speed_Z |
 | :------------: | :------------: | :------------: | :-------------: | :-------------: | :-------------: |
 |     m/s^2     |     m/s^2     |     m/s^2     |      rad/s      |      rad/s      |      rad/s      |
 
-**GPS_measurment:** 
+**GPS_measurment:**
 
 |    latitude    | longitude       | altitude (from sea level) |
 | :-------------: | --------------- | :-----------------------: |
diff --git a/main.m b/main.m
index b5b3078..50f7c8c 100644
--- a/main.m
+++ b/main.m
@@ -31,7 +31,7 @@ for t = 0:20000:300*1e6
     % Apogee detection
     [flag_apogee, data] = apogee_detector(pressure_measurment, IMU_measurment, GPS_measurment, data);
     
-    % Save apogee
+    % Save first apogee detection time
     if flag_apogee && (apogee_time < 0)
         apogee_time = t;
     end
@@ -57,17 +57,19 @@ subplot(3,1,1);
 plot(IMU(:,1)/1e6, IMU(:,2) ); 
 grid minor; xlabel('time'); ylabel('m/s^2');
 xline(apogee_time/1e6, '--', "apogee");
-title('Accelerometer')
+title('Accelerometer X')
 
 subplot(3,1,2);
 plot(IMU(:,1)/1e6, IMU(:,3) ); 
 grid minor; xlabel('time'); ylabel('m/s^2');
 xline(apogee_time/1e6, '--', "apogee");
+title('Accelerometer Y')
 
 subplot(3,1,3);
 plot(IMU(:,1)/1e6, IMU(:,4) ); 
 grid minor; xlabel('time'); ylabel('m/s^2');
 xline(apogee_time/1e6, '--', "apogee");
+title('Accelerometer Z')
 
 % Plot GPS
 figure();
-- 
GitLab