AnimateSpacecraft:

Path: SCPro/ProTools

% 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', v1, v2 )  % draw the velocity vectors
      AnimateSpacecraft( 'use lvlh', v1, v2 )      % tie camera to LVLH
      AnimateSpacecraft( 'set pause', dt )         % change the pause time
      AnimateSpacecraft( 'max axes' )              % set the axes limits apriori
      AnimateSpacecraft( 'add planet', p)          % Add a planet and use planet fixed coordinates
      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

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

   ------
   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)

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

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

Children:

AerospaceUtils: CAD/BHinge
AerospaceUtils: Coord/QLVLH
Orbit: OrbitMechanics/RVOrbGen
SC: BasicOrbit/El2RV
SC: BasicOrbit/RV2El
SC: Ephem/SunV1
SC: SCMat/EarthHR
SC: SCModels/ISS
SC: SCModels/SimpleSat
SC: Visualization/PlotPlanet
SCPro: MannedVehicle/ISSOrbit
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 SCPro Module page