LRAUV  revA
DepthEnvelope.h
Go to the documentation of this file.
1 
12 #ifndef DEPTHENVELOPE_H_
13 #define DEPTHENVELOPE_H_
14 
15 #include "component/Behavior.h"
16 
33 class DepthEnvelope : public Behavior
34 {
35 public:
36 
37  DepthEnvelope( const Str& prefix, const Module* module );
38 
39  virtual ~DepthEnvelope();
40 
42  void initialize( void );
43 
45  void run();
46 
48  bool isSatisfied();
49 
51  bool runIfUnsatisfied();
52 
54  void uninitialize( void );
55 
57  static Behavior* CreateBehavior( const Str& prefix, const Module* module );
58 
59 protected:
60 
61  // Config Settings
67 
68 
69  // Current control commands
70 
73 
77 
80 
81  // Behavior setting readers
82 
85 
88 
91 
94 
97 
100 
103 
106 
109 
110  // Actual values from settings
111 
114 
117 
120 
123 
126 
129 
132 
135 
137  float speedCmd_;
138 
139  // Slate input measurements
140 
143 
144  // Current depth rate
146 
147  // Slate output variables
148 
153 
156 
159 
162 
164  bool readParams( float& param );
165 
167  bool calcSatisfied( const float param );
168 
169  // Reads in configuration settings
170  void readConfig();
171 
172  // Reads in behavior settings
173  void readSettings();
174 
175  // If depthRate is nan, set to appropriate max dive rate.
176  float adjustDepthRate( float depthRate, bool goDown );
177 
178  // If usingDepth_ is true, project the depth out to when it can be switched
179  float projectDepth( float depth );
180 
181 private:
182  // Note that the copy constructor below is private and not given a body.
183  // Any attempt to call it will return a compiler error.
184  DepthEnvelope( const DepthEnvelope& old ); // disallow copy constructor
185 
186 };
187 
188 #endif /*DEPTHENVELOPE_H_*/
ConfigReader * elevTurnTimeCfgReader_
Definition: DepthEnvelope.h:65
SettingReader * maxDepthSettingReader_
Desired maximum height above sea floor for the vehicle.
Definition: DepthEnvelope.h:87
float elevatorTurnSeconds_
Definition: DepthEnvelope.h:160
float upDepthRateSetting_
Desired up depthRate of the vehicle.
Definition: DepthEnvelope.h:122
DataReader * speedCmdReader_
Current speed control speed command.
Definition: DepthEnvelope.h:79
float upPitchSetting_
Desired up pitch of the vehicle.
Definition: DepthEnvelope.h:128
DataReader * depthReader_
Current depth (in meter from sea surface – positive down)
Definition: DepthEnvelope.h:142
void initialize(void)
Initialize function.
Definition: DepthEnvelope.cpp:79
DataWriter * massPositionCmdWriter_
Definition: DepthEnvelope.h:152
float adjustDepthRate(float depthRate, bool goDown)
Definition: DepthEnvelope.cpp:368
A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL...
Definition: DataReader.h:30
SettingReader * downDepthRateSettingReader_
Desired down depthRate of the vehicle.
Definition: DepthEnvelope.h:99
SettingReader * pitchSettingReader_
Desired up/down pitch of the vehicle.
Definition: DepthEnvelope.h:102
DataReader * depthRateReader_
Definition: DepthEnvelope.h:145
float speedCmd_
Current speed cmd.
Definition: DepthEnvelope.h:137
SettingReader * depthRateSettingReader_
Desired up/down depthRate of the vehicle.
Definition: DepthEnvelope.h:93
bool isSatisfied()
Just do the satisfied: return true if envelope "satisfied".
Definition: DepthEnvelope.cpp:105
DataReader * massPositionCmdReader_
Definition: DepthEnvelope.h:76
DataWriter * depthRateCmdWriter_
Sets the depth rate for Vertical Control.
Definition: DepthEnvelope.h:155
Behavior is the abstract base class for components that implement mission behaviors and commands...
Definition: Behavior.h:32
ConfigReader * maxBuoyDiveRateCfgReader_
Definition: DepthEnvelope.h:64
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: DataWriter.h:27
ConfigReader * maxDiveRateCfgReader_
Definition: DepthEnvelope.h:63
ConfigReader * pitchLimitCfgReader_
Definition: DepthEnvelope.h:62
void readSettings()
Definition: DepthEnvelope.cpp:271
Contains the Behavior class definition.
ConfigReader * massTurnTimeCfgReader_
Definition: DepthEnvelope.h:66
float downPitchSetting_
Desired down pitch of the vehicle.
Definition: DepthEnvelope.h:125
SettingReader * depthSurrogateSettingReader_
Surrogate values to use instead of depth.
Definition: DepthEnvelope.h:90
Module is the abstract base class for a collection of Component objects that can be contained in a lo...
Definition: Module.h:45
SettingReader * upDepthRateSettingReader_
Desired up depthRate of the vehicle.
Definition: DepthEnvelope.h:96
DataWriter * elevatorAngleCmdWriter_
Definition: DepthEnvelope.h:151
DataReader * elevatorAngleCmdReader_
Current vertical control hold mode.
Definition: DepthEnvelope.h:75
Replacement for standard template class string.
Definition: Str.h:12
bool calcSatisfied(const float param)
Perform the satisfied: return true if envelope "satisfied".
Definition: DepthEnvelope.cpp:344
DataWriter * pitchCmdWriter_
Sets the pitch for Vertical Control.
Definition: DepthEnvelope.h:158
float projectDepth(float depth)
Definition: DepthEnvelope.cpp:388
Definition: ConfigReader.h:13
float maxDiveRate_
Maximum dive rate of the vehicle.
Definition: DepthEnvelope.h:131
DepthEnvelope(const Str &prefix, const Module *module)
Definition: DepthEnvelope.cpp:20
void run()
Just do the run: ignore the results of the satisfied.
Definition: DepthEnvelope.cpp:99
virtual ~DepthEnvelope()
Definition: DepthEnvelope.cpp:75
SettingReader * minDepthSettingReader_
Desired minimum height above sea floor for the vehicle.
Definition: DepthEnvelope.h:84
SettingReader * upPitchSettingReader_
Desired up pitch of the vehicle.
Definition: DepthEnvelope.h:105
Contains the DepthEnvelope Behavior/Command If the vehicle's depth is within the specified max/min en...
Definition: DepthEnvelope.h:33
Reads values from mission settings.
Definition: SettingReader.h:26
bool readParams(float &param)
Read in the parameters for satisfied or runIfUnsatisfied: return true if OK.
Definition: DepthEnvelope.cpp:317
SettingReader * downPitchSettingReader_
Desired down pitch of the vehicle.
Definition: DepthEnvelope.h:108
void readConfig()
Definition: DepthEnvelope.cpp:261
static Behavior * CreateBehavior(const Str &prefix, const Module *module)
Mission Component factory interface.
Definition: DepthEnvelope.cpp:382
void uninitialize(void)
Uninit function.
Definition: DepthEnvelope.cpp:252
float minDepthSetting_
Desired minimum height above sea floor for the vehicle.
Definition: DepthEnvelope.h:113
DataReader * verticalModeReader_
Current vertical control mode.
Definition: DepthEnvelope.h:72
DataWriter * verticalModeWriter_
Sets the depth mode for dynamic control.
Definition: DepthEnvelope.h:150
bool runIfUnsatisfied()
Do the run, and return true if envelope "satisfied".
Definition: DepthEnvelope.cpp:119
float maxBuoyDiveRate_
Maximum dive rate of the vehicle under only buoyancy control.
Definition: DepthEnvelope.h:134
float downDepthRateSetting_
Desired down depthRate of the vehicle.
Definition: DepthEnvelope.h:119
float massTurnSeconds_
Definition: DepthEnvelope.h:161
float maxDepthSetting_
Desired maximum height above sea floor for the vehicle.
Definition: DepthEnvelope.h:116