jaron.autopilot
Class MissionController

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

public class MissionController
extends java.lang.Thread

The MissionController class provides the functionality for guiding a vehicle through a mission that is defined by a starting point (home) and an unlimited number of navigation waypoints.

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 int CIRCLE_ANTICLOCKWISE
          Used to set the circling direction.
static int CIRCLE_AT_HOME
          Used to determine what has to be done after the mission is completed.
static int CIRCLE_CLOCKWISE
          Used to set the circling direction.
static int RESTART_MISSION
          Used to determine what has to be done after the mission is completed.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MissionController()
          Creates a new MissionController object and starts it as a Thread.
 
Method Summary
 void addWaypoint(double latitude, double longitude)
          Adds a new navigation waypoint to the list of the target waypoints.
 Signal getCourseGainD()
          Returns the course D gain signal which is used for the event handling mechanism.
 Signal getCourseGainI()
          Returns the course I gain signal which is used for the event handling mechanism.
 Signal getCourseGainP()
          Returns the course P gain signal which is used for the event handling mechanism.
 Signal getCourseMaxI()
          Returns the course maximum I signal which is used for the event handling mechanism.
 Signal getCourseMinI()
          Returns the course minimum I signal which is used for the event handling mechanism.
 Signal getCourseOverGround()
          Returns the course over ground signal which is used for the event handling mechanism.
 Signal getCurrentWaypoint()
          Returns the current waypoint signal which is used for the event handling mechanism.
 Signal getLatitude()
          Returns the latitude signal which is used for the event handling mechanism.
 Signal getLongitude()
          Returns the latitude signal which is used for the event handling mechanism.
 Signal getPitchAnglePreset()
          Returns the pitch angle preset signal which is used for the event handling mechanism.
 Signal getRollAnglePreset()
          Returns the roll angle preset signal which is used for the event handling mechanism.
 Signal getSpeedOverGround()
          Returns the speed over ground signal which is used for the event handling mechanism.
 Signal getTargetCourse()
          Returns the target course signal which is used for the event handling mechanism.
 void goHome()
          Stops the mission and the vehicle is guided to its home coordinates.
 void run()
           
 void setCirclingDirection(int circlingDirection)
          Sets the circling direction for circling around a waypoint.
 void setCirclingRadius(double circlingRadius)
          Sets the radius for circling around a waypoint.
 void setHome(double latitude, double longitude)
          Sets the home coordinates of the vehicle.
 void setMaximumRollAngle(double maximumRollAngle)
          Sets the maximum roll angle (bank angle) that the mission controller should use when it guides the vehicle through a curve.
 void setMissionCompletedAction(int missionCompletedAction)
          Sets the action that has to be performed after the mission is completed.
 void setNavigationMode(int navigationMode)
          Sets the current navigation mode.
 void setTargetRadius(double targetRadius)
          Sets the radius within which a target waypoint is supposed to be hit.
 void setUpdateFrequency(float updateFrequency)
          Sets the update frequency for the MotionController.
 void startMission()
          Starts the mission.
 void stopMission()
          Stops the mission.
 
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

CIRCLE_CLOCKWISE

public static final int CIRCLE_CLOCKWISE
Used to set the circling direction.

See Also:
Constant Field Values

CIRCLE_ANTICLOCKWISE

public static final int CIRCLE_ANTICLOCKWISE
Used to set the circling direction.

See Also:
Constant Field Values

CIRCLE_AT_HOME

public static final int CIRCLE_AT_HOME
Used to determine what has to be done after the mission is completed.

See Also:
Constant Field Values

RESTART_MISSION

public static final int RESTART_MISSION
Used to determine what has to be done after the mission is completed.

See Also:
Constant Field Values
Constructor Detail

MissionController

public MissionController()
Creates a new MissionController object and starts it as a Thread.

Method Detail

addWaypoint

public void addWaypoint(double latitude,
                        double longitude)
Adds a new navigation waypoint to the list of the target waypoints.

Parameters:
latitude - the latitude coordinate in decimal form
longitude - the longitude coordinate in decimal form

setCirclingRadius

public void setCirclingRadius(double circlingRadius)
Sets the radius for circling around a waypoint.

Parameters:
circlingRadius - radius in meters

