Marine systems simulation
ControlAlgorithm.h
1
4//
11#ifndef CONTROLALGORITHM
12#define CONTROLALGORITHM
13
14#include <SimObject.h>
15#include <string>
16#include <Eigen/Eigen>
17using namespace Eigen;
18
19
20namespace Ship{
21 class ControlAlgorithm : public SimObject
22 {
23 public:
24 ControlAlgorithm(const string& simObjectName, ISimObjectCreator* const creator);
25 virtual void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
26
27
28 #ifdef FH_VISUALIZATION
30 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator){}
31
33 virtual void RenderUpdate(const double T, const double* const X){}
34 #endif
35
36 protected:
37 ISignalPort* adStatePosition;
38 ISignalPort* adStateTheta;
39 ISignalPort* adStateVelocity;
40 ISignalPort* adStateRotation;
41
43 ISignalPort* adStateTheta_Desired;
45
49
53
54 };
55}
56#endif
57
Definition: ControlAlgorithm.h:22
ISignalPort * adStatePosition_Desired
Desired position.
Definition: ControlAlgorithm.h:42
ISignalPort * adStateRotation
Current attitude in euler angles.
Definition: ControlAlgorithm.h:40
int m_StateThetaErrorSum_Index
The relative index of the StateThetaErrorSum state in the state array.
Definition: ControlAlgorithm.h:51
int m_StatePositionErrorSum_Index
The relative index of the StatePositionErrorSum state in the state array.
Definition: ControlAlgorithm.h:50
double * adStateTheta_error
Attitude error, current - desired.
Definition: ControlAlgorithm.h:47
double * adStateVelocity_error
Linear velocity error, current - desired.
Definition: ControlAlgorithm.h:48
virtual void OdeFcn(const double T, const double *const X, double *const XDot, const bool bIsMajorTimeStep)
returns object derivatives as a function of time, states and input ports
int m_StateVelocityErrorSum_Index
The relative index of the StateVelocityErrorSum state in the state array.
Definition: ControlAlgorithm.h:52
ISignalPort * adStatePosition
Current position.
Definition: ControlAlgorithm.h:37
double * adStatePosition_error
Position error, current - desired.
Definition: ControlAlgorithm.h:46
ISignalPort * adStateTheta
Current attitude in quaternions.
Definition: ControlAlgorithm.h:38
ControlAlgorithm(const string &simObjectName, ISimObjectCreator *const creator)
reads parameters, registers states, input/output ports and shared resources
ISignalPort * adStateVelocity
Current linear velocity.
Definition: ControlAlgorithm.h:39
ISignalPort * adStateTheta_Desired
Desired attitude.
Definition: ControlAlgorithm.h:43
ISignalPort * adStateVelocity_Desired
Desired linear velocity.
Definition: ControlAlgorithm.h:44
Simple waypoint object.
Definition: CableAttach.h:16