Codegen for Satellite Constructor Using TLE
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
On R2021b, it looks as though codegen extracts the TLE in the file and hardcodes it in some header file. The .exe that is produced no longer uses the TLE file and does not even need it present. Is there an alternate constructor to use on the 'satellite' class that allows specifying each of the TLE mean elements at run time like the one there for Keplerian elements ( in lieu of reading from the file at compile time and not being able to update TLE entries daily / monthly without recompiling ) ?
0 Commenti
Risposte (1)
recent works
il 11 Mar 2024
Modificato: Walter Roberson
il 11 Mar 2024
In MATLAB's Aerospace Toolbox, the satellite class typically relies on Two-Line Element (TLE) sets to initialize the satellite orbit. As of my knowledge, the toolbox didn't offer a direct method to initialize the satellite using runtime-specified TLE elements without relying on file parsing or compile-time constants. However, you can implement a workaround to achieve your goal. You can create your own class or function that accepts the TLE elements as inputs and initializes the satellite accordingly. Here's a simplified example of how you might do this:
classdef CustomSatellite
properties
TLE; % Store TLE elements
SatelliteObject; % Store the satellite object
end
methods
% Constructor
function obj = CustomSatellite(TLE)
obj.TLE = TLE;
obj.SatelliteObject = satellite(obj.TLE);
end
% Other methods as needed
end
end
Then, you can create an instance of CustomSatellite by passing the TLE elements directly:
% Example TLE elements
TLE = [
'1 25544U 98067A 22068.07910936 .00001269 00000-0 33152-4 0 9997';
'2 25544 51.6450 130.0741 0002884 67.2005 85.3189 15.48857994318422'
];
% Create CustomSatellite object
customSat = CustomSatellite(TLE);
This way, you can pass the TLE elements dynamically at runtime without relying on hardcoded values or file parsing during compilation.
Vedere anche
Categorie
Scopri di più su CubeSat and Satellites in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!