LRAUV  revA
GoToSurface.h
Go to the documentation of this file.
1 
12 #ifndef GOTOSURFACE_H_
13 #define GOTOSURFACE_H_
14 
15 #include "component/Behavior.h"
16 
18 
29 class GoToSurface : public Behavior
30 {
31 public:
32 
33  GoToSurface( const Str& prefix, const Module* module );
34 
35  virtual ~GoToSurface();
36 
38  void initialize( void );
39 
41  bool readParams( float& depth );
42 
44  bool calcSatisfied( const float depth );
45 
47  void run();
48 
50  bool isSatisfied();
51 
53  bool runIfUnsatisfied();
54 
56  void uninitialize( void );
57 
59  static Behavior* CreateBehavior( const Str& prefix, const Module* module );
60 
61 protected:
62 
63  // Slate input setting variables
64 
71 
72  // Slate input measurements
73 
74  // Current depth (in meter from sea surface -- positive down)
76 
77  // Current height above sea floor
79 
80  // Current pitch of vehicle
82 
83  // Slate output variables
84 
85  // Sets the depth mode for dynamic control
89 
90  // Sets Control variables
94 
95  // Configuration readers
98 
99 private:
100  // Note that the copy constructor below is private and not given a body.
101  // Any attempt to call it will return a compiler error.
102  GoToSurface( const GoToSurface& old ); // disallow copy constructor
103 
104  // indicates whether things are ok to run
105  bool ok_;
106  bool surfaceTimeoutReported_, pitchTimeoutReported_; // used to only report failures once
107 
110  float pitchLimit_;
112 
119 
120  // Time that behavior was started
122 
123  // Timeout for pitching up and overall attempt at surfacing before calc is satisfied and allowed to fall through.
125 
126  // initialize vehicle config variables
127  bool loadParams( void );
128 
129  // Returns true if there is sufficient altitude to turn up and pitch is responding within the timeout.
130  bool checkPitchAndAltitude( void );
131 
132  void resetTimeouts( void );
133 
134 };
135 
136 #endif /*GOTOSURFACE_H_*/
void uninitialize(void)
Uninit function.
Definition: GoToSurface.cpp:353
float pitchLimit_
Definition: GoToSurface.h:110
DataWriter * speedCmdWriter_
Definition: GoToSurface.h:93
A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL...
Definition: UniversalDataReader.h:26
GoToSurface(const Str &prefix, const Module *module)
Definition: GoToSurface.cpp:22
SettingReader * surfaceTimeoutSettingReader_
Definition: GoToSurface.h:70
SettingReader * pitchSettingReader_
Definition: GoToSurface.h:67
DataWriter * massPositionCmdWriter_
Definition: GoToSurface.h:88
Timestamp pitchStartTime_
Definition: GoToSurface.h:121
void initialize(void)
Initialize function.
Definition: GoToSurface.cpp:66
bool isSatisfied()
Just do the satisfied: return true if envelope "satisfied".
Definition: GoToSurface.cpp:195
DataWriter * elevatorAngleCmdWriter_
Definition: GoToSurface.h:87
bool runIfUnsatisfied()
Do the run, and return true if envelope "satisfied".
Definition: GoToSurface.cpp:208
Timespan class, represents a delta of time.
Definition: Timestamp.h:248
SettingReader * speedSettingReader_
Definition: GoToSurface.h:68
float surfacingTimeoutSetting_
Definition: GoToSurface.h:118
float depthRateSetting_
Settings.
Definition: GoToSurface.h:114
Behavior is the abstract base class for components that implement mission behaviors and commands...
Definition: Behavior.h:32
ConfigReader * surfaceThresholdCfgReader_
Definition: GoToSurface.h:96
virtual ~GoToSurface()
Definition: GoToSurface.cpp:61
UniversalDataReader * depthReader_
Definition: GoToSurface.h:75
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: DataWriter.h:27
float pitchSetting_
Definition: GoToSurface.h:115
bool loadParams(void)
Definition: GoToSurface.cpp:94
DataWriter * pitchCmdWriter_
Definition: GoToSurface.h:92
Timespan surfacingTimeout_
Definition: GoToSurface.h:124
Contains the Behavior class definition.
bool pitchTimeoutReported_
Definition: GoToSurface.h:106
SettingReader * pitchTimeoutSettingReader_
Definition: GoToSurface.h:69
bool ok_
Definition: GoToSurface.h:105
Module is the abstract base class for a collection of Component objects that can be contained in a lo...
Definition: Module.h:45
ConfigReader * pitchLimitCfgReader_
Definition: GoToSurface.h:97
Timestamp surfaceStartTime_
Definition: GoToSurface.h:121
Replacement for standard template class string.
Definition: Str.h:12
UniversalDataReader * altitudeReader_
Definition: GoToSurface.h:78
UniversalDataReader * pitchReader_
Definition: GoToSurface.h:81
DataWriter * depthRateCmdWriter_
Definition: GoToSurface.h:91
float pitchTimeoutSetting_
Definition: GoToSurface.h:117
float speedSetting_
Definition: GoToSurface.h:116
Definition: ConfigReader.h:13
DataWriter * verticalModeWriter_
Definition: GoToSurface.h:86
void run()
Just do the run: ignore the results of the satisfied.
Definition: GoToSurface.cpp:188
bool checkPitchAndAltitude(void)
Definition: GoToSurface.cpp:291
Reads values from mission settings.
Definition: SettingReader.h:26
bool surfaceTimeoutReported_
Definition: GoToSurface.h:106
bool readParams(float &depth)
Read in the parameters for satisfied or runIfUnsatisfied: return true if OK.
Definition: GoToSurface.cpp:86
Contains the GoToSurface Behavior/Command.
Definition: GoToSurface.h:29
SettingReader * depthRateSettingReader_
Setting Readers.
Definition: GoToSurface.h:66
bool calcSatisfied(const float depth)
Perform the satisfied: return true if envelope "satisfied".
Definition: GoToSurface.cpp:162
void resetTimeouts(void)
Definition: GoToSurface.cpp:342
static Behavior * CreateBehavior(const Str &prefix, const Module *module)
Mission Component factory interface.
Definition: GoToSurface.cpp:361
Represents absolute times.
Definition: Timestamp.h:31
float surfaceThreshold_
*----------------— vehicle parameters -----------------------—*/
Definition: GoToSurface.h:109
Timespan pitchTimeout_
Definition: GoToSurface.h:124