106#include "sfh/filters/FIR.h"
109#include <fhsim/simobject/SimObject.h>
119 void OdeFcn(
const double T,
const double*
const X,
double*
const XDot)
const override;
120 void InitialConditionSetup(
const double T,
const double*
const currentIC,
double*
const updatedIC, ISimObjectCreator*
const creator)
override;
121 void AcceptedStep(
const double T,
const double*
const X)
override;
123#ifdef FH_VISUALIZATION
124 void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator) { }
125 void RenderUpdate(
const double T,
const double*
const X) { }
136 const double* GetValue() {
return m_filter.GetValue(); }
139 sfh::filters::FIR m_filter;
140 double m_updatePeriod;
141 double m_lastUpdate = 0.0;
142 bool m_hasUpdate =
false;
149 std::vector<double>
WarpsTooLong(
const double T,
const double*
const X)
const;
154 const double* OutWarpLength(
const double T,
const double*
const X,
const int index);
155 const double* OutNetWidth(
const double T,
const double*
const X,
const int index);
156 const double* OutMinBottomContact(
const double T,
const double*
const X);
158 std::vector<ISignalPort*> m_inNetPortPos;
159 std::vector<ISignalPort*> m_inNetStbPos;
160 std::vector<ISignalPort*> m_inBottomContact;
161 ISignalPort* m_inWarpLength =
nullptr;
162 ISignalPort* m_inExternalEnable =
nullptr;
163 std::unique_ptr<RateLimitedFIR> m_bottomContactFilter;
167 int m_numBottomContactMeasurements;
168 bool m_controlBottomContact;
169 double m_initialWarpLength = 0.0;
170 double m_minBottomContactGoal;
171 double m_sinkTimeConstant;
172 double m_controllerMaxSpeedDepth;
173 double m_controllerMaxSpeedGeometry;
174 double m_controllerConstant;
175 double m_controllerDamping;
176 int m_indexStateWarpLength;
179 bool m_hasLastStep =
false;
180 double m_lastTime = 0.0;
181 double m_minBottomContact = 0.0;
182 double m_lastBottomContactError = 0.0;
184 double m_lastBottomContactUpdate = 0.0;
185 bool m_hasBottomContactUpdate =
false;
186 std::vector<double> m_lastWarpTooLong;
187 bool m_hasTravelReference =
false;
191 double m_outNetWidth = 0.0;
A FIR filter fed at a fixed period, whatever the step length.
Definition TrawlGeometryController.h:131
bool AddMeasurement(const double measurement[], double time)
Adds measurement once per update period since the last update (once, on the first call); true if it a...
Definition TrawlGeometryController.h:115
std::array< double, 2 > MeanWingPosition(const double T, const double *const X) const
The mean horizontal wing position of all nets.
std::vector< double > WarpsTooLong(const double T, const double *const X) const
How much too long each warp is, from the starboard lead of each net along the direction of travel [m]...
double m_bottomContactErrorRate
Between the last two filter updates [m/s].
Definition TrawlGeometryController.h:183
std::array< double, 2 > m_travelDirection
Unit vector, or zero before the first 1 m of travel.
Definition TrawlGeometryController.h:189
double BottomContactError() const
The bottom contact error of the last accepted step, as an equivalent warp length [m].
std::array< double, 2 > m_travelReference
The mean wing position the travel is measured from.
Definition TrawlGeometryController.h:188