91#include "trawl/subroutines/PidWithExternalState.h"
93#include <fhsim/simobject/SimObject.h>
94#include <fhsim_environment/EnvironmentProvider.h>
95#include <fhsim_environment/SeafloorForcesInterface.h>
104 void OdeFcn(
const double T,
const double*
const X,
double*
const XDot)
const override;
105 void FinalSetup(
const double T,
const double*
const X, ISimObjectCreator*
const creator)
override;
106 void AcceptedStep(
const double T,
const double*
const X)
override;
108#ifdef FH_VISUALIZATION
109 void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
110 void RenderUpdate(
const double T,
const double*
const X);
124 double Mass(
const double*
const X)
const;
135 double bottomForceError;
141 const double* OutPos(
const double T,
const double*
const X,
const int index);
142 const double* OutVel(
const double T,
const double*
const X,
const int index);
143 const double* OutLift(
const double T,
const double*
const X);
144 const double* OutDrag(
const double T,
const double*
const X);
145 const double* OutWeight(
const double T,
const double*
const X);
146 const double* OutBottomContact(
const double T,
const double*
const X);
161 environment::SeafloorForcesInterface* m_seafloorForces =
nullptr;
162 environment::EnvironmentProvider* m_environment =
nullptr;
164 std::vector<ISignalPort*> m_inForces;
165 ISignalPort* m_inDistanceGoal;
166 ISignalPort* m_inDistance;
172 int m_IStateIntegratedSpreadError;
179 double m_outLift = 0.0;
180 double m_outDrag = 0.0;
181 double m_outWeight = 0.0;
182 double m_outBottomContact = 0.0;
184#ifdef FH_VISUALIZATION
185 Ogre::SceneNode* m_renderNode =
nullptr;
PID controller for use inside a SimObject, whose integral is a state that FhSim integrates.
Definition PidWithExternalState.h:44
Definition TrawlDoorControlledLift.h:100
ISignalPort * m_inMassGoal
With WeightModel::Mass.
Definition TrawlDoorControlledLift.h:168
double m_mass
The mass [kg], with WeightModel::Controlled.
Definition TrawlDoorControlledLift.h:154
double m_massMax
The largest mass [kg], with WeightModel::Mass.
Definition TrawlDoorControlledLift.h:156
double m_massMin
The smallest mass [kg], with WeightModel::Mass.
Definition TrawlDoorControlledLift.h:155
PidWithExternalState m_weightController
Weight from the bottom force error.
Definition TrawlDoorControlledLift.h:177
double Mass(const double *const X) const
The mass at X [kg]: the mass state, or the fixed mass.
int m_IStateMass
With WeightModel::Mass.
Definition TrawlDoorControlledLift.h:174
ISignalPort * m_inBottomForceGoal
With WeightModel::Controlled.
Definition TrawlDoorControlledLift.h:167
bool ResolvedForRead(const char *port)
False, after reporting the read of output port port through FhSim, while FinalSetup has not resolved ...
double m_liftDragRatio
Lift divided by drag.
Definition TrawlDoorControlledLift.h:157
bool m_isPort
Is this the port door?
Definition TrawlDoorControlledLift.h:152
double m_size
The diameter of the contact sphere [m].
Definition TrawlDoorControlledLift.h:158
PidWithExternalState m_distanceController
Lift from the spread error.
Definition TrawlDoorControlledLift.h:176
Loads ComputeLoads(const double T, const double *const X) const
The loads at (T, X).
ISimObjectCreator * m_creator
Reports a read before FinalSetup; owned by FhSim.
Definition TrawlDoorControlledLift.h:160
WeightModel
What sets the door's weight in water.
Definition TrawlDoorControlledLift.h:116
@ Controlled
A PID controller on the bottom force error (this class).
@ Mass
A mass state that follows MassGoal (Trawl/TrawlDoorControlledLiftAndMass).
int m_IStateIntegratedBottomForceError
With WeightModel::Controlled.
Definition TrawlDoorControlledLift.h:173
bool m_useWidthMeasurement
Is Distance a measured width, rather than a reference position?
Definition TrawlDoorControlledLift.h:153
WeightModel m_weightModel
What sets the weight.
Definition TrawlDoorControlledLift.h:151
The forces and controller errors at one time and state.
Definition TrawlDoorControlledLift.h:128