- Add satellites to satellite scenario: https://mathworks.com/help/aerotbx/ug/satellitescenario.satellite.html
- Read data from Galileo XML almanac File: https://mathworks.com/help/nav/ref/galalmanacread.html?s_tid=srchtitle_site_search_1_galalmanacread
How to add Galileo almanac (xml) to satellite?
3 views (last 30 days)
Show older comments
Hello
I have to simulate the Galileo constellation using the xml almanacs here: https://www.gsc-europa.eu/gsc-products/almanac.
I am importing the almanacs using the galalmanacread() function, however, when I try to use the satellite() function to add these satellites to the satellite scenario I get the following error:
Error using satelliteScenario/satellite
Unable to add satellite to the satelliteScenario because the specified SEM file is invalid.
Error in Main_Galileo_Outage_4July2024_v1 (line 28)
sat = satellite(sc,SatFileName) % adding GNSS satellites to the scenario
Caused by:
Error using matlabshared.internal.gnss.readSEMAlmanac
Header must contain number of records, GPS week number, and GPS time of applicability.
I am reading the file as an xml galileo almanac, not sure why I am getting the SEM file error.
Can anyone help on adding the satellites from galileo almanac (xml) files?
Thanks
0 Comments
Answers (1)
Shubham
on 11 Jul 2024
Hi Babar,
I understand that you are trying to read a XML almanac from a source and want to simulate Galileo constellation.
The error you are encountering is because you are directly using the output of the "galmanacread" function as the input arguments of the "satellite" function.
The “satellite” object takes Keplerian elements as input argument to add a satellite to “satelliteScenario” object.
A custom function convertXmlFormatted can be used, which converts the data of XML almanac present on the source website to the required structure format to be given as input argument to the “satellite” object.
Below is the MATLAB script file to handle semData:
% Step 1: Read the almanac data
almanacData = galalmanacread('dataSat.xml');
% Step 2: Convert the almanac data to formatted format
semData = convertXmlFormatted(almanacData);
% Extract satellite data from semData
satelliteID = semData.SatelliteID;
eccentricity = double(semData.Eccentricity);
inclination = double(semData.Inclination);
raan = double(semData.RAAN);
argumentOfPerigee = double(semData.ArgumentOfPerigee);
meanAnomaly = double(semData.MeanAnomaly);
semiMajorAxis = double(semData.SemiMajorAxis);
gpsWeek = double(semData.GPSWeek);
gpsTimeOfApplicability = double(semData.GPSTimeOfApplicability);
% Define the Keplerian elements for the satellite
keplerianElements = [semiMajorAxis; eccentricity; inclination; ...
raan; argumentOfPerigee; meanAnomaly];
"keplerianElements" can be used as an input argument to add a "satellite" object in "satelliteScenario".
Attaching the links to documentation, these might help:
0 Comments
See Also
Categories
Find more on Satellite Mission Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!