setCirclingDirection

public void setCirclingDirection(int circlingDirection)
Sets the circling direction for circling around a waypoint.

Parameters:
circlingDirection - circle direction
See Also:
CIRCLE_CLOCKWISE, CIRCLE_ANTICLOCKWISE

setHome

public void setHome(double latitude,
                    double longitude)
Sets the home coordinates of the vehicle. This is for example used to let the vehicle return to a certain point after a malfunction.

Parameters:
latitude - in decimal form
longitude - in decimal form

setMaximumRollAngle

public void setMaximumRollAngle(double maximumRollAngle)
Sets the maximum roll angle (bank angle) that the mission controller should use when it guides the vehicle through a curve.

Parameters:
maximumRollAngle - roll angle in degrees

setMissionCompletedAction

public void setMissionCompletedAction(int missionCompletedAction)
Sets the action that has to be performed after the mission is completed.

Parameters:
missionCompletedAction - either of the predefined actions
See Also:
CIRCLE_AT_HOME, RESTART_MISSION

setNavigationMode

public void setNavigationMode(int navigationMode)
Sets the current navigation mode.

Parameters:
navigationMode - either of the predefined modes
See Also:
DO_NAVIGATE, CIRCLE_AT_HOME, RESTART_MISSION

setTargetRadius

public void setTargetRadius(double targetRadius)
Sets the radius within which a target waypoint is supposed to be hit. If set to 0 the vehicle is heading to a certain waypoint until it reaches the target and then it will be heading to the next waypoint. Every value greater than 0 causes the vehicle to change its heading before it reaches the target waypoint.

Parameters:
targetRadius - target radius in meters

getCurrentWaypoint

public Signal getCurrentWaypoint()
Returns the current waypoint signal which is used for the event handling mechanism.

Returns:
the current waypoint signal
See Also:
Signal

getCourseGainP

public Signal getCourseGainP()
Returns the course P gain signal which is used for the event handling mechanism.

Returns:
the course P gain signal
See Also:
Signal

getCourseGainI

public Signal getCourseGainI()
Returns the course I gain signal which is used for the event handling mechanism.

Returns:
the course I gain signal
See Also:
Signal

getCourseGainD

public Signal getCourseGainD()
Returns the course D gain signal which is used for the event handling mechanism.

Returns:
the course D gain signal
See Also:
Signal

getCourseMaxI

public Signal getCourseMaxI()
Returns the course maximum I signal which is used for the event handling mechanism.

Returns:
the course maximum I signal
See Also:
Signal

getCourseMinI

public Signal getCourseMinI()
Returns the course minimum I signal which is used for the event handling mechanism.

Returns:
the course minimum I signal
See Also:
Signal

getLatitude

public Signal getLatitude()
Returns the latitude signal which is used for the event handling mechanism.

Returns:
the latitude signal
See Also:
Signal

getLongitude

public Signal getLongitude()
Returns the latitude signal which is used for the event handling mechanism.

Returns:
the longitude signal
See Also:
Signal

getCourseOverGround

public Signal getCourseOverGround()
Returns the course over ground signal which is used for the event handling mechanism.

Returns:
the course over ground signal
See Also:
Signal

getSpeedOverGround

public Signal getSpeedOverGround()
Returns the speed over ground signal which is used for the event handling mechanism.

Returns:
the speed over ground signal
See Also:
Signal

getTargetCourse

public Signal getTargetCourse()
Returns the target course signal which is used for the event handling mechanism.

Returns:
the target course signal
See Also:
Signal

getPitchAnglePreset

public Signal getPitchAnglePreset()
Returns the pitch angle preset signal which is used for the event handling mechanism.

Returns:
the pitch angle preset signal
See Also:
Signal

getRollAnglePreset

public Signal getRollAnglePreset()
Returns the roll angle preset signal which is used for the event handling mechanism.

Returns:
the roll angle preset signal
See Also:
Signal

setUpdateFrequency

public void setUpdateFrequency(float updateFrequency)
Sets the update frequency for the MotionController.

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

startMission

public void startMission()
Starts the mission.


stopMission

public void stopMission()
Stops the mission.


goHome

public void goHome()
Stops the mission and the vehicle is guided to its home coordinates.