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

Revision:
82:0981b9ada820
Parent:
45:16b8162188ca
Child:
87:6d95f853dab3
--- a/SequenceController/SequenceController.hpp	Thu Nov 08 22:30:32 2018 +0000
+++ b/SequenceController/SequenceController.hpp	Fri Feb 15 16:00:17 2019 +0000
@@ -14,6 +14,17 @@
     float pitch;
 };
 
+//struct for saving the leg data
+struct legStruct {
+    int state;      //for the current StateMachine, states are ID-ed with enumeration
+    float timeout;
+    float yo_time;
+    float min_depth;
+    float max_depth;
+    float heading;
+    string title;
+};
+
 class SequenceController {
 public:
     SequenceController();
@@ -46,4 +57,37 @@
     
     int _current_state;
 };
+class LegController {
+public:
+    LegController();
+    
+    legStruct legStructLoaded[256];
+    
+    int loadLeg();
+    
+    legStruct process(string input_string);
+    legStruct load_def_leg();   //make sure defaults are in the leg structure 
+    
+    void legFunction();    //process the sequence
+    
+    void setState(int input_state);           //manually set the state of the system
+    int getState();
+    void setTimeout(float input_timeout);
+    void setDepthCommand(float input_depth_command);
+    void setPitchCommand(float input_pitch_command);
+    
+    int getLegState();
+    
+private:
+    char _neutral_sequence;
+    char _dive_cycle;
+    char _exit;
+    
+    int _number_of_legs;
+    int _leg_counter;
+    
+    Ticker sequenceTicker;          //Ticker for the sequenceFunction
+    
+    int _current_state;
+}; 
 #endif