|
LRAUV
revA
|
A simulator "evolved" from the Altex and Odyssey sims. More...
#include <Simulator.h>


Public Member Functions | |
| 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... | |
| virtual void | uninitialize () |
| Uninitialize 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 Types | |
| enum | { LO_RUDD, PO_ELEV, UP_RUDD, ST_ELEV } |
| Defines fins. More... | |
Protected Member Functions | |
| virtual void | publishState (SimResultStruct &results) |
| virtual void | configureSensors () |
| virtual void | simulateSensors (double latDeg, double lonDeg, 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 | |
| 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 | |
| Simulator (const Simulator &old) | |
A simulator "evolved" from the Altex and Odyssey sims.
The Simulator starts with the Odyssey and Altex simulation code but takes greater liberties to make the code easier to use (i.e. using matrix math libraries...)
All three simulators are very similar. All use an iterative fourth-order Runge-Kutta method (see Simulator::motion for more details) to solve (F = ma) where F are the various hydrodynamic forces on the vehicle (body drag, fins, thrust, etc). m is the "mass" of the vehicle including its actual mass as well as added mass terms to account for its shape. The state variable "a" (or more appropriately vdot) includes all three linear accelerations and all three angular accelerations.
The core state of the vehicle then (called "rate" and "pos" for most of the code) is the three linear velocities and three angular rates, plus the three cardinal axes (x,y,z) and three angles.
The function Simulator::invertMass() is responsible for generating the inverse mass matrix and is called once at initialization.
The functions Simulator::motion() performs one "step" of the simulation, running the R-K method once. It calls Simulator::calcForce() to calculate the forces on the vehicle, which in turn calls Simulator::calcFinForces() to calculate forces and moments from the fins. Small encapsulation classes (rudderModel_, elevatorModel_, thrusterModel_)are used to abstract away some of the simulated qualities (backlash, delay) of the fins and thruster.
| Simulator::Simulator | ( | bool | simulateSensors, |
| int | nSteps | ||
| ) |
Constructor.
|
virtual |
Destructor.
References uninitialize().
|
private |
|
protected |
Given the vehicle state (rate) and fin angles, computes the forces and moments from the fins in body coords.
Calculates the forces and moments on the vehicle from the fins (in vehicle body frame).
| rate | The "force/moment" state vector |
| ruddAngleProj | The rudder angle |
| elevAngleProj | The elevator angle |
| finForces | The calculated fin forces (will be resized to 3 x 4) |
| finMoments | The calculated fin moments (will be resized to 3 x 4) |
| density | Density of seawater in kg/m3 Original comment: pre>
|
References aspectRatio_, coeffDrag_, coeffLift_, EFF_FACTOR, finArea_, fins_, Point6D::getP(), Point6D::getQ(), Point6D::getR(), Point3D::getU(), Point6D::getU(), Point3D::getV(), Point6D::getV(), Point3D::getW(), Point6D::getW(), LO_RUDD, PO_ELEV, Point3D::setU(), Point3D::setV(), Point3D::setW(), Point3D::setX(), Point3D::setY(), Point3D::setZ(), ST_ELEV, stallAngle_, and UP_RUDD.
Referenced by calcForce().
|
protected |
Calculate the RHS of the equation (the "force" in ma = F).
Generates the "force" matrix in the "F=Ma".
Sums the various hydrodynamic forces acting on the vehicle (including various body lifts and drags, as well as forces from the prop (thrust, torque) and forces from the fins (drag and turning moments).
Original Comment:
------------------------------------------------------------------------- Subroutine calcForce() gets the right-hand sides of the dynamic equations. -------------------------------------------------------------------------
References buoyancyModel_, buoyancyNeutral_, calcFinForces(), cOfBuoy_, cOfMass_, cOfMovableMass_, cylinderLength_, cylinderRadius_, dropWt1Mass_, dropWt1Volume_, dropWt1X_, dropWt1Y_, dropWt1Z_, elevatorModel_, fins_, force_, ActuatorModel::getCurrent(), Point6D::getHeading(), Point6D::getP(), Point6D::getPitch(), Point6D::getQ(), Point6D::getR(), Point6D::getRoll(), Point6D::getU(), Point6D::getV(), Point6D::getW(), Point3D::getX(), Point6D::getX(), Point3D::getY(), Point6D::getY(), Point3D::getZ(), Point6D::getZ(), kpabp_, kvt2_, LO_RUDD, mass_, moment_, movableMass_, mpr_, mqabq_, muq_, muw_, mwabw_, netBuoy_, npq_, nrabr_, nur_, nuv_, nvabv_, PO_ELEV, ThrusterModel::project(), ActuatorModel::project(), propThrust_, propTorque_, rudderModel_, Point6D::setHeading(), Point6D::setPitch(), Point6D::setRoll(), Point3D::setX(), Point6D::setX(), Point3D::setY(), Point6D::setY(), Point3D::setZ(), Point6D::setZ(), ST_ELEV, thrusterModel_, UP_RUDD, volume_, xqq_, xrr_, xuabu_, xvr_, xvv_, xwq_, xww_, yrabr_, yur_, yuv_, yvabv_, ywp_, zqabq_, zuq_, zuw_, zvp_, and zwabw_.
Referenced by motion().
|
inlineprotectedvirtual |
Reimplemented in EnvSimulator.
Referenced by initialize().
| void Simulator::initialize | ( | const SimInitStruct & | initParams, |
| SimResultStruct & | results | ||
| ) |
Initialize the simulator.
Initialize.
References configureSensors(), Str::EMPTY_STR, SimResultStruct::errorMessage_, invertMass(), loadParams(), oceanModelData_, ok_, publishState(), and simulateSensors_.
Referenced by InternalSim::initialize(), NavigationSim::initialize(), and SimDaemon::ServiceClient().
|
protected |
Calculate the LHS of the equation (the "1/mass" for solving a in ma = F).
Produces the "mass" matrix in the "F = Ma" ODEs describing the vehicle dynamics.
As long as the vehicle mass is constant, this only needs to be calculated once (though the simulator does not recalculate if a dropweight is dropped). The inversion (necessary to solve "a = M^-1 A") is also done in this function.
Converted and tested 28/6/07 AMM
The A matrix is assembled as
References cOfMass_, Matrix6x6::determinantZero(), SimResultStruct::errorMessage_, Point6D::getHeading(), Point6D::getPitch(), Point6D::getRoll(), Point3D::getX(), Point6D::getX(), Point3D::getY(), Point6D::getY(), Point3D::getZ(), Point6D::getZ(), Matrix6x6::invert(), kpDot_, kvDot_, mass_, massInvert_, moment_, mqDot_, mwDot_, nrDot_, nvDot_, xuDot_, ypDot_, yrDot_, yvDot_, zqDot_, and zwDot_.
Referenced by initialize().
|
protected |
Load the hydrodynamic properties from the slate and initialize some variables.
Load simulator parameters.
References SimInitStruct::aspectRatio_, aspectRatio_, SimInitStruct::buoyancyHystCenter_, SimInitStruct::buoyancyHystWidth_, buoyancyModel_, SimInitStruct::buoyancyNeutral_, buoyancyNeutral_, SimInitStruct::buoyancySpeed_, SimInitStruct::centerOfBuoyX_, SimInitStruct::centerOfBuoyY_, SimInitStruct::centerOfBuoyZ_, SimInitStruct::centerOfMassX_, SimInitStruct::centerOfMassY_, SimInitStruct::centerOfMassZ_, SimInitStruct::centerOfMovableMassX_, SimInitStruct::centerOfMovableMassY_, SimInitStruct::centerOfMovableMassZ_, SimInitStruct::coeffDrag_, coeffDrag_, SimInitStruct::coeffLift_, coeffLift_, cOfBuoy_, cOfMass_, cOfMovableMass_, SimInitStruct::cylinderLength_, cylinderLength_, SimInitStruct::cylinderRadius_, cylinderRadius_, D2R, SimInitStruct::defaultDensity_, defaultDensity_, SimInitStruct::density_, density_, SimInitStruct::designOmega_, SimInitStruct::designPropEff_, SimInitStruct::designSpeed_, SimInitStruct::designThrust_, SimInitStruct::designTorque_, SimInitStruct::dropWt1Mass_, dropWt1Mass_, SimInitStruct::dropWt1Volume_, dropWt1Volume_, SimInitStruct::dropWt1X_, dropWt1X_, SimInitStruct::dropWt1Y_, dropWt1Y_, SimInitStruct::dropWt1Z_, dropWt1Z_, SimInitStruct::eastCurrent_, eastCurrent_, SimInitStruct::elevatorHystCenter_, SimInitStruct::elevatorHystWidth_, elevatorModel_, SimInitStruct::elevatorSpeed_, SimInitStruct::finArea_, finArea_, fins_, SimInitStruct::initBuoyancyPosition_, SimInitStruct::initHeading_, ThrusterModel::initialize(), SimInitStruct::initLat_, SimInitStruct::initLon_, SimInitStruct::initMassPosition_, SimInitStruct::initP_, SimInitStruct::initPitch_, SimInitStruct::initQ_, SimInitStruct::initR_, SimInitStruct::initRoll_, SimInitStruct::initU_, SimInitStruct::initV_, SimInitStruct::initW_, SimInitStruct::initZ_, SimInitStruct::kpabp_, kpabp_, SimInitStruct::kpDot_, kpDot_, SimInitStruct::kvDot_, kvDot_, SimInitStruct::kvt2_, kvt2_, latitude_, LO_RUDD, longitude_, SimInitStruct::lowerRudX_, SimInitStruct::lowerRudY_, SimInitStruct::lowerRudZ_, SimInitStruct::magneticVariation_, magneticVariation_, SimInitStruct::mass_, mass_, mixedLayerDepth_, moment_, SimInitStruct::momentXX_, SimInitStruct::momentYY_, SimInitStruct::momentZZ_, SimInitStruct::movableMass_, movableMass_, SimInitStruct::movableMassHystCenter_, SimInitStruct::movableMassHystWidth_, movableMassModel_, SimInitStruct::movableMassSpeed_, SimInitStruct::mpr_, mpr_, SimInitStruct::mqabq_, mqabq_, SimInitStruct::mqDot_, mqDot_, SimInitStruct::muq_, muq_, SimInitStruct::muw_, muw_, SimInitStruct::mwabw_, mwabw_, SimInitStruct::mwDot_, mwDot_, SimInitStruct::northCurrent_, northCurrent_, SimInitStruct::npq_, npq_, SimInitStruct::nrabr_, nrabr_, SimInitStruct::nrDot_, nrDot_, SimInitStruct::nur_, nur_, SimInitStruct::nuv_, nuv_, SimInitStruct::nvabv_, nvabv_, SimInitStruct::nvDot_, nvDot_, SimInitStruct::oceanModelData_, oceanModelData_, PO_ELEV, SimInitStruct::portElevX_, SimInitStruct::portElevY_, SimInitStruct::portElevZ_, pos_, rate_, SimInitStruct::rudderHystCenter_, SimInitStruct::rudderHystWidth_, rudderModel_, SimInitStruct::rudderSpeed_, SimInitStruct::s300_, s300_, Point6D::setHeading(), ActuatorModel::setHyst(), Point6D::setP(), Point6D::setPitch(), ActuatorModel::setPrevious(), Point6D::setQ(), Point6D::setR(), Point6D::setRoll(), ActuatorModel::setSpeed(), Point6D::setU(), Point6D::setV(), Point6D::setW(), Point3D::setX(), Point6D::setX(), Point3D::setY(), Point6D::setY(), Point3D::setZ(), Point6D::setZ(), SimInitStruct::sMixed_, sMixed_, SimInitStruct::soundSpeed_, soundSpeed_, SimInitStruct::sss_, sss_, SimInitStruct::sst_, sst_, ST_ELEV, SimInitStruct::stallAngle_, stallAngle_, SimInitStruct::stbdElevX_, SimInitStruct::stbdElevY_, SimInitStruct::stbdElevZ_, SimInitStruct::t300_, t300_, thrusterModel_, SimInitStruct::tMixed_, tMixed_, UP_RUDD, SimInitStruct::upperRudX_, SimInitStruct::upperRudY_, SimInitStruct::upperRudZ_, SimInitStruct::vertCurrent_, vertCurrent_, SimInitStruct::volume_, volume_, SimInitStruct::xqq_, xqq_, SimInitStruct::xrr_, xrr_, SimInitStruct::xuabu_, xuabu_, SimInitStruct::xuDot_, xuDot_, SimInitStruct::xvr_, xvr_, SimInitStruct::xvv_, xvv_, SimInitStruct::xwq_, xwq_, SimInitStruct::xww_, xww_, SimInitStruct::ypDot_, ypDot_, SimInitStruct::yrabr_, yrabr_, SimInitStruct::yrDot_, yrDot_, SimInitStruct::yur_, yur_, SimInitStruct::yuv_, yuv_, SimInitStruct::yvabv_, yvabv_, SimInitStruct::yvDot_, yvDot_, SimInitStruct::ywp_, ywp_, SimInitStruct::zqabq_, zqabq_, SimInitStruct::zqDot_, zqDot_, SimInitStruct::zuq_, zuq_, SimInitStruct::zuw_, zuw_, SimInitStruct::zvp_, zvp_, SimInitStruct::zwabw_, zwabw_, SimInitStruct::zwDot_, and zwDot_.
Referenced by initialize().
| void Simulator::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.
As with others member functions, motionAlternate is a rewritten form using the newmat Matrix library.
motion is a port performing as few changes as necessary.
| propOmegaAction | commanded prop rotation rate (rad/sec) |
| rudderAngleAction | Position of rudders (fins 1 and 3) in radians. |
| elevatorAngleAction | Position of elevators (fins 2 and 4) in radians. |
| massPositionAction | Position of movable mass in meters. |
| buoyancyAction | Position of buoyancy engine in cubic meters. |
| dropWeightState | True if drop weight intact |
| density | Density of sea water in kg/m3. |
| dt | Time step |
| results | struct for providing feedback |
As a side note, the fourth order Runge-Kutta method (from http://en.wikipedia.org/wiki/Runge-Kutta) is an iterative method for solving ODEs. Given an initial value problem
Then the fourth order Runge-Kutta solution is:
Where
Original comment:
Subroutine motion() uses 4th-order Runge-Kutta method. Variables are:
edot(1) edot(2) edot(3) edot(4) edot(5) edot(6)
] ] ] ] ] ]
udot vdot wdot pdot qdot rdot rate.getU() rate.getV() rate.getW() rate.getP() rate.getQ() rate.getR()
u v w p q r
xDot yDot zDot rollDot pitchDot yawDot pos.getX() pos.getY() pos.getZ() pos.getRoll() pos.getPitch() pos.getHeading()
x y z phi theta psi
roll pitch yaw
References Point6D::absSum(), Point6D::addProduct(), ThrusterModel::advance(), ActuatorModel::advance(), buoyancyModel_, calcForce(), Str::cStr(), current_, dt, elevatorModel_, SimResultStruct::errorMessage_, force_, Point6D::getX(), massInvert_, movableMassModel_, pos_, posDot_, rate_, rateDot_, rudderModel_, thrusterModel_, and Point6D::toString().
Referenced by run().
|
protectedvirtual |
References Location::AtBearing(), buoyancyModel_, SimResultStruct::buoyancyPosition_, current_, ThrusterModel::currentPropOmega(), SimResultStruct::depth_, SimResultStruct::eastCurrent_, eastCurrent_, SimResultStruct::elevatorAngle_, elevatorModel_, force_, SimResultStruct::forceX_, SimResultStruct::forceY_, SimResultStruct::forceZ_, ActuatorModel::getCurrent(), Point6D::getHeading(), Point6D::getP(), Point6D::getPitch(), Point6D::getQ(), Point6D::getR(), Point6D::getRoll(), Point3D::getU(), Point6D::getU(), Point3D::getV(), Point6D::getV(), Point3D::getW(), Point6D::getW(), Point6D::getX(), Point6D::getY(), Point6D::getZ(), SimResultStruct::heading_, latitude_, SimResultStruct::latitudeDeg_, longitude_, SimResultStruct::longitudeDeg_, SimResultStruct::massPosition_, movableMassModel_, SimResultStruct::netBuoy_, netBuoy_, SimResultStruct::northCurrent_, northCurrent_, SimResultStruct::northernHemi_, SimResultStruct::pitch_, pos_, posDot_, SimResultStruct::posHeading_, SimResultStruct::posPitch_, SimResultStruct::posRoll_, SimResultStruct::posX_, SimResultStruct::posXDot_, SimResultStruct::posY_, SimResultStruct::posYDot_, SimResultStruct::posZ_, SimResultStruct::posZDot_, SimResultStruct::propOmega_, SimResultStruct::propThrust_, propThrust_, SimResultStruct::propTorque_, propTorque_, R2D, rate_, SimResultStruct::rateP_, SimResultStruct::rateQ_, SimResultStruct::rateR_, SimResultStruct::rateU_, SimResultStruct::rateV_, SimResultStruct::rateW_, SimResultStruct::roll_, SimResultStruct::rudderAngle_, rudderModel_, Point3D::setU(), Point3D::setV(), Point6D::setX(), Point6D::setY(), simulateSensors(), SimResultStruct::speed_, thrusterModel_, SimResultStruct::utmZone_, and SimResultStruct::vertCurrent_.
Referenced by initialize(), and run().
| void Simulator::run | ( | const SimRunStruct & | runParams, |
| SimResultStruct & | results | ||
| ) |
Run the simulation.
Run.
References SimRunStruct::buoyancyAction_, buoyancyModel_, SimRunStruct::buoyancyPosition_, ThrusterModel::currentPropOmega(), defaultDensity_, SimRunStruct::density_, SimRunStruct::dropWeightState_, dt, SimRunStruct::dt_, SimRunStruct::elevatorAngle_, SimRunStruct::elevatorAngleAction_, elevatorModel_, SimResultStruct::errorMessage_, ActuatorModel::getCurrent(), Point6D::getHeading(), lastDensity_, SimRunStruct::massPosition_, SimRunStruct::massPositionAction_, MAX, maxDt_, minNSteps_, AuvMath::ModPi(), motion(), movableMassModel_, ok_, pos_, SimRunStruct::propOmega_, SimRunStruct::propOmegaAction_, publishState(), SimRunStruct::rudderAngle_, SimRunStruct::rudderAngleAction_, rudderModel_, setBuoyancyPosition(), ActuatorModel::setCommand(), setElevatorAngle(), Point6D::setHeading(), setMassPosition(), setPropOmega(), setRudderAngle(), and thrusterModel_.
Referenced by InternalSim::run(), NavigationSim::run(), and SimDaemon::ServiceClient().
| void Simulator::setBuoyancyPosition | ( | float | buoyancyPosition | ) |
Set the current mass position to the indicated value.
Set the base buoyancy position to the indicated value.
References buoyancyModel_, and ActuatorModel::setPrevious().
Referenced by run().
| void Simulator::setDepth | ( | float | depth | ) |
Set the current depth to the indicated value.
References pos_, and Point6D::setZ().
Referenced by InternalSim::run(), and NavigationSim::run().
| void Simulator::setElevatorAngle | ( | float | elevatorAngle | ) |
Set the current elevator angle to the indicated value.
Set the base elevator angle to the indicated value.
References elevatorModel_, and ActuatorModel::setPrevious().
Referenced by run().
| void Simulator::setHeading | ( | float | heading | ) |
Set the current heading to the indicated value.
References pos_, and Point6D::setHeading().
Referenced by InternalSim::run(), and NavigationSim::run().
| long Simulator::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.
Set the current location to the indicated value Returns error code conversion to UTM is unsuccessful.
Otherwise returns 0. Use Wgs84::UtmErrorToString( error ) to decode the error (from Datum.h).
Otherwise returns 0. Use Wgs84::UtmErrorToString( error ) to decode the error.
References latitude_, and longitude_.
Referenced by InternalSim::run(), and NavigationSim::run().
| void Simulator::setMassPosition | ( | float | massPosition | ) |
Set the current mass position to the indicated value.
Set the base mass position to the indicated value.
References movableMassModel_, and ActuatorModel::setPrevious().
Referenced by run().
| void Simulator::setPitch | ( | float | pitch | ) |
Set the current pitch to the indicated value.
References pos_, and Point6D::setPitch().
Referenced by InternalSim::run(), and NavigationSim::run().
| void Simulator::setPropOmega | ( | float | propOmega | ) |
Set the current prop omega to the indicated value.
Set the base prop omega to the indicated value.
References ThrusterModel::setPrevious(), and thrusterModel_.
Referenced by run().
| void Simulator::setRoll | ( | float | roll | ) |
Set the current roll to the indicated value.
References pos_, and Point6D::setRoll().
Referenced by InternalSim::run(), and NavigationSim::run().
| void Simulator::setRudderAngle | ( | float | rudderAngle | ) |
Set the current rudder angle to the indicated value.
Set the base rudder angle to the indicated value.
References rudderModel_, and ActuatorModel::setPrevious().
Referenced by run().
|
inlineprotectedvirtual |
Reimplemented in EnvSimulator.
Referenced by publishState().
|
inlinevirtual |
|
protected |
Referenced by calcFinForces(), and loadParams().
|
protected |
Referenced by calcForce(), loadParams(), motion(), publishState(), run(), and setBuoyancyPosition().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcFinForces(), and loadParams().
|
protected |
Referenced by calcFinForces(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), invertMass(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Ocean current (m/s north, east,down)
Referenced by motion(), publishState(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Default density to use in calculating buoyancy if none is measured.
Referenced by loadParams(), and run().
|
protected |
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Static northward current.
Referenced by loadParams(), and publishState().
|
protected |
Actuator and thruster models.
Referenced by calcForce(), loadParams(), motion(), publishState(), run(), and setElevatorAngle().
|
protected |
Referenced by calcFinForces(), and loadParams().
|
protected |
Referenced by calcFinForces(), calcForce(), and loadParams().
|
protected |
6-dimensional force vector
Referenced by calcForce(), motion(), and publishState().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Last measured density.
Referenced by run(), and EnvSimulator::simulateSensors().
|
protected |
UTM zone gathered from initial position.
Referenced by loadParams(), publishState(), and setLocation().
|
protected |
Referenced by loadParams(), publishState(), and setLocation().
|
protected |
Static vertical current (positive downward)
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
*-------------—— vehicle parameters --------------------——*/
Referenced by calcForce(), invertMass(), and loadParams().
|
protected |
Inverse of "mass" matrix. Calculated just once in invertMass() called from initialize()
Referenced by invertMass(), and motion().
|
protected |
Largest allowable timestep.
Referenced by run().
|
protected |
The simulator actually runs minNSteps_ times per "timestep" (i.e.
if the control thread runs at 5Hz, the sim runs at 50Hz if nSteps = 10
Referenced by run().
|
protected |
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by calcForce(), invertMass(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by loadParams(), motion(), publishState(), run(), and setMassPosition().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
buoyancy force
Referenced by calcForce(), and publishState().
|
protected |
Referenced by loadParams(), and publishState().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
filename of file that contains ocean model run
Referenced by EnvSimulator::configureSensors(), initialize(), and loadParams().
|
protected |
indicates whether things are ok to run the simulation
Referenced by initialize(), and run().
|
protected |
6-dimensional position vector, body coordinates
Referenced by loadParams(), motion(), publishState(), run(), setDepth(), setHeading(), setPitch(), setRoll(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by motion(), and publishState().
|
protected |
Thruster outputs.
Referenced by calcForce(), and publishState().
|
protected |
Referenced by calcForce(), and publishState().
|
protected |
6-dimensional rate vector, earth coordinates
Referenced by loadParams(), motion(), and publishState().
|
protected |
Referenced by calcForce(), loadParams(), motion(), publishState(), run(), and setRudderAngle().
|
protected |
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
indicates whether to simulate sensors (salinity, temp, u, v)
Referenced by initialize(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by calcFinForces(), and loadParams().
|
protected |
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by calcForce(), loadParams(), motion(), publishState(), run(), and setPropOmega().
|
protected |
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
Static eastward current.
Referenced by loadParams(), and EnvSimulator::simulateSensors().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by calcForce(), and loadParams().
|
protected |
Referenced by invertMass(), and loadParams().