LRAUV  revA
PitchServo.h
Go to the documentation of this file.
1 
12 #ifndef PITCHSERVO_H_
13 #define PITCHSERVO_H_
14 
15 #include "component/Behavior.h"
16 #include "utils/Trajectory.h"
17 
33 class PitchServo : public Behavior
34 {
35 public:
36 
37  PitchServo( const Str& prefix, const Module* module );
38 
39  virtual ~PitchServo();
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 
62  void readConfig();
63 
65  bool readSettings( float& measuredValue );
66 
68  bool readParams( float& measuredValue );
69 
71  bool calcSatisfied( const float measuredValue );
72 
73  // Configuration variables
80 
81  // Slate input setting variables
82 
85 
88 
91 
94 
97 
100 
101  // Data Readers
102 
104 
105  // Data Writers
106 
109 
112 
113  // Actual values from settings
114 
117 
120 
123 
126 
129 
132 
135 
138 
141 
144 
147 
150 
151 private:
152  // Note that the copy constructor below is private and not given a body.
153  // Any attempt to call it will return a compiler error.
154  PitchServo( const PitchServo& old ); // disallow copy constructor
155 
156 };
157 
158 #endif /*PITCHSERVO_H_*/
float lastMeasuredValue_
Used to determine rate of change in measured value.
Definition: PitchServo.h:134
ConfigReader * kiDepthCfgReader_
Definition: PitchServo.h:75
bool runIfUnsatisfied()
Do the run, and return true if envelope "satisfied".
Definition: PitchServo.cpp:186
Contains the Trajectory class definition.
bool readSettings(float &measuredValue)
Read in the mission parameters.
Definition: PitchServo.cpp:84
DataWriter * pitchCmdWriter_
Sets the pitch specification for Depth Control.
Definition: PitchServo.h:111
Trajectory trajectory_
Estimator for depth or its surrogate.
Definition: PitchServo.h:137
A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL...
Definition: UniversalDataReader.h:26
float maxDiveRate_
Used in estimating maxChangeRate_.
Definition: PitchServo.h:143
SettingReader * inputSettingReader_
Surrogate variable to use instead of depth.
Definition: PitchServo.h:87
SettingReader * integralGainSettingReader_
Specifies PID loop integral gain – required if DepthSurrogate specified.
Definition: PitchServo.h:93
float maxDiveAccel_
Used in estimating maxChangeRate_.
Definition: PitchServo.h:146
DataWriter * verticalModeWriter_
Sets the depth mode for dynamic control.
Definition: PitchServo.h:108
UniversalDataReader * depthReader_
Definition: PitchServo.h:103
Behavior is the abstract base class for components that implement mission behaviors and commands...
Definition: Behavior.h:32
This is a helper class for Depthcontrol, HeadingControl, and SpeedControl which projects the state of...
Definition: Trajectory.h:18
float holdValueSetting_
Desired depth of the vehicle, or surrogate for depth.
Definition: PitchServo.h:116
void readConfig()
Read in the configuration parameters.
Definition: PitchServo.cpp:73
PitchServo(const Str &prefix, const Module *module)
Definition: PitchServo.cpp:20
void initialize(void)
Initialize function.
Definition: PitchServo.cpp:58
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: DataWriter.h:27
bool readParams(float &measuredValue)
Read in the parameters for satisfied or runIfUnsatisfied: return true if OK.
Definition: PitchServo.cpp:108
Contains the Behavior class definition.
Contains the PitchServo Behavior/Command Uses depth, or the specified surrogate for depth to control ...
Definition: PitchServo.h:33
Module is the abstract base class for a collection of Component objects that can be contained in a lo...
Definition: Module.h:45
ConfigReader * kpDepthCfgReader_
Definition: PitchServo.h:76
float measuredValueIntegral_
Actual integral of depth (or its surrogate)
Definition: PitchServo.h:128
Replacement for standard template class string.
Definition: Str.h:12
virtual ~PitchServo()
Definition: PitchServo.cpp:54
Definition: ConfigReader.h:13
ConfigReader * maxDiveRateCfgReader_
Definition: PitchServo.h:77
SettingReader * holdValueSettingReader_
Desired depth of the vehicle, or surrogate for depth.
Definition: PitchServo.h:84
void run()
Just do the run: ignore the results of the satisfied.
Definition: PitchServo.cpp:132
Reads values from mission settings.
Definition: SettingReader.h:26
ConfigReader * maxDepthIntCfgReader_
Definition: PitchServo.h:79
float integralGainSetting_
Specifies PID loop integral gain.
Definition: PitchServo.h:122
bool calcSatisfied(const float measuredValue)
Perform the satisfied: return true if envelope "satisfied".
Definition: PitchServo.cpp:125
SettingReader * changePerMeterSettingReader_
Specifies approximate change per meter depth.
Definition: PitchServo.h:99
float maxDepthInt_
Maximum integral.
Definition: PitchServo.h:131
bool startBelowSetting_
Indicates difference between setting and position at initialization.
Definition: PitchServo.h:149
float maxChangeRate_
Used in state estimation.
Definition: PitchServo.h:140
bool isSatisfied()
Just do the satisfied: return true if envelope "satisfied".
Definition: PitchServo.cpp:172
SettingReader * proportionalGainSettingReader_
Specifies PID loop proportional gain – required if DepthSurrogate specified.
Definition: PitchServo.h:90
SettingReader * derivativeGainSettingReader_
Specifies PID loop derivative gain – required if DepthSurrogate specified.
Definition: PitchServo.h:96
void uninitialize(void)
Uninit function.
Definition: PitchServo.cpp:214
ConfigReader * maxDiveAccelCfgReader_
Definition: PitchServo.h:78
float proportionalGainSetting_
Specifies PID loop proportional gain.
Definition: PitchServo.h:119
ConfigReader * kdDepthCfgReader_
Definition: PitchServo.h:74
float derivativeGainSetting_
Specifies PID loop derivative gain.
Definition: PitchServo.h:125
static Behavior * CreateBehavior(const Str &prefix, const Module *module)
Mission Component factory interface.
Definition: PitchServo.cpp:220