Marine systems simulation
HeadingPIDController.h
1#ifndef __HeadingPIDController_H
2#define __HeadingPIDController_H
3
11#include <SimObject.h>
12#include <string>
13#include <Eigen/Eigen>
14using namespace Eigen;
15
16
17namespace Ship{
18 class HeadingPIDController: public SimObject
19 {
20 public:
21 HeadingPIDController(const std::string& simObjectName, ISimObjectCreator* const creator);
22 virtual void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
23
24 const double* Torque(const double T, const double *const X);
25 const double* AngleDiff(const double T, const double *const X);
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 double Kp,Kd,Ki;
37 double T,angleDiff;
38 ISignalPort* m_InCurrentHeading;
39 ISignalPort* m_InCurrentYawRate;
40 ISignalPort* m_InDesiredHeading;
41 ISignalPort* m_InDesiredYawRate;
43
44 double HeadingDifference( double from, double to);
45 };
46}
47#endif
Definition: HeadingPIDController.h:19
ISignalPort * m_InCurrentYawRate
Current position.
Definition: HeadingPIDController.h:39
ISignalPort * m_InDesiredYawRate
Desired position.
Definition: HeadingPIDController.h:41
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
ISignalPort * m_InCurrentHeading
Current position.
Definition: HeadingPIDController.h:38
ISignalPort * m_InDesiredHeading
Desired position.
Definition: HeadingPIDController.h:40
int m_IErrorIntegral
The relative index of the StatePositionErrorSum state in the state array.
Definition: HeadingPIDController.h:42
HeadingPIDController(const std::string &simObjectName, ISimObjectCreator *const creator)
reads parameters, registers states, input/output ports and shared resources
Simple waypoint object.
Definition: CableAttach.h:16