public abstract class UuvController extends VehicleController
Modifier and Type | Field and Description |
---|---|
protected double |
alongTrackRange
along track range remaining to reach goal point
|
protected double |
bowLateralThrusterCommand
commanded bow lateral thruster setting.
|
protected double |
bowVerticalThrusterCommand
commanded bow vertical thruster setting.
|
protected boolean |
correctToTrack
set to true if vehicle will try to follow a specified track between waypoints (false is point continuously towards waypoint, or no track applicable)
|
protected double |
crossTrackError
lateral displacement from a commanded track
|
protected double |
depthError
depth error (difference between actual and commanded depth or altitude
|
protected double |
depthErrorIntegral
depth error integral used in PID control
|
protected double |
depthPidTime
vehicle time (absolute) to switch from PD to PID control
|
protected double |
MAXDEPTHERROR
maximum value to allow depth error integral to reach
|
protected double |
offTrackAngleDegrees
angle computed from arc tangent of alongTrackRange and crossTrackError
|
protected boolean |
openLoopHeading
whether to automatically adjust heading
|
protected double |
pdOnlyTime
time after changing speed or depth commands to use PD control before switching to PID
|
protected double |
portPropellerCommand
commanded port propeller command
|
protected double |
psiCommand
commanded heading -- may or may not be relevant for individual inheriting control modes
|
protected double |
psiError
angular offset in degrees from a commanded track
|
protected double |
rudderCommand
commanded rudder setting
|
protected boolean |
speedControlReset
true if a new speed was specified this loop
|
protected double |
speedError
speed error (difference between actual and commanded speed in meters per second)
|
protected double |
stbdPropellerCommand
commanded starboard propeller command
|
protected double |
sternLateralThrusterCommand
commanded stern lateral thruster setting.
|
protected double |
sternVerticalThrusterCommand
commanded stern vertical thruster setting.
|
protected double |
thetaCommand
commanded pitch -- may or may not be relevant for individual inheriting control modes
|
protected double |
THRUSTCONVERSION
TODO what is this?
|
protected double |
turningRpm
rpm propellers turn at when adjusting without rudder
|
protected UuvExecution |
uuvExecution
reference to main class of this uuv
|
protected double |
zCommand
commanded z position
|
Constructor and Description |
---|
UuvController(UuvExecution execution)
Creates a new instance of Controller
|
Modifier and Type | Method and Description |
---|---|
protected void |
adjustPropellersForSteeringIfNoRudders()
Adjusts the required propeller settings if needed
|
protected boolean |
checkRudderAvailable()
Checks control coefficients to determine if rudder is available.
|
abstract void |
computeControls()
computes auv controls based on type of controller and current state/command
|
protected void |
computeLateralThrusterCommands()
Computes the fin settings to maintain commanded heading
|
protected void |
computePropellerCommands()
Computes the required propeller settings
|
protected void |
computeRudderCommands()
Computes the rudder setting to maintain a commanded heading,
can be overridden by inheriting classes if different behavior is desired.
|
protected void |
computeVerticalThrusterCommands()
Computes and applies vertical thruster settings for depth control
|
double |
getBowLateralThrusterCommand() |
double |
getCrossTrackError() |
double |
getPortPropellerCommand() |
double |
getPsiCommand() |
double |
getRudderCommand() |
double |
getSpeedCommand() |
double |
getStbdPropellerCommand() |
double |
getSternLateralThrusterCommand() |
double |
getThetaCommand() |
boolean |
isClosedLoopSpeed() |
void |
readControls()
read uuv controls from an external source, default implementation is to compute them
|
void |
setCommandedSpeed(double speed) |
void |
setControls()
applies the computed control settings for the rudder, propellers, and lateral body thrusters
|
protected void |
setPropellersRPM(double portCommand,
double stbdCommand)
Set propellers RPM (will automatically clamp to allowed limits)
|
void |
unsetClosedLoopSpeed()
Turns off closed loop speed control and uses fixed-speed prop control
|
protected void |
updateCrossTrackError()
Computes the current crossTrackError and alongTrackRange in order to steer towards goal destination, also computes psierror
|
protected final double THRUSTCONVERSION
protected UuvExecution uuvExecution
protected boolean speedControlReset
protected final double pdOnlyTime
protected double speedError
protected double bowLateralThrusterCommand
protected double sternLateralThrusterCommand
protected double rudderCommand
protected double portPropellerCommand
protected double stbdPropellerCommand
protected double psiCommand
protected double thetaCommand
protected double crossTrackError
protected double alongTrackRange
protected double offTrackAngleDegrees
protected double psiError
protected boolean correctToTrack
protected double depthPidTime
protected double depthError
protected double depthErrorIntegral
protected final double MAXDEPTHERROR
protected double bowVerticalThrusterCommand
protected double sternVerticalThrusterCommand
protected double zCommand
protected double turningRpm
protected boolean openLoopHeading
public UuvController(UuvExecution execution)
execution
- UuvExecution instancepublic double getBowLateralThrusterCommand()
public double getCrossTrackError()
public double getPortPropellerCommand()
public double getSpeedCommand()
public boolean isClosedLoopSpeed()
public double getPsiCommand()
public double getRudderCommand()
public double getStbdPropellerCommand()
public double getSternLateralThrusterCommand()
public double getThetaCommand()
public void setCommandedSpeed(double speed)
speed
- meters per second being commandedpublic void unsetClosedLoopSpeed()
public abstract void computeControls()
public void readControls()
protected void updateCrossTrackError()
protected boolean checkRudderAvailable()
protected void computeRudderCommands()
protected void computeLateralThrusterCommands()
protected void computeVerticalThrusterCommands()
protected void computePropellerCommands()
protected void adjustPropellersForSteeringIfNoRudders()
protected void setPropellersRPM(double portCommand, double stbdCommand)
portCommand
- RPMstbdCommand
- RPMpublic void setControls()