jaron.autopilot
Class FlightGearServoController

java.lang.Object
  extended by java.lang.Thread
      extended by jaron.autopilot.FlightGearServoController
All Implemented Interfaces:
java.lang.Runnable

public class FlightGearServoController
extends java.lang.Thread

The FlightGearServoController class provides access to the controls (e.g. aileron, elevator, rudder, throttle) of an airplane in the FlightGear flight simulator.

Since:
1.2
Version:
1.2
Author:
jarontec gmail com

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.String DEFAULT_IP
          The default IP address that is used for the outgoing connection.
static int DEFAULT_PORT
          The default port that is used for the incoming connection.
static float DEFAULT_UPDATE_FREQUENCY
          The default update frequency of the FlightGearServoController is set to 10.0f Hz.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FlightGearServoController()
          Creates a new FlightGearServoController and starts a Thread that tries to connect to FlightGear.
FlightGearServoController(java.lang.String ip)
          Creates a new FlightGearServoController and starts a Thread that tries to connect to FlightGear.
FlightGearServoController(java.lang.String ip, int port)
          Creates a new FlightGearServoController and starts a Thread that tries to connect to FlightGear.
 
Method Summary
 Signal getAileron()
          Returns the aileron signal.
 Signal getElevator()
          Returns the elevator signal.
 Signal getRudder()
          Returns the rudder signal.
 Signal getThrottle()
          Returns the aileron signal.
 void run()
           
 void setUpdateFrequency(float updateFrequency)
          Sets the update frequency for the FlightGearServoController.
 void shutDown()
          Disconnects from FlightGear.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_UPDATE_FREQUENCY

public static final float DEFAULT_UPDATE_FREQUENCY
The default update frequency of the FlightGearServoController is set to 10.0f Hz.

See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
The default port that is used for the incoming connection. At the moment this is port 5556 but this could change in the future.

See Also:
Constant Field Values

DEFAULT_IP

public static final java.lang.String DEFAULT_IP
The default IP address that is used for the outgoing connection. This is the local address "127.0.0.1".

See Also:
Constant Field Values
Constructor Detail

FlightGearServoController

public FlightGearServoController(java.lang.String ip,
                                 int port)
Creates a new FlightGearServoController and starts a Thread that tries to connect to FlightGear.

Parameters:
ip - the IP address of the FlightGear application
port - the port of the FlightGear application

FlightGearServoController

public FlightGearServoController(java.lang.String ip)
Creates a new FlightGearServoController and starts a Thread that tries to connect to FlightGear. It tries to connect to the default port 5556.

Parameters:
ip - the IP address of the FlightGear application

FlightGearServoController

public FlightGearServoController()
Creates a new FlightGearServoController and starts a Thread that tries to connect to FlightGear. It tries to connect to the default IP address 127.0.0.1 and the default port 5556.

Method Detail

getAileron

public Signal getAileron()
Returns the aileron signal.

Returns:
aileron signal

getElevator

public Signal getElevator()
Returns the elevator signal.

Returns:
elevator signal

getRudder

public Signal getRudder()
Returns the rudder signal.

Returns:
rudder signal

getThrottle

public Signal getThrottle()
Returns the aileron signal.

Returns:
aileron signal

setUpdateFrequency

public void setUpdateFrequency(float updateFrequency)
Sets the update frequency for the FlightGearServoController. The default update frequency is set to 10 Hz.

Parameters:
updateFrequency - the new frequency in Hz

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

shutDown

public void shutDown()
Disconnects from FlightGear.