Marine systems simulation
WaypointRefGen.h
1#pragma once
2
10#include <Eigen/Eigen>
11#include <SimObject.h>
12#ifdef FH_VISUALIZATION
13#pragma warning(push)
14#pragma warning( disable : 4251 )
15 #include <Ogre.h>
16#pragma warning(pop)
17#endif
18#include "Waypoint.h"
19using namespace Eigen;
20
21
22namespace Ship{
23 class WaypointRefGen : public SimObject
24 {
25 public:
26 EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
27 WaypointRefGen(const std::string& simObjectName, ISimObjectCreator* const creator);
29 const double* DesiredQuaternion(const double T, const double* const X);
30 const double* DesiredHeading(const double T, const double* const X);
31 const double* DesiredHeadingRate(const double T, const double* const X);
32 const double* CrossTrackError(const double T, const double* const X);
33 const double* DesiredPosition(const double T,const double* const X);
34 const double* DesiredSpeed(const double T,const double* const X);
35 void OdeFcn(const double T, const double *const X,double *const ,const bool){}
36 void FinalSetup(const double T,const double* const X, ISimObjectCreator* const creator);
37 void Compute(const double T,const double* const X);
38
39 #ifdef FH_VISUALIZATION
40 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
41 void RenderUpdate(const double T, const double* const X);
42 #endif
43
44
45 private:
46 ISignalPort* m_adStatePositionPort;
47 ISignalPort* m_adStateVelocityPort;
48 ICommonComputation *m_Compute;
49
50 Waypoint* m_aWPList;
51
52 Eigen::Vector3d m_adStatePosition;
53 Eigen::Vector3d m_adStateVelocity;
54 Eigen::Vector3d m_adStateVelocity_Desired;
55
56 std::string sideslipCompensation;
57
58 double initialPosition[3];
59 double* pK;
60 double desiredHeading;
61 double desiredHeadingRate;
62 double crosstrackError;
63 double m_dLookaheadDistance;
64 double m_lookahead;
65 double m_dSideSlipAngle;
66 double alphaK;
67 double m_adStateTheta_Desired[4];
68 double desiredPosition[3];
69 double m_desiredSpeed;
70 int numberOfPoints;
71
72 int iCurrentWaypointNumber;
73
74 double* waypoint_n;
75 double* waypoint_e;
76 double* waypoint_d;
77 double* waypoint_r;
78 double* waypoint_leg_speed;
79 double m_sectionType;
80
81 Eigen::Vector3d* legstart;
82 Eigen::Vector3d* legend;
83 Eigen::Vector3d* circle_center;
84 double* circle_radius;
85
86 #ifdef FH_VISUALIZATION
87 Ogre::SceneNode** m_wpNodes;
88 Ogre::SceneNode** m_legNodes;
89
90 Ogre::SceneNode** m_turnNodes;
91 Ogre::SceneNode** m_circNodes;
92
93 Ogre::SceneNode* m_LOSNode;
94 Ogre::SceneNode* m_TargetPointNode;
95
96 Ogre::ManualObject* sigth;
97 #endif
98 };
99}
Definition: WaypointRefGen.h:24
WaypointRefGen(const std::string &simObjectName, ISimObjectCreator *const creator)
reads parameters, registers states, input/output ports and shared resources
Definition: Waypoint.h:16
Simple waypoint object.
Definition: CableAttach.h:16