BeoSubOneBal Class Reference

Definition and access functions for the BeoSub. More...

#include <BeoSub/BeoSubOneBal.H>

Inheritance diagram for BeoSubOneBal:
Inheritance graph
[legend]
Collaboration diagram for BeoSubOneBal:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void setRotVel (const Angle desired)
void setTransVel (const float desired)
Constructors and Destructors

 BeoSubOneBal (OptionManager &mgr)
 Constructor.
 ~BeoSubOneBal ()
 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)
 Strafes the sub by some distance in meters.
virtual void turnOpen (const Angle openHeading, const bool stop=true)
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.
PID control

void useDepthPID (const bool useit)
 Turn depth PID on/off.
void setDepthPgain (float p)
 set depth PID pgain
void setDepthIgain (float i)
 set depth PID igain
void setDepthDgain (float d)
 set depth PID dgain
void useHeadingPID (const bool useit)
 Turn heading PID on/off.
void setHeadingPgain (float p)
 set heading PID pgain
void setHeadingIgain (float i)
 set heading PID igain
void setHeadingDgain (float d)
 set heading PID dgain
void usePitchPID (const bool useit)
 Turn pitch PID on/off.
void setPitchPgain (float p)
 set pitch PID pgain
void setPitchIgain (float i)
 set pitch PID igain
void setPitchDgain (float d)
 set pitch PID dgain
void useRotVelPID (const bool useit)
 Turn pitch PID on/off.
void setRotVelPgain (float p)
 set pitch PID pgain
void setRotVelIgain (float i)
 set pitch PID igain
void setRotVelDgain (float d)
 set pitch PID dgain
Miscellaneous

void useKillSwitch (const bool useit)
 Use or ignore the kill switch.
bool isKilled ()
void killSwitch ()
 Kill Switch Function.
For internal use by our listeners only -- do not call

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 updateIMU (const float xa, const float ya, const float za, const Angle xv, const Angle yv, const Angle zv)

Public Attributes

nub::soft_ref< BeoSubIMUitsIMU
 our IMU

Protected Member Functions

virtual void start1 ()
 get started, before our subcomponents start
virtual void start2 ()
 get started, after our subcomponents have started
virtual void stop1 ()
 This is called from within stop() before the subcomponents stop.

Protected Attributes

NModelParam< int > itsLeftThrusterServoNum
 servo num for left thruster
NModelParam< int > itsRightThrusterServoNum
 servo num for right thruster
nub::soft_ref< HMR3300itsHMR3300
 compass for heading
nub::soft_ref< BeoChipitsBeo
 our beochip
nub::soft_ref< BeoSubBallastitsFballast
nub::soft_ref< BeoSubBallastitsRballast
 our 2 ballasts
nub::soft_ref< FrameIstreamitsCameraFront
nub::soft_ref< FrameIstreamitsCameraDown
nub::soft_ref< FrameIstreamitsCameraUp
 our three cameras
float itsThrustLeft
float itsThrustRight
 our current thruster settings
BeoSubSensor< float > itsDepthSensor
 sensor cleaner for depth
BeoSubSensor< AngleitsHeadingSensor
 sensor cleaner for heading
BeoSubSensor< AngleitsPitchSensor
 sensor cleaner for pitch
PID< float > itsDepthPID
 PID for depth stabilization.
PID< AngleitsHeadingPID
 PID for heading stabilization.
PID< AngleitsPitchPID
 PID for pitch stabilization.
PID< AngleitsRotVelPID
 PID for rotational velocity stabilization.
bool itsDepthPIDon
bool itsHeadingPIDon
bool itsPitchPIDon
bool itsRotVelPIDon
bool itsKillSwitchUsed
float itsDiveSetting
float itsPitchSetting
double itsLastHeadingTime
double itsLastPitchTime
double itsLastDepthTime
nub::soft_ref< ParPortlp0
Stepper markerdropper
int killSwitchDebounceCounter

Friends

class BeoSubListener
class HMRlistener

Detailed Description

Definition and access functions for the BeoSub.

BeoSub is an autonomous visually-guided submarine. This class impoements the highl-evel functionality, relying on low-level drivers to handle motor activation, compass reading, etc

Definition at line 57 of file BeoSubOneBal.H.


Constructor & Destructor Documentation

BeoSubOneBal::BeoSubOneBal ( OptionManager mgr  ) 
BeoSubOneBal::~BeoSubOneBal (  ) 

Destructor.

Definition at line 229 of file BeoSubOneBal.C.


Member Function Documentation

void BeoSubOneBal::advanceRel ( const float  relDist,
const bool  stop = true 
) [virtual]

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 319 of file BeoSubOneBal.C.

References Angle::getRadians(), and useHeadingPID().

Referenced by strafeRel().

void BeoSubOneBal::dropMarker ( const bool  blocking = false  )  [virtual]

