most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown

Dependencies:   mbed MODSERIAL FATFileSystem

Committer:
joel_ssc
Date:
Mon May 13 19:25:26 2019 +0000
Revision:
92:52a91656458a
Parent:
88:1813f583cee9
version for first flight test, timeouts not yet set correctly

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tnhnrl 57:ec69651c8c21 1 #include "mbed.h"
tnhnrl 57:ec69651c8c21 2 #include "ConfigFile.h"
joel_ssc 82:0981b9ada820 3 #include <string>
tnhnrl 57:ec69651c8c21 4
tnhnrl 57:ec69651c8c21 5 #ifndef CONFIGFILEIO_HPP
tnhnrl 57:ec69651c8c21 6 #define CONFIGFILEIO_HPP
joel_ssc 82:0981b9ada820 7 struct logFileNames {
joel_ssc 82:0981b9ada820 8 string diagFileName;
joel_ssc 82:0981b9ada820 9 string logFileName;
joel_ssc 82:0981b9ada820 10 int logversion;
joel_ssc 82:0981b9ada820 11 int diagversion;
joel_ssc 82:0981b9ada820 12 };
joel_ssc 87:6d95f853dab3 13 struct neutralStatus {
joel_ssc 87:6d95f853dab3 14 int setval;
joel_ssc 87:6d95f853dab3 15 int bce_neutral_mm;
joel_ssc 87:6d95f853dab3 16 int batt_neutral_mm;
joel_ssc 87:6d95f853dab3 17 };
tnhnrl 57:ec69651c8c21 18
joel_ssc 82:0981b9ada820 19
tnhnrl 57:ec69651c8c21 20 class ConfigFileIO {
tnhnrl 57:ec69651c8c21 21 public:
tnhnrl 57:ec69651c8c21 22 ConfigFileIO();
joel_ssc 87:6d95f853dab3 23 logFileNames logFilesStruct;
joel_ssc 87:6d95f853dab3 24 neutralStatus neutralStruct;
joel_ssc 87:6d95f853dab3 25
joel_ssc 87:6d95f853dab3 26 //modified savebatt to save frequency and deadband 7/11/2018
tnhnrl 76:c802e1da4179 27 void saveBattData(float batt_p_gain, float batt_i_gain, float batt_d_gain, int batt_zeroOffset, float batt_filter_freq, float batt_deadband); //modified this because zero offsets are integers
tnhnrl 73:f6f378311c8d 28 void savePitchData(float pitch_p_gain, float pitch_i_gain, float pitch_d_gain, float pitch_zeroOffset, float pitch_filter_freq, float pitch_deadband);
tnhnrl 73:f6f378311c8d 29
tnhnrl 76:c802e1da4179 30 void saveBCEData(float bce_p_gain, float bce_i_gain, float bce_d_gain, int bce_zeroOffset, float bce_filter_freq, float bce_deadband); //modified this because zero offsets are integers
tnhnrl 73:f6f378311c8d 31 void saveDepthData(float depth_p_gain, float depth_i_gain, float depth_d_gain, float depth_zeroOffset, float depth_filter_freq, float depth_deadband);
tnhnrl 57:ec69651c8c21 32
tnhnrl 57:ec69651c8c21 33 void saveRudderData(float setMinDeg, float setMaxDeg, float setCenterPWM, float setMinPWM, float setMaxPWM);
tnhnrl 73:f6f378311c8d 34 void saveHeadingData(float heading_p_gain, float heading_i_gain, float heading_d_gain, float heading_zeroOffset, float heading_filter_freq, float heading_deadband);
tnhnrl 57:ec69651c8c21 35
tnhnrl 57:ec69651c8c21 36 //ConfigFunctions
tnhnrl 57:ec69651c8c21 37 int load_BCE_config();
joel_ssc 82:0981b9ada820 38 int load_LogVers_config(int print_diag); // jcw feb 2019
joel_ssc 87:6d95f853dab3 39 void saveNeutralStatus(int setval, int bce_neutral_mm, int batt_neutral_mm);
joel_ssc 87:6d95f853dab3 40 int load_setneutral_status();
joel_ssc 87:6d95f853dab3 41 void report_no_neutral_found(int bce_last_pos, int batt_last_pos);
joel_ssc 88:1813f583cee9 42 void save_FinalTime();
joel_ssc 87:6d95f853dab3 43 void report_still_inverted( float roll_value, int yotime);
joel_ssc 82:0981b9ada820 44 void saveLogVersData(int logversion, int diagversion);
tnhnrl 57:ec69651c8c21 45 int load_BATT_config();
tnhnrl 57:ec69651c8c21 46 int load_DEPTH_config();
tnhnrl 57:ec69651c8c21 47 int load_PITCH_config();
joel_ssc 86:ba3a118b0080 48 int load_StartTime();
tnhnrl 57:ec69651c8c21 49 int load_HEADING_config(); //heading outer loop of rudder servo
tnhnrl 57:ec69651c8c21 50 int load_RUDDER_config(); //rudder servo
tnhnrl 57:ec69651c8c21 51 int load_script();
tnhnrl 57:ec69651c8c21 52
tnhnrl 57:ec69651c8c21 53 private:
tnhnrl 57:ec69651c8c21 54 float _neutral_batt_pos_mm;
tnhnrl 57:ec69651c8c21 55 float _neutral_bce_pos_mm;
tnhnrl 57:ec69651c8c21 56 };
tnhnrl 57:ec69651c8c21 57 #endif