|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuavsim.flightdynamicsmodel.AircraftModelController
public class AircraftModelController
Defines the basic inputs to the control surfaces of the aircraft, which in turn modify its state with respect to the flight-dynamics model.
| Field Summary | |
|---|---|
private java.util.Queue<HistoryEntry<SevenDOFDescriptor>> |
_DOFHistory
the restricted-length history queue for the degree-of-freedom state at each simulation update |
private AircraftModel |
_model
the aircraft model |
private static int |
HISTORY_WINDOW_LENGTH
the number of history entries in the averaging window |
static double |
THRUST_DELTA
the step for incrementing and decrementing the thrust |
static double |
THRUST_MAX
the maximum thrust in RPM |
static double |
THRUST_MIN
the minimum thrust in RPM |
| Constructor Summary | |
|---|---|
AircraftModelController(AircraftModel model)
Creates a controller for the aircraft. |
|
| Method Summary | |
|---|---|
(package private) void |
addHistoryEntry()
Records the current degree-of-freedom state containing 3D coordinate and attitude. |
boolean |
areFlapsExtended()
Returns whether the flaps are fully extended. |
Course |
determineCourse()
Calculates the current course as the average change of latitude and longitude over the history window. |
void |
determinePositionAcceleration()
Calculates the change in position in zzz per second squared as the average over the history window. |
void |
determinePositionVelocity()
Calculates the change in position in zzz per second as the average over the history window. |
void |
doAileronsDownUp()
Deflects the port and starboard ailerons down and up a full 15 degrees, respectively. |
void |
doAileronsNeutral()
Neutralizes the ailerons to 0 degrees. |
void |
doAileronsUpDown()
Deflects the port and starboard ailerons up and down a full 15 degrees, respectively. |
void |
doAllInputsNeutral()
Neutralizes the rudder, ailerons, and elevator. |
void |
doElevatorDown()
Deflects the elevator down a full 15 degrees. |
void |
doElevatorNeutral()
Neutralizes the elevator to 0 degrees. |
void |
doElevatorUp()
Deflects the elevator up a full 15 degrees. |
void |
doFlapsExtend()
Extends the flaps to a full 15 degrees. |
void |
doFlapsRetract()
Retracts the flaps to 0 degrees. |
void |
doRudderLeft()
Deflects the rudder left a full 15 degrees. |
void |
doRudderNeutral()
Neutralizes the rudder right to 0 degrees. |
void |
doRudderRight()
Deflects the rudder right a full 15 degrees. |
void |
doThrustDecrease()
Decreases the thrust by THRUST_DELTA down to THRUST_MIN. |
void |
doThrustIncrease()
Increases the thrust by THRUST_DELTA up to THRUST_MAX. |
void |
export(java.io.BufferedWriter outfile,
boolean isHeaderIncluded)
Exports the state of the model to a text file. |
private java.lang.String |
format(double value)
Formats a number to four decimal places. |
Airspeed |
getAirspeed()
Returns the airspeed. |
SevenDOFDescriptor |
getDOFDescriptor()
Determines the current degree-of-freedom state. |
double |
getLiftCoefficient()
Returns the current coefficient of lift. |
AircraftModel |
getModel()
Returns the aircraft model. |
AircraftRigidBody |
getRigidBody()
Returns a copy of the rigid body. |
RevolutionsPerMinute |
getRPM()
Returns the current thrust as an absolute value on the interval [THRUST_MIN,THRUST_MAX]. |
int |
getStepNumber()
Returns the current simulation step number. |
double |
getThrustAbsolute()
Returns the current thrust as an absolute value on the interval [THRUST_MIN,THRUST_MAX]. |
double |
getThrustRelative()
Returns the current thrust as a relative value on the interval [0,1], which corresponds to 0 to 100%. |
Vector |
getThrustVector()
Returns the 3D vector of the thrust. |
Time |
getTimeAbsolute()
Returns the absolute simulation time. |
Time |
getTimeRelative()
Returns the relative simulation time since the last update. |
boolean |
isStalled()
Returns whether the aircraft is fully stalled. |
boolean |
isStalling()
Returns whether the aircraft is approaching a stall. |
void |
printState()
Prints the state of the model to standard output. |
void |
setThrustAbsolute(double thrust)
Sets the current thrust as an absolute value on the interval [THRUST_MIN,THRUST_MAX]. |
void |
setThrustRelative(double thrustRatio)
Set the current thrust as a relative value on the interval [0,1], which corresponds to 0 to 100%. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final java.util.Queue<HistoryEntry<SevenDOFDescriptor>> _DOFHistory
private final AircraftModel _model
private static final int HISTORY_WINDOW_LENGTH
public static final double THRUST_DELTA
public static final double THRUST_MAX
public static final double THRUST_MIN
| Constructor Detail |
|---|
public AircraftModelController(AircraftModel model)
model - - the aircraft model| Method Detail |
|---|
void addHistoryEntry()
public boolean areFlapsExtended()
public Course determineCourse()
public void determinePositionAcceleration()
public void determinePositionVelocity()
public void doAileronsDownUp()
public void doAileronsNeutral()
public void doAileronsUpDown()
public void doAllInputsNeutral()
public void doElevatorDown()
public void doElevatorNeutral()
public void doElevatorUp()
public void doFlapsExtend()
public void doFlapsRetract()
public void doRudderLeft()
public void doRudderNeutral()
public void doRudderRight()
public void doThrustDecrease()
public void doThrustIncrease()
public void export(java.io.BufferedWriter outfile,
boolean isHeaderIncluded)
throws java.io.IOException
outfile - - the outfile fileisHeaderIncluded - - whether to export the field headers first
java.io.IOException - - if the export file cannot be written toprivate java.lang.String format(double value)
value - - the value
public Airspeed getAirspeed()
public SevenDOFDescriptor getDOFDescriptor()
public double getLiftCoefficient()
public AircraftModel getModel()
public AircraftRigidBody getRigidBody()
public RevolutionsPerMinute getRPM()
public int getStepNumber()
public double getThrustAbsolute()
public double getThrustRelative()
public Vector getThrustVector()
public Time getTimeAbsolute()
public Time getTimeRelative()
public boolean isStalled()
public boolean isStalling()
AircraftModel.IMMINENT_STALL_LIFT_COEFFICIENTpublic void printState()
public void setThrustAbsolute(double thrust)
thrust - - the thrustpublic void setThrustRelative(double thrustRatio)
thrustRatio - - the thrust ratio
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||