Drop a marker.

Implements BeoSub.

Definition at line 618 of file BeoSubOneBal.C.

void BeoSubOneBal::getBallasts ( float &  f,
float &  r 
) const

Get all ballasts.

Definition at line 614 of file BeoSubOneBal.C.

References nub::soft_ref< T >::get(), and itsRballast.

float BeoSubOneBal::getFrontBallast (  )  const

Get the front ballast. Value is between 0.0 (empty) and 1.0 (full).

Definition at line 606 of file BeoSubOneBal.C.

References nub::soft_ref< T >::get().

float BeoSubOneBal::getRearBallast (  )  const

Get the rear ballast. Value is between 0.0 (empty) and 1.0 (full).

Definition at line 610 of file BeoSubOneBal.C.

References nub::soft_ref< T >::get(), and itsRballast.

void BeoSubOneBal::getThrusters ( float &  leftval,
float &  rightval 
) const

Get the current thruster settings.

Definition at line 572 of file BeoSubOneBal.C.

References itsThrustRight.

Image< PixRGB< byte > > BeoSubOneBal::grabImage ( const enum BeoSubCamera  cam  )  const [virtual]

Grab a an image from one of the cameras.

Implements BeoSub.

Definition at line 760 of file BeoSubOneBal.C.

References itsCameraUp.

void BeoSubOneBal::killSwitch (  ) 

Kill Switch Function.

This is called when the kill switch is activated

Definition at line 628 of file BeoSubOneBal.C.

References setBallasts(), useDepthPID(), useHeadingPID(), usePitchPID(), and useRotVelPID().

void BeoSubOneBal::setBallasts ( const float  f,
const float  r,
const bool  blocking = false 
)

Set all ballasts.

Definition at line 584 of file BeoSubOneBal.C.

References Timer::getSecs(), BeoSub::itsMasterClock, and itsRballast.

Referenced by killSwitch(), start2(), stop1(), updateCompass(), and updateDepth().

void BeoSubOneBal::setDepthDgain ( float  d  ) 

set depth PID dgain

Definition at line 810 of file BeoSubOneBal.C.

References itsDepthPID.

void BeoSubOneBal::setDepthIgain ( float  i  ) 

set depth PID igain

Definition at line 806 of file BeoSubOneBal.C.

References itsDepthPID.

void BeoSubOneBal::setDepthPgain ( float  p  ) 

set depth PID pgain

Definition at line 802 of file BeoSubOneBal.C.

References itsDepthPID, and PID< T >::setPIDPgain().

void BeoSubOneBal::setFrontBallast ( const float  val,
const bool  blocking = false 
)

Set the front ballast. Value is between 0.0 (empty) and 1.0 (full).

Definition at line 576 of file BeoSubOneBal.C.

void BeoSubOneBal::setHeadingDgain ( float  d  ) 

set heading PID dgain

Definition at line 822 of file BeoSubOneBal.C.

References itsHeadingPID.

void BeoSubOneBal::setHeadingIgain ( float  i  ) 

set heading PID igain

Definition at line 818 of file BeoSubOneBal.C.

References itsHeadingPID.

void BeoSubOneBal::setHeadingPgain ( float  p  ) 

set heading PID pgain

Definition at line 814 of file BeoSubOneBal.C.

References itsHeadingPID, and PID< T >::setPIDPgain().

void BeoSubOneBal::setPitchDgain ( float  d  ) 

set pitch PID dgain

Definition at line 834 of file BeoSubOneBal.C.

References itsPitchPID.

void BeoSubOneBal::setPitchIgain ( float  i  ) 

set pitch PID igain

Definition at line 830 of file BeoSubOneBal.C.

References itsPitchPID.

void BeoSubOneBal::setPitchPgain ( float  p  ) 

set pitch PID pgain

Definition at line 826 of file BeoSubOneBal.C.

References itsPitchPID, and PID< T >::setPIDPgain().

void BeoSubOneBal::setRearBallast ( const float  val,
const bool  blocking = false 
)

Set the rear ballast. Value is between 0.0 (empty) and 1.0 (full).

Definition at line 580 of file BeoSubOneBal.C.

References itsRballast.

void BeoSubOneBal::setRotVelDgain ( float  d  ) 

set pitch PID dgain

Definition at line 846 of file BeoSubOneBal.C.

References itsRotVelPID.

void BeoSubOneBal::setRotVelIgain ( float  i  ) 

set pitch PID igain

Definition at line 842 of file BeoSubOneBal.C.

References itsRotVelPID.

void BeoSubOneBal::setRotVelPgain ( float  p  ) 

set pitch PID pgain

Definition at line 838 of file BeoSubOneBal.C.

References itsRotVelPID, and PID< T >::setPIDPgain().

void BeoSubOneBal::start1 (  )  [protected, virtual]

get started, before our subcomponents start

Reimplemented from BeoSub.

Definition at line 233 of file BeoSubOneBal.C.

References itsCameraUp.

void BeoSubOneBal::start2 (  )  [protected, virtual]

get started, after our subcomponents have started

Reimplemented from ModelComponent.

Definition at line 268 of file BeoSubOneBal.C.

References itsBeo, and setBallasts().

void BeoSubOneBal::stop1 (  )  [protected, virtual]

This is called from within stop() before the subcomponents stop.

Reimplemented from ModelComponent.

Definition at line 304 of file BeoSubOneBal.C.

References setBallasts(), useDepthPID(), useHeadingPID(), usePitchPID(), and useRotVelPID().

void BeoSubOneBal::strafeRel ( const float  relDist  )  [virtual]

Strafes 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 391 of file BeoSubOneBal.C.

References advanceRel(), and BeoSub::turnRel().

void BeoSubOneBal::thrust ( const float  leftval,
const float  rightval 
)

Activate the thrusters.

Values should be between -1.0 (full reverse) and 1.0 (full forward), 0.0 being no motion

Definition at line 558 of file BeoSubOneBal.C.

References NModelParam< T >::getVal(), itsBeo, itsLeftThrusterServoNum, itsRightThrusterServoNum, and itsThrustRight.

void BeoSubOneBal::updateCompass ( const Angle  heading,
const Angle  pitch,
const Angle  roll 
)
void BeoSubOneBal::updateDepth ( const float  depth  ) 
void BeoSubOneBal::useDepthPID ( const bool  useit  ) 

Turn depth PID on/off.

Definition at line 770 of file BeoSubOneBal.C.

Referenced by killSwitch(), and stop1().

void BeoSubOneBal::useHeadingPID ( const bool  useit  ) 

Turn heading PID on/off.

Definition at line 774 of file BeoSubOneBal.C.

Referenced by advanceRel(), killSwitch(), and stop1().

void BeoSubOneBal::useKillSwitch ( const bool  useit  ) 

Use or ignore the kill switch.

Definition at line 785 of file BeoSubOneBal.C.

void BeoSubOneBal::usePitchPID ( const bool  useit  ) 

Turn pitch PID on/off.

Definition at line 778 of file BeoSubOneBal.C.

Referenced by killSwitch(), and stop1().

void BeoSubOneBal::useRotVelPID ( const bool  useit  ) 

Turn pitch PID on/off.

Definition at line 781 of file BeoSubOneBal.C.

Referenced by killSwitch(), and stop1().


Member Data Documentation

our beochip

Definition at line 232 of file BeoSubOneBal.H.

Referenced by BeoSubOneBal(), start2(), and thrust().

our three cameras

Definition at line 235 of file BeoSubOneBal.H.

Referenced by BeoSubOneBal(), grabImage(), and start1().

PID<float> BeoSubOneBal::itsDepthPID [protected]

PID for depth stabilization.

Definition at line 242 of file BeoSubOneBal.H.

Referenced by setDepthDgain(), setDepthIgain(), setDepthPgain(), and updateDepth().

sensor cleaner for depth

Definition at line 239 of file BeoSubOneBal.H.

Referenced by updateDepth().

PID for heading stabilization.

Definition at line 243 of file BeoSubOneBal.H.

Referenced by setHeadingDgain(), setHeadingIgain(), setHeadingPgain(), and updateCompass().

sensor cleaner for heading

Definition at line 240 of file BeoSubOneBal.H.

Referenced by updateCompass().

compass for heading

Definition at line 231 of file BeoSubOneBal.H.

Referenced by BeoSubOneBal().

our IMU

Definition at line 225 of file BeoSubOneBal.H.

Referenced by BeoSubOneBal().

servo num for left thruster

Definition at line 228 of file BeoSubOneBal.H.

Referenced by thrust().

PID for pitch stabilization.

Definition at line 244 of file BeoSubOneBal.H.

Referenced by setPitchDgain(), setPitchIgain(), setPitchPgain(), and updateCompass().

sensor cleaner for pitch

Definition at line 241 of file BeoSubOneBal.H.

Referenced by updateCompass().

our 2 ballasts

Definition at line 233 of file BeoSubOneBal.H.

Referenced by BeoSubOneBal(), getBallasts(), getRearBallast(), setBallasts(), and setRearBallast().

servo num for right thruster

Definition at line 229 of file BeoSubOneBal.H.

Referenced by thrust().

PID for rotational velocity stabilization.

Definition at line 245 of file BeoSubOneBal.H.

Referenced by setRotVelDgain(), setRotVelIgain(), and setRotVelPgain().

float BeoSubOneBal::itsThrustRight [protected]

our current thruster settings

Definition at line 237 of file BeoSubOneBal.H.

Referenced by getThrusters(), and thrust().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:20:31 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3