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