A very simple spacecraft with one sensor.
------------------------------------------------------------------------- See also BuildCADModel, CreateBody, CreateComponent, FindDirectory, SaveStructure -------------------------------------------------------------------------
Contents
%-------------------------------------------------------------------------- % Copyright (c) 2005, 2007 Princeton Satellite Systems, Inc. % All rights reserved. %--------------------------------------------------------------------------
Initialize
%------------ BuildCADModel( 'initialize' ); % Add spacecraft properties %--------------------------- BuildCADModel( 'set name' , 'Simple Spacecraft' ); BuildCADModel( 'set units', 'mks' ); % Create bodies first %--------------------- m = CreateBody( 'make', 'name', 'Core' ); BuildCADModel('add body', m ); % This creates the connections between the bodies %------------------------------------------------- BuildCADModel( 'compute paths' );
Add Components
%---------------- % Core %------ m = CreateComponent( 'make', 'box', 'name', 'Panels', 'x', 1, 'y', 1, 'z', 1,... 'faceColor', 'gold foil','inside',0,... 'rA', [0;0;0], 'mass', 20, 'body', 1 ); BuildCADModel( 'add component', m ); % Star Camera %------------- m = CreateComponent( 'make', 'star camera', 'model', 'ct633', 'name', 'Camera',... 'rA', [0.4;0.4;0.4], 'body', 1, 'boresight',[1;0;0], ... 'faceColor', 'aluminum', 'inside', 0 ); BuildCADModel( 'add component', m );
Save the model
%---------------- g = BuildCADModel( 'get cad model' ); BuildCADModel( 'show spacecraft' ); d = FindDirectory('SCModels'); SaveStructure( g, fullfile(d,'SimpleSat') ) %--------------------------------------