Unable to draw the given inter-satellite path.
I wrote a Python script and got a path selection at a certain point as [‘Satellite_185’, ‘Satellite_113’, ‘Satellite_162’, ‘Satellite_108’, ‘Satellite_87’, ‘Satellite_68’, ‘Satellite_305’, ‘Satellite_335’, ‘Satellite_384’]. Then I wrote the following MATLAB code, but it gets stuck at the simulation scene step. I suspect it’s because of the time issue, but I can’t fix it.
% Create Satellite Scenario
startTime = datetime(2021,12,10,18,27,57); % 10 December 2021, 6:27:57 PM UTC
stopTime = startTime + hours(3); % 10 December 2021, 9:27:57 PM UTC
sampleTime = 60; % Seconds
sc = satelliteScenario(startTime,stopTime,sampleTime,"AutoSimulate",false);
% Load the entire constellation, but we’ll only use the specified relay satellites
satellites = satellite(sc,"largeConstellation2.tle");
% Known relay satellite names or identifiers (assuming you have them)
% If you only have indices, you’ll need to map them to satellite objects somehow
% Here we assume you have the satellite objects directly
% relaySats = {…}; % This should be filled with the actual satellite objects
% Example: relaySats = {satellites(10), satellites(20), satellites(30)};
% But since you likely have names or other identifiers, you’ll need to find them
% Or, if you have indices into the ‘satellites’ array
relaySatsIndices = [185, 113, 162, 108, 87, 68, 305, 335, 384]; % Example indices
relaySats = satellites(relaySatsIndices);
% Add Ground Stations
gsSource = groundStation(sc,42.3001,-71.3504, "Name","Source Ground Station");
gsTarget = groundStation(sc,17.4351,78.3824, "Name","Target Ground Station");
% Build the path using the known relay satellite sequence
pathNodes = {gsSource, relaySats, gsTarget};
% Visualize Path
sc.AutoSimulate = true;
ac = access(pathNodes{:});
ac.LineColor = "red";
% Determine Intervals When Calculated Path Can Be Used (if needed)
% intvls = accessIntervals(ac); % Uncomment this line if you need the access intervals
% Create satellite scenario viewer
v = satelliteScenarioViewer(sc,"ShowDetails",false);
% Note: Setting MarkerSize directly on the satellites object may not work as expected.
% Instead, adjust the visualization properties in the viewer or use a loop to set markers.
% Play the scenario
play(sc);
The code above references part of the code from this website:https://www.mathworks.com/help/satcom/ug/multihop-path-select-through-sat-constellation.html
This picture is my stuck interface after running in matlab.I wrote a Python script and got a path selection at a certain point as [‘Satellite_185’, ‘Satellite_113’, ‘Satellite_162’, ‘Satellite_108’, ‘Satellite_87’, ‘Satellite_68’, ‘Satellite_305’, ‘Satellite_335’, ‘Satellite_384’]. Then I wrote the following MATLAB code, but it gets stuck at the simulation scene step. I suspect it’s because of the time issue, but I can’t fix it.
% Create Satellite Scenario
startTime = datetime(2021,12,10,18,27,57); % 10 December 2021, 6:27:57 PM UTC
stopTime = startTime + hours(3); % 10 December 2021, 9:27:57 PM UTC
sampleTime = 60; % Seconds
sc = satelliteScenario(startTime,stopTime,sampleTime,"AutoSimulate",false);
% Load the entire constellation, but we’ll only use the specified relay satellites
satellites = satellite(sc,"largeConstellation2.tle");
% Known relay satellite names or identifiers (assuming you have them)
% If you only have indices, you’ll need to map them to satellite objects somehow
% Here we assume you have the satellite objects directly
% relaySats = {…}; % This should be filled with the actual satellite objects
% Example: relaySats = {satellites(10), satellites(20), satellites(30)};
% But since you likely have names or other identifiers, you’ll need to find them
% Or, if you have indices into the ‘satellites’ array
relaySatsIndices = [185, 113, 162, 108, 87, 68, 305, 335, 384]; % Example indices
relaySats = satellites(relaySatsIndices);
% Add Ground Stations
gsSource = groundStation(sc,42.3001,-71.3504, "Name","Source Ground Station");
gsTarget = groundStation(sc,17.4351,78.3824, "Name","Target Ground Station");
% Build the path using the known relay satellite sequence
pathNodes = {gsSource, relaySats, gsTarget};
% Visualize Path
sc.AutoSimulate = true;
ac = access(pathNodes{:});
ac.LineColor = "red";
% Determine Intervals When Calculated Path Can Be Used (if needed)
% intvls = accessIntervals(ac); % Uncomment this line if you need the access intervals
% Create satellite scenario viewer
v = satelliteScenarioViewer(sc,"ShowDetails",false);
% Note: Setting MarkerSize directly on the satellites object may not work as expected.
% Instead, adjust the visualization properties in the viewer or use a loop to set markers.
% Play the scenario
play(sc);
The code above references part of the code from this website:https://www.mathworks.com/help/satcom/ug/multihop-path-select-through-sat-constellation.html
This picture is my stuck interface after running in matlab. I wrote a Python script and got a path selection at a certain point as [‘Satellite_185’, ‘Satellite_113’, ‘Satellite_162’, ‘Satellite_108’, ‘Satellite_87’, ‘Satellite_68’, ‘Satellite_305’, ‘Satellite_335’, ‘Satellite_384’]. Then I wrote the following MATLAB code, but it gets stuck at the simulation scene step. I suspect it’s because of the time issue, but I can’t fix it.
% Create Satellite Scenario
startTime = datetime(2021,12,10,18,27,57); % 10 December 2021, 6:27:57 PM UTC
stopTime = startTime + hours(3); % 10 December 2021, 9:27:57 PM UTC
sampleTime = 60; % Seconds
sc = satelliteScenario(startTime,stopTime,sampleTime,"AutoSimulate",false);
% Load the entire constellation, but we’ll only use the specified relay satellites
satellites = satellite(sc,"largeConstellation2.tle");
% Known relay satellite names or identifiers (assuming you have them)
% If you only have indices, you’ll need to map them to satellite objects somehow
% Here we assume you have the satellite objects directly
% relaySats = {…}; % This should be filled with the actual satellite objects
% Example: relaySats = {satellites(10), satellites(20), satellites(30)};
% But since you likely have names or other identifiers, you’ll need to find them
% Or, if you have indices into the ‘satellites’ array
relaySatsIndices = [185, 113, 162, 108, 87, 68, 305, 335, 384]; % Example indices
relaySats = satellites(relaySatsIndices);
% Add Ground Stations
gsSource = groundStation(sc,42.3001,-71.3504, "Name","Source Ground Station");
gsTarget = groundStation(sc,17.4351,78.3824, "Name","Target Ground Station");
% Build the path using the known relay satellite sequence
pathNodes = {gsSource, relaySats, gsTarget};
% Visualize Path
sc.AutoSimulate = true;
ac = access(pathNodes{:});
ac.LineColor = "red";
% Determine Intervals When Calculated Path Can Be Used (if needed)
% intvls = accessIntervals(ac); % Uncomment this line if you need the access intervals
% Create satellite scenario viewer
v = satelliteScenarioViewer(sc,"ShowDetails",false);
% Note: Setting MarkerSize directly on the satellites object may not work as expected.
% Instead, adjust the visualization properties in the viewer or use a loop to set markers.
% Play the scenario
play(sc);
The code above references part of the code from this website:https://www.mathworks.com/help/satcom/ug/multihop-path-select-through-sat-constellation.html
This picture is my stuck interface after running in matlab. large satellite constellation MATLAB Answers — New Questions