LunarMissionControl:

%	Implements a lunar mission control system.
	The command list cell array is {time command data}
	where data is a data structure for that command. The command list
	rows should be in order of Julian date. You can also use +sec instead of
 jD in which case the time is +sec after the previous command. If the 
 first command is +sec then it is +sec from the time passed on
 initialization.

 Supported commands:

  Command                          data
  'align with a quaternion',        struct('q_target',[0;1;0;0]);...
  'lunar orbit insertion prepare',	struct('thrust',20,'massInitial',6,...
                                          'uE', 290*9.806,...
                                          'body_vector',[1;0;0],...
                                          'hLunarOrbit',200);...
  'align for lunar insertion',      [];...
  'start main engine',              struct('iD',1,'thrust',20)};

 uE is exhaust velocity in m/s. massInitial is the mass at the start
 of the burn. hLunarOrbit is the altitude of the burn.

	meas can be the state vector.

	dC = LunarMissionControl gives the default data structure. This also
	opens a GUI that shows the command list and current command that is
	being executed.

	Commands are implemented via the dSim data structure. This is compatible
 with RHSLunarMission.
   
--------------------------------------------------------------------------
   Form:
   [dC, dSim] = LunarMissionControl( action, jD, dC, dSim, meas, cList )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   action  (1,:)   'initialize', 'update', 'terminate'
   jD      (1,1)   Julian date
   dC      (.)     Controller data structure
   dSim    (.)     Simulation data structure
   meas    (.)     Measurement data structure or state vector
                   .qECIToBody (4,1) Quaternion
                   .rECI       (3,1) ECI position
                   .vECI       (3,1) ECI velocity
                   .omega      (3,1) Body rate
                   .omegaRWA   (:,1) RWA rates                  
   cList   {:,3}   Command list cell array

 	-------
   Outputs
   -------
   dC      (.)     Controller data structure
   dSim    (.)     Simulation data structure

--------------------------------------------------------------------------

Children:

Common: Control/PIDMIMO
Common: Quaternion/QForm
Common: Quaternion/QTForm
Common: Time/SecToString
Missions: LunarMission/CommandListProcessing
Missions: LunarMission/LunarOrbitInsertion
SCPro: ProControl/PID3Axis