Codegen for Satellite Constructor Using TLE
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
recent works
2024-3-11
编辑:Walter Roberson
2024-3-11
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 CubeSat and Satellites 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!