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);
157 environment::SeafloorForcesInterface* m_seafloorForces =
nullptr;
158 environment::EnvironmentProvider* m_environment =
nullptr;
160 std::vector<ISignalPort*> m_inForces;
161 ISignalPort* m_inDistanceGoal;
162 ISignalPort* m_inDistance;
168 int m_IStateIntegratedSpreadError;
175 double m_outLift = 0.0;
176 double m_outDrag = 0.0;
177 double m_outWeight = 0.0;
178 double m_outBottomContact = 0.0;
180#ifdef FH_VISUALIZATION
181 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:164
double m_mass
The mass [kg], with WeightModel::Controlled.
Definition TrawlDoorControlledLift.h:151
double m_massMax
The largest mass [kg], with WeightModel::Mass.
Definition TrawlDoorControlledLift.h:153
double m_massMin
The smallest mass [kg], with WeightModel::Mass.
Definition TrawlDoorControlledLift.h:152
PidWithExternalState m_weightController
Weight from the bottom force error.
Definition TrawlDoorControlledLift.h:173
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:170
ISignalPort * m_inBottomForceGoal
With WeightModel::Controlled.
Definition TrawlDoorControlledLift.h:163
double m_liftDragRatio
Lift divided by drag.
Definition TrawlDoorControlledLift.h:154
bool m_isPort
Is this the port door?
Definition TrawlDoorControlledLift.h:149
double m_size
The diameter of the contact sphere [m].
Definition TrawlDoorControlledLift.h:155
PidWithExternalState m_distanceController
Lift from the spread error.
Definition TrawlDoorControlledLift.h:172
Loads ComputeLoads(const double T, const double *const X) const
The loads at (T, X).
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:169
bool m_useWidthMeasurement
Is Distance a measured width, rather than a reference position?
Definition TrawlDoorControlledLift.h:150
WeightModel m_weightModel
What sets the weight.
Definition TrawlDoorControlledLift.h:148
The forces and controller errors at one time and state.
Definition TrawlDoorControlledLift.h:128