LRAUV  revA
ActuatorModel.h
Go to the documentation of this file.
1 
9 #ifndef ACTUATORMODEL_H_
10 #define ACTUATORMODEL_H_
11 
12 #include "utils/AuvMath.h"
13 
38 {
39 public:
40 
42  ActuatorModel();
43 
46  {
47  ;
48  };
49 
50  void setCommand( const float command );
51 
52  // Predict the actuator position at smallDt
53  // ("look forward by a time step")
54  float project( const float dt );
55 
56  // Predict the actuator position at dt and store it as "previous"
57  // ("take a time step")
58  float advance( const float dt, bool debug = false );
59 
62  void setHyst( const float width, const float center )
63  {
64  hystWidth_ = width;
65  hystCenter_ = center;
66  }
67 
68  void setSpeed( const float speed )
69  {
70  speed_ = speed;
71  }
72 
73  void setPrevious( const float previous );
74 
75  float getCurrent( void )
76  {
77  return prevPosition_;
78  }
79 
80 private:
81 
82  // Predict the actuator position at smallDt
83  // ("look forward by a time step")
84  void project( const float dt, float &shaft, float& position, bool debug = false );
85 
86  float next( const float dt, bool debug = false );
87 
88  float hysteresis( const float shaft );
89 
90  float command_;
91 
93 
95 
97  float hystWidth_;
98 
100  float hystCenter_;
101 
103  float speed_;
104 
105 };
106 
107 #endif /*ACTUATORMODEL_H_*/
void setPrevious(const float previous)
Override the model to set the "current" value.
Definition: ActuatorModel.cpp:57
void setHyst(const float width, const float center)
Definition: ActuatorModel.h:62
float prevShaft_
Definition: ActuatorModel.h:92
ActuatorModel()
Construct an model using the given params.
Definition: ActuatorModel.cpp:18
float getCurrent(void)
Definition: ActuatorModel.h:75
float speed_
Speed of the acutator (units/sec)
Definition: ActuatorModel.h:103
float project(const float dt)
Definition: ActuatorModel.cpp:34
float advance(const float dt, bool debug=false)
Definition: ActuatorModel.cpp:47
Contains the AuvMath class declaration.
void setCommand(const float command)
Definition: ActuatorModel.cpp:29
float hystCenter_
The center of the hysteresis curve (normally 0)
Definition: ActuatorModel.h:100
~ActuatorModel()
Destructor.
Definition: ActuatorModel.h:45
bool movingToRight_
Definition: ActuatorModel.h:94
float next(const float dt, bool debug=false)
Definition: ActuatorModel.cpp:72
float hystWidth_
The width in of the hysteresis.
Definition: ActuatorModel.h:97
void setSpeed(const float speed)
Definition: ActuatorModel.h:68
float prevPosition_
Definition: ActuatorModel.h:92
Encapsulates the actuator model.
Definition: ActuatorModel.h:37
*uLong * dt
Definition: ZipEncoder.cpp:36
float hysteresis(const float shaft)
Definition: ActuatorModel.cpp:89
float command_
Definition: ActuatorModel.h:90
bool movingToLeft_
Definition: ActuatorModel.h:94