Marine systems simulation
VirtualPID.h
1
10
11#ifndef VirtualPID_H
12#define VirtualPID_H
13
14#include "SimObject.h"
15#include <Eigen/Eigen>
16
17class VirtualPID : public SimObject
18{
19public:
21 VirtualPID(std::string sSimObjectName, ISimObjectCreator* pCreator);
23
25 void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
26
27 void InitialConditionSetup(const double T, const double* const X, double* const XDot, ISimObjectCreator* pCreator);
28
29 const double* OutFunction(const double T, const double * const X);
30
31#ifdef FH_VISUALIZATION
33 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator){}
34
36 virtual void RenderUpdate(const double T, const double* const X){}
37#endif
38protected:
39 typedef Eigen::Matrix<double, 3, 1> vec3;
40
41 ISignalPort* m_InErr;
42 int m_adOut, m_adIntegral, m_adDerivate;
43 double m_Pp, m_Pd, m_Pi, m_IntegralSaturation, m_DerivativeTInv;
44
45 double m_OutRatio;
46 double m_OutMax;
47 double m_Out;
48 double m_InitialT;
49
50 double m_OutPre;
51 double m_OutMaxDelta;
52};
53
54
55#endif
Definition: VirtualPID.h:18
void OdeFcn(const double T, const double *const X, double *const XDot, const bool bIsMajorTimeStep)
Calculates the state derivatives.
VirtualPID(std::string sSimObjectName, ISimObjectCreator *pCreator)
Constructor.