|
LRAUV
revA
|
The EnvSimulator adds lookup of environmental parameters to the base Simulator class. More...
#include <EnvSimulator.h>


Public Member Functions | |
| EnvSimulator (bool simulateSensors, int nSteps) | |
| Constructor. More... | |
| virtual | ~EnvSimulator () |
| Destructor. More... | |
| virtual void | uninitialize () |
| Uninitialize the simulation. More... | |
Public Member Functions inherited from Simulator | |
| Simulator (bool simulateSensors, int nSteps) | |
| Constructor. More... | |
| virtual | ~Simulator () |
| Destructor. More... | |
| void | initialize (const SimInitStruct &initParams, SimResultStruct &results) |
| Initialize the simulator. More... | |
| void | run (const SimRunStruct &runParams, SimResultStruct &results) |
| Run the simulation. More... | |
| void | motion (float propOmegaAction, float rudderAngleAction, float elevatorAngleAction, float massPositionAction, float buoyancyAction, int dropWeightState, float density, float dt, SimResultStruct &results) |
| The "take one timestep" function for the simulator. More... | |
| long | setLocation (const double &latitude, const double &longitude) |
| Set the current location to the indicated values in radians Returns error code conversion to UTM is unsuccessful. More... | |
| void | setDepth (float depth) |
| Set the current depth to the indicated value. More... | |
| void | setHeading (float heading) |
| Set the current heading to the indicated value. More... | |
| void | setPitch (float pitch) |
| Set the current pitch to the indicated value. More... | |
| void | setRoll (float roll) |
| Set the current roll to the indicated value. More... | |
| void | setPropOmega (float propOmega) |
| Set the current prop omega to the indicated value. More... | |
| void | setRudderAngle (float rudderAngle) |
| Set the current rudder angle to the indicated value. More... | |
| void | setElevatorAngle (float elevatorAngle) |
| Set the current elevator angle to the indicated value. More... | |
| void | setMassPosition (float massPosition) |
| Set the current mass position to the indicated value. More... | |
| void | setBuoyancyPosition (float buoyancyPosition) |
| Set the current mass position to the indicated value. More... | |
Protected Member Functions | |
| virtual void | configureSensors () |
| virtual void | simulateSensors (double latDeg, double lonDeg, SimResultStruct &results) |
| bool | interpolate (const float &time, const float &depth, const float &lat, const float &lon, int &timeIndex, int &depthIndex, int &latIndex, int &lonIndex, int varIndices[4], float varArray[2][2][2][2], NetCdfReader::NetCdfVar *var, float &value) |
| float | twoLineEstimate (const float x, const float y0, const float y1, const float y2, const float x0, const float x1, const float x2) |
| Interpolates a value on two lines, from (x0, y0) to (x1, y1) to (x2, y2) Does not extrapolate – rather, it pins values. More... | |
Protected Member Functions inherited from Simulator | |
| virtual void | publishState (SimResultStruct &results) |
| bool | loadParams (const SimInitStruct &initParams, SimResultStruct &results) |
| Load the hydrodynamic properties from the slate and initialize some variables. More... | |
| void | invertMass (SimResultStruct &results) |
| Calculate the LHS of the equation (the "1/mass" for solving a in ma = F). More... | |
| void | calcForce (Point6D &rate, Point6D &pos, float propOmegaAction, float rudderAngleAction, float elevatorAngleAction, float massPositionAction, float buoyancyAction, int dropWeightState, float density, float dt, float smallDt) |
| Calculate the RHS of the equation (the "force" in ma = F). More... | |
| void | calcFinForces (Point6D &rate, float ruddAngleProj, float elevAngleProj, Point3D finForces[], Point3D finMoments[], float density) |
| Given the vehicle state (rate) and fin angles, computes the forces and moments from the fins in body coords. More... | |
Protected Attributes | |
| NetCdfReader * | netCdfReader_ |
| float * | modelTime_ |
| unsigned int | modelTimeSize_ |
| float * | modelDepth_ |
| unsigned int | modelDepthSize_ |
| float * | modelLatitude_ |
| unsigned int | modelLatitudeSize_ |
| float * | modelLongitude_ |
| unsigned int | modelLongitudeSize_ |
| size of longitude Array More... | |
| NetCdfReader::NetCdfVar * | varSalinity_ |
| NetCdf variable that contains salinity. More... | |
| float | salinityArray_ [2][2][2][2] |
| salinity array data More... | |
| int | salinityIndices_ [4] |
| preserve indices to cut down on NetCDF reads More... | |
| NetCdfReader::NetCdfVar * | varTemperature_ |
| float | temperatureArray_ [2][2][2][2] |
| int | temperatureIndices_ [4] |
| NetCdfReader::NetCdfVar * | varU_ |
| float | uArray_ [2][2][2][2] |
| int | uIndices_ [4] |
| NetCdfReader::NetCdfVar * | varV_ |
| float | vArray_ [2][2][2][2] |
| int | vIndices_ [4] |
Protected Attributes inherited from Simulator | |
| bool | simulateSensors_ |
| indicates whether to simulate sensors (salinity, temp, u, v) More... | |
| Str | oceanModelData_ |
| filename of file that contains ocean model run More... | |
| int | minNSteps_ |
| The simulator actually runs minNSteps_ times per "timestep" (i.e. More... | |
| float | maxDt_ |
| Largest allowable timestep. More... | |
| bool | ok_ |
| indicates whether things are ok to run the simulation More... | |
| ActuatorModel | elevatorModel_ |
| Actuator and thruster models. More... | |
| ActuatorModel | rudderModel_ |
| ActuatorModel | movableMassModel_ |
| ActuatorModel | buoyancyModel_ |
| ThrusterModel | thrusterModel_ |
| Matrix6x6 | massInvert_ |
| Inverse of "mass" matrix. Calculated just once in invertMass() called from initialize() More... | |
| float | netBuoy_ |
| buoyancy force More... | |
| Point6D | force_ |
| 6-dimensional force vector More... | |
| float | propThrust_ |
| Thruster outputs. More... | |
| float | propTorque_ |
| Point6D | pos_ |
| 6-dimensional position vector, body coordinates More... | |
| Point6D | posDot_ |
| Point6D | rate_ |
| 6-dimensional rate vector, earth coordinates More... | |
| Point6D | rateDot_ |
| double | latitude_ |
| UTM zone gathered from initial position. More... | |
| double | longitude_ |
| Point3D | current_ |
| Ocean current (m/s north, east,down) More... | |
| float | northCurrent_ |
| float | eastCurrent_ |
| Static northward current. More... | |
| float | vertCurrent_ |
| Static eastward current. More... | |
| float | magneticVariation_ |
| Static vertical current (positive downward) More... | |
| float | soundSpeed_ |
| float | density_ |
| float | sst_ |
| float | tMixed_ |
| float | t300_ |
| float | sss_ |
| float | sMixed_ |
| float | s300_ |
| float | mixedLayerDepth_ |
| float | defaultDensity_ |
| Default density to use in calculating buoyancy if none is measured. More... | |
| float | buoyancyNeutral_ |
| float | lastDensity_ |
| Last measured density. More... | |
| float | mass_ |
| *-------------—— vehicle parameters --------------------——*/ More... | |
| float | movableMass_ |
| float | volume_ |
| Point3D | cOfMass_ |
| Point3D | cOfMovableMass_ |
| Point3D | cOfBuoy_ |
| Point6D | moment_ |
| float | dropWt1Volume_ |
| float | dropWt1Mass_ |
| float | dropWt1X_ |
| float | dropWt1Y_ |
| float | dropWt1Z_ |
| float | cylinderLength_ |
| float | cylinderRadius_ |
| float | kpDot_ |
| float | mqDot_ |
| float | nrDot_ |
| float | xuDot_ |
| float | yvDot_ |
| float | zwDot_ |
| float | kvDot_ |
| float | mwDot_ |
| float | nvDot_ |
| float | yrDot_ |
| float | ypDot_ |
| float | zqDot_ |
| float | kpabp_ |
| float | mqabq_ |
| float | nrabr_ |
| float | xuabu_ |
| float | yvabv_ |
| float | zwabw_ |
| float | mwabw_ |
| float | nvabv_ |
| float | yrabr_ |
| float | zqabq_ |
| float | muq_ |
| float | muw_ |
| float | mpr_ |
| float | nur_ |
| float | nuv_ |
| float | npq_ |
| float | xvv_ |
| float | xww_ |
| float | xvr_ |
| float | xwq_ |
| float | xrr_ |
| float | xqq_ |
| float | yur_ |
| float | yuv_ |
| float | ywp_ |
| float | zuq_ |
| float | zuw_ |
| float | zvp_ |
| float | kvt2_ |
| float | aspectRatio_ |
| float | stallAngle_ |
| float | finArea_ |
| float | coeffDrag_ |
| float | coeffLift_ |
| Point3D | fins_ [4] |
Private Member Functions | |
| EnvSimulator (const EnvSimulator &old) | |
Additional Inherited Members | |
Protected Types inherited from Simulator | |
| enum | { LO_RUDD, PO_ELEV, UP_RUDD, ST_ELEV } |
| Defines fins. More... | |
The EnvSimulator adds lookup of environmental parameters to the base Simulator class.
| EnvSimulator::EnvSimulator | ( | bool | simulateSensors, |
| int | nSteps | ||
| ) |
Constructor.
References salinityArray_, salinityIndices_, temperatureArray_, temperatureIndices_, uArray_, uIndices_, vArray_, and vIndices_.
|
inlinevirtual |
Destructor.
References uninitialize().
|
private |
|
protectedvirtual |
Reimplemented from Simulator.
References Str::cStr(), NetCdf::findVar(), FlexArray< T >::get(), NetCdf::getDimArray(), modelDepth_, modelDepthSize_, modelLatitude_, modelLatitudeSize_, modelLongitude_, modelLongitudeSize_, modelTime_, modelTimeSize_, NetCdf::NC_FLOAT_TYPE, netCdfReader_, NetCdfReader::NewNetCdfReader(), Simulator::oceanModelData_, NetCdfReader::read1DArray(), varSalinity_, varTemperature_, varU_, and varV_.
|
protected |
References AuvMath::Interpolate3D(), modelDepth_, modelDepthSize_, modelLatitude_, modelLatitudeSize_, modelLongitude_, modelLongitudeSize_, modelTimeSize_, NetCdf::NC_FLOAT_TYPE, netCdfReader_, and NetCdfReader::read4DArray().
Referenced by simulateSensors().
|
protectedvirtual |
Reimplemented from Simulator.
References Simulator::current_, AuvMath::Density(), SimResultStruct::density_, Simulator::density_, AuvMath::FindLtEqIndex(), Point6D::getZ(), interpolate(), Simulator::lastDensity_, SimResultStruct::magneticVariation_, Simulator::magneticVariation_, Simulator::mixedLayerDepth_, modelDepth_, modelDepthSize_, modelLatitude_, modelLatitudeSize_, modelLongitude_, modelLongitudeSize_, modelTime_, modelTimeSize_, netCdfReader_, AuvMath::OceanPressure(), Simulator::pos_, Simulator::s300_, SimResultStruct::salinity_, salinityArray_, salinityIndices_, Point3D::setU(), Point3D::setV(), Point3D::setW(), Simulator::simulateSensors_, Simulator::sMixed_, SimResultStruct::soundSpeed_, Simulator::soundSpeed_, Simulator::sss_, Simulator::sst_, Simulator::t300_, SimResultStruct::temperature_, temperatureArray_, temperatureIndices_, Simulator::tMixed_, twoLineEstimate(), uArray_, uIndices_, vArray_, varSalinity_, varTemperature_, varU_, varV_, Simulator::vertCurrent_, and vIndices_.
|
protected |
Interpolates a value on two lines, from (x0, y0) to (x1, y1) to (x2, y2) Does not extrapolate – rather, it pins values.
References AuvMath::Interpolate1D().
Referenced by simulateSensors().
|
virtual |
Uninitialize the simulation.
Deinitialize.
Reimplemented from Simulator.
References modelDepth_, modelLatitude_, modelLongitude_, modelTime_, and netCdfReader_.
Referenced by ~EnvSimulator().
|
protected |
Referenced by configureSensors(), interpolate(), simulateSensors(), and uninitialize().
|
protected |
Referenced by configureSensors(), interpolate(), and simulateSensors().
|
protected |
Referenced by configureSensors(), interpolate(), simulateSensors(), and uninitialize().
|
protected |
Referenced by configureSensors(), interpolate(), and simulateSensors().
|
protected |
Referenced by configureSensors(), interpolate(), simulateSensors(), and uninitialize().
|
protected |
size of longitude Array
Referenced by configureSensors(), interpolate(), and simulateSensors().
|
protected |
Referenced by configureSensors(), simulateSensors(), and uninitialize().
|
protected |
Referenced by configureSensors(), interpolate(), and simulateSensors().
|
protected |
Referenced by configureSensors(), interpolate(), simulateSensors(), and uninitialize().
|
protected |
salinity array data
Referenced by EnvSimulator(), and simulateSensors().
|
protected |
preserve indices to cut down on NetCDF reads
Referenced by EnvSimulator(), and simulateSensors().
|
protected |
Referenced by EnvSimulator(), and simulateSensors().
|
protected |
Referenced by EnvSimulator(), and simulateSensors().
|
protected |
Referenced by EnvSimulator(), and simulateSensors().
|
protected |
Referenced by EnvSimulator(), and simulateSensors().
|
protected |
Referenced by EnvSimulator(), and simulateSensors().
|
protected |
NetCdf variable that contains salinity.
Referenced by configureSensors(), and simulateSensors().
|
protected |
Referenced by configureSensors(), and simulateSensors().
|
protected |
Referenced by configureSensors(), and simulateSensors().
|
protected |
Referenced by configureSensors(), and simulateSensors().
|
protected |
Referenced by EnvSimulator(), and simulateSensors().