summaryrefslogtreecommitdiff
path: root/include/unused/ads.hpp
blob: b16c4fb2ed3c0c261bf6373781be7a0d46f523bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include <iostream>
#include <exception>
#include <stdexcept>
#include <chrono>
#include <thread>
#include "kalmanfilter.hpp"
#include "logger.hpp"
#include "actuationPlan.hpp"
#include "rocketUtils.hpp"
#include "sensorIMU.hpp"
#include "sensorAltimeter.hpp"
#include "motor.hpp"
#include "eigen3/Eigen/Dense"

using namespace Eigen;

class ADS {

    private:

        KalmanFilter kf;      
        ActuationPlan plan;

        IMUSensor imu;
        AltimeterSensor altimeter;
        Motor motor;
        Vehicle rocket;

        /**
         * @brief Logs a summary of all pertinent current rocket data
         *  (e.g. Altitude, Velocity, Acceleration)
         */
        virtual void logSummary();
        
        /**
         * @brief Performs a routine to calculate the average altitude
         *      while the vehicle is waiting on the pad.
         */
        virtual void updateOnPadAltitude();

        /**
         * @brief Update the vehicle with the current sensor (IMU & Altimeter) readings
         */
        virtual void updateSensorData();

        /**
         * @brief Update the rocket state based on its current telemetry readings.
         *     Also Log pertinent telemetry and rocket state data
         */
        virtual void updateRocketState();

    public:

        /**
         * @brief Construct a new ADS object
         * 
         * @param plan The Actuation Plan for the Rocket
         */
        ADS(ActuationPlan plan);

        /**
         * @brief Run the full active drag system from launch to landing.
         */
        virtual void run();
};