AnimateSpacecraft:

Path: SC/Visualization

% Animate spacecraft CAD models in a relative frame
 You can add as may spacecraft as you like by adding more g's, r's and
 q's. The window will be updated for each position/quaternion pair with a pause
 of 0.1 seconds in between (or set a different pause dT). Call 'initialize'
 before calling the other actions to set additional features.

 The orange vectors are velocity, the yellow are sun and the blue-green is
 nadir. Nadir is only shown for the central satellite.

 If you ask for the output m the animation will return movie frames. If you are
 making a movie you cannot change the window size while you
 are generating the frames.

 Type AnimateSpacecraft for a demo.
--------------------------------------------------------------------------
   Form:
      AnimateSpacecraft( 'initialize', g1, g2, r1, v1, q1, r2, v2, q2 )

   After initialize:

      AnimateSpacecraft( 'add nadir' )             % draw the nadir vector
      AnimateSpacecraft( 'add sun', jD0 )          % draw the sun vector
      AnimateSpacecraft( 'add velocity' )          % draw the velocity vectors
      AnimateSpacecraft( 'use lvlh' )              % tie camera to LVLH
      AnimateSpacecraft( 'set pause', dt )         % change the pause time
      AnimateSpacecraft( 'max axes' )              % set the axes limits apriori
      AnimateSpacecraft( 'track with camera', target, offset, viewAngle )   
      AnimateSpacecraft( 'update', t, r1, v1, q1, r2, v2, q2 ) % run the animation
  m = AnimateSpacecraft( 'update', t, r1, v1, q1, r2, v2, q2 ) % run and make movie
      AnimateSpacecraft( 'set scale' )             % set the spacecraft scale
      AnimateSpacecraft( 'reset camera' )          % reset the camera
      AnimateSpacecraft( 'replay' )                % replay the animation
      AnimateSpacecraft( 'list' )                  % list all the actions
      AnimateSpacecraft( 'close' )                 % find and close the window 

      AnimateSpacecraft( 'use lvlh', 'off' )       % untie camera to LVLH
      AnimateSpacecraft( 'max axes', 'off' )       % undo axes limits
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   action  (1,:) 'initialize' or 'update'
   t       (1,:) Time vector
   g       (.)   CAD data structures
   q1      (4,:) Quaternion from ECI to body
   r1      (3,:) ECI position vectors
   v1      (3,:) Velocity vectors
   jD0     (1,1) Initial epoch, Julian date
   target  (1,1) Index of target, object 1 or 2
   offset  (1,1) Camera offset distance (m)
   viewAngle (1,1) Camera view angle (deg)
   p        (.)  Planet struct

   -------
   Outputs
   -------
   m       (1,:) Movie file (optional)

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

Children:

AerospaceUtils: CAD/BHinge
AerospaceUtils: Coord/QLVLH
Orbit: OrbitCoord/El2RV
Orbit: OrbitCoord/RV2El
Orbit: OrbitSim/RVOrbGen
SC: Ephem/ISSOrbit
SC: Ephem/SunV1
SC: SCModels/ISS
SC: SCModels/SimpleSat
Common: General/ListCases
Common: Graphics/Arrow3D
Common: Graphics/NewFig
Common: Graphics/TimeLabl
Common: Quaternion/Q2Mat
Common: Quaternion/QTForm
Common: Transform/Eul2Mat
Math: Linear/Unit

Back to the SC Module page