
#include <BeoSub/BeoSubSim.H>
Inheritance diagram for BeoSubSim:


BeoSub is an autonomous visually-guided submarine. This class implements the high-level functionality, relying on low-level drivers to handle motor activation, compass reading, etc
Definition at line 55 of file BeoSubSim.H.
Public Member Functions | |
| void | updateCompass (const Angle heading, const Angle pitch, const Angle roll) |
| Update compass - used by sensors. | |
| void | updateDepth (const float depth) |
| Update depth - used by sensors. | |
| void | updatePosition (const float z, const float x) |
| Update position. | |
| float | getCurrentZ () |
| float | getCurrentX () |
| float | getRelDist () |
| bool | isStrafing () |
| void | setStrafing (const bool s=false) |
| void | setUpGrabFlag (const bool s=false) |
| bool | getUpGrabFlag () |
| void | setDownGrabFlag (const bool s=false) |
| bool | getDownGrabFlag () |
| void | setFrontGrabFlag (const bool s=false) |
| bool | getFrontGrabFlag () |
| void | useDepthPID (const bool useit) |
| Turn depth PID on/off. | |
| void | useHeadingPID (const bool useit) |
| Turn heading PID on/off. | |
| void | usePitchPID (const bool useit) |
| Turn pitch PID on/off. | |
Constructors and Destructors | |
| BeoSubSim (OptionManager &mgr) | |
| Constructor. | |
| ~BeoSubSim () | |
| Destructor. | |
mid-level overloads | |
| virtual void | advanceRel (const float relDist, const bool stop=true) |
| Advance the sub by some distance in meters. | |
| virtual void | strafeRel (const float relDist) |
| Strafe the sub by some distance in meters. | |
| void | turnAbs (const Angle finalHeading, const bool blocking=false) |
| Turn the sub to the given heading. | |
| void | turnRel (const Angle relHeading, const bool blocking=false) |
| Turns the sub to the given heading relative to our current heading. | |
| void | turnOpen (const Angle relHeading, const bool blocking=false) |
| void | diveAbs (const float finalDepth, const bool blocking=false) |
| Makes the sub dive to a specific depth in meters. | |
| void | diveRel (const float relDepth, const bool blocking=false) |
| Makes the sub dive to a specific depth relative to current. | |
Low-level access functions | |
| void | thrust (const float leftval, const float rightval) |
| Activate the thrusters. | |
| void | getThrusters (float &leftval, float &rightval) const |
| Get the current thruster settings. | |
| void | setFrontBallast (const float val, const bool blocking=false) |
| Set the front ballast. Value is between 0.0 (empty) and 1.0 (full). | |
| void | setRearBallast (const float val, const bool blocking=false) |
| Set the rear ballast. Value is between 0.0 (empty) and 1.0 (full). | |
| void | setBallasts (const float f, const float r, const bool blocking=false) |
| Set all ballasts. | |
| float | getFrontBallast () const |
| Get the front ballast. Value is between 0.0 (empty) and 1.0 (full). | |
| float | getRearBallast () const |
| Get the rear ballast. Value is between 0.0 (empty) and 1.0 (full). | |
| void | getBallasts (float &f, float &r) const |
| Get all ballasts. | |
| virtual void | dropMarker (const bool blocking=false) |
| Drop a marker. | |
| virtual Image< PixRGB< byte > > | grabImage (const enum BeoSubCamera cam) const |
| Grab a an image from one of the cameras. | |
Protected Member Functions | |
| void | start1 () |
| get started, before our subcomponents start | |
| void | start2 () |
| get started, after our subcomponents have started | |
Protected Attributes | |
| NModelParam< int > | itsLeftThrusterServoNum |
| servo num for left thruster | |
| NModelParam< int > | itsRightThrusterServoNum |
| servo num for right thruster | |
| nub::soft_ref< HMR3300 > | itsHMR3300 |
| compass for heading | |
| nub::soft_ref< BeoChip > | itsBeo |
| our beochip | |
| nub::soft_ref< BeoSubBallast > | itsFballast |
| nub::soft_ref< BeoSubBallast > | itsRballast |
| our 2 ballasts | |
| nub::soft_ref< BeoSubIMU > | itsIMU |
| our IMU | |
| nub::soft_ref< FrameIstream > | itsCameraFront |
| nub::soft_ref< FrameIstream > | itsCameraDown |
| nub::soft_ref< FrameIstream > | itsCameraUp |
| our three cameras | |
| float | itsThrustLeft |
| float | itsThrustRight |
| our current thruster settings | |
| float | relDistance |
| bool | isStrafe |
| int | imageCounter |
| float | itsCurrentZ |
| float | itsCurrentX |
| bool | upImageFlag |
| bool | frontImageFlag |
| bool | downImageFlag |
| BeoSubSensor< float > | itsDepthSensor |
| sensor cleaner for depth | |
| BeoSubSensor< Angle > | itsHeadingSensor |
| sensor cleaner for heading | |
| BeoSubSensor< Angle > | itsPitchSensor |
| sensor cleaner for pitch | |
| PID< float > | itsDepthPID |
| PID for depth stabilization. | |
| PID< Angle > | itsHeadingPID |
| PID for heading stabilization. | |
| PID< Angle > | itsPitchPID |
| PID for pitch stabilization. | |
| bool | itsDepthPIDon |
| bool | itsHeadingPIDon |
| bool | itsPitchPIDon |
Friends | |
| class | BeoSubListener |
| class | HMRlistener |
|
|
Constructor. This is the listener class that is attached to each BeoChip in the ballast tube of the submarine. This class is just a pass-through to the function dispatchBeoChipEvent() of class BeoSubOneBal. Definition at line 97 of file BeoSubSim.C. |
|
|
Destructor.
Definition at line 126 of file BeoSubSim.C. |
|
||||||||||||
|
Advance the sub by some distance in meters. This is an overload of BeoSub::advanceRel() which ensures we turn off the heading PID during the advance Implements BeoSub. Definition at line 290 of file BeoSubSim.C. References relDistance, and thrust(). |
|
||||||||||||
|
Makes the sub dive to a specific depth in meters.
Reimplemented from BeoSub. Definition at line 320 of file BeoSubSim.C. References Attitude::depth, and BeoSub::itsTargetAttitude. |
|
||||||||||||
|
Makes the sub dive to a specific depth relative to current. Negative depth is up, positive is down. Distance is in meters. Reimplemented from BeoSub. Definition at line 324 of file BeoSubSim.C. References Attitude::depth, BeoSub::itsCurrentAttitude, and BeoSub::itsTargetAttitude. |
|
|
Drop a marker.
Implements BeoSub. Definition at line 247 of file BeoSubSim.C. References LFATAL. |
|
||||||||||||
|
Get all ballasts.
Definition at line 243 of file BeoSubSim.C. |
|
|
Get the front ballast. Value is between 0.0 (empty) and 1.0 (full).
Definition at line 235 of file BeoSubSim.C. |
|
|
Get the rear ballast. Value is between 0.0 (empty) and 1.0 (full).
Definition at line 239 of file BeoSubSim.C. |
|
||||||||||||
|
Get the current thruster settings.
Definition at line 218 of file BeoSubSim.C. References itsThrustLeft, and itsThrustRight. |
|
|
Grab a an image from one of the cameras.
Implements BeoSub. Definition at line 261 of file BeoSubSim.C. References downImageFlag, frontImageFlag, imageCounter, LERROR, Raster::ReadRGB(), sformat(), and upImageFlag. |
|
||||||||||||||||
|
Set all ballasts.
Definition at line 230 of file BeoSubSim.C. Referenced by start2(). |
|
||||||||||||
|
Set the front ballast. Value is between 0.0 (empty) and 1.0 (full).
Definition at line 222 of file BeoSubSim.C. |
|
||||||||||||
|
Set the rear ballast. Value is between 0.0 (empty) and 1.0 (full).
Definition at line 226 of file BeoSubSim.C. |
|
|
get started, before our subcomponents start
Reimplemented from BeoSub. Definition at line 130 of file BeoSubSim.C. References BeoSub::start1(). |
|
|
get started, after our subcomponents have started
Reimplemented from ModelComponent. Definition at line 140 of file BeoSubSim.C. References CLINFO, itsHeadingPIDon, itsPitchPIDon, and setBallasts(). |
|
|
Strafe the sub by some distance in meters. this is an overload of BeoSub::strafeRel() which ensures we turn the heading PID off during the strafe Reimplemented from BeoSub. Definition at line 298 of file BeoSubSim.C. References isStrafe, and relDistance. |
|
||||||||||||
|
Activate the thrusters. Values should be between -1.0 (full reverse) and 1.0 (full forward), 0.0 being no motion Definition at line 211 of file BeoSubSim.C. References itsThrustLeft, and itsThrustRight. Referenced by advanceRel(). |
|
||||||||||||
|
Turn the sub to the given heading.
Reimplemented from BeoSub. Definition at line 304 of file BeoSubSim.C. References Attitude::heading, and BeoSub::itsTargetAttitude. |
|
||||||||||||
|
Turns the sub to the given heading relative to our current heading.
Reimplemented from BeoSub. Definition at line 308 of file BeoSubSim.C. References Attitude::heading, BeoSub::itsCurrentAttitude, and BeoSub::itsTargetAttitude. |
|
||||||||||||||||
|
Update compass - used by sensors.
Definition at line 168 of file BeoSubSim.C. References Attitude::compassTime, Timer::getSecs(), Attitude::heading, BeoSub::itsCurrentAttitude, BeoSub::itsLock, BeoSub::itsMasterClock, Attitude::pitch, and t. |
|
|
Update depth - used by sensors.
Definition at line 190 of file BeoSubSim.C. References Attitude::depth, Timer::getSecs(), BeoSub::itsCurrentAttitude, itsDepthSensor, BeoSub::itsLock, BeoSub::itsMasterClock, BeoSubSensor< T >::newMeasurement(), Attitude::pressureTime, and t. |
|
||||||||||||
|
Update position.
Definition at line 206 of file BeoSubSim.C. References itsCurrentX, and itsCurrentZ. |
|
|
Turn depth PID on/off.
Definition at line 329 of file BeoSubSim.C. References itsDepthPIDon. |
|
|
Turn heading PID on/off.
Definition at line 333 of file BeoSubSim.C. References itsHeadingPIDon. |
|
|
Turn pitch PID on/off.
Definition at line 337 of file BeoSubSim.C. References itsPitchPIDon. |
|
|
our beochip
Definition at line 165 of file BeoSubSim.H. |
|
|
our three cameras
Definition at line 168 of file BeoSubSim.H. |
|
|
PID for depth stabilization.
Definition at line 180 of file BeoSubSim.H. |
|
|
sensor cleaner for depth
Definition at line 177 of file BeoSubSim.H. Referenced by updateDepth(). |
|
|
PID for heading stabilization.
Definition at line 181 of file BeoSubSim.H. |
|
|
sensor cleaner for heading
Definition at line 178 of file BeoSubSim.H. |
|
|
compass for heading
Definition at line 164 of file BeoSubSim.H. |
|
|
our IMU
Definition at line 167 of file BeoSubSim.H. |
|
|
servo num for left thruster
Definition at line 161 of file BeoSubSim.H. |
|
|
PID for pitch stabilization.
Definition at line 182 of file BeoSubSim.H. |
|
|
sensor cleaner for pitch
Definition at line 179 of file BeoSubSim.H. |
|
|
our 2 ballasts
Definition at line 166 of file BeoSubSim.H. |
|
|
servo num for right thruster
Definition at line 162 of file BeoSubSim.H. |
|
|
our current thruster settings
Definition at line 170 of file BeoSubSim.H. Referenced by getThrusters(), and thrust(). |
1.4.4