Unable to draw the given inter-satellite path.
150 次查看(过去 30 天)
显示 更早的评论
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1743061/image.png)
This picture is my stuck interface after running in matlab.
5 个评论
Govind KM
2024-8-2,11:19
@sun,
I am able to reproduce the issue at my end. The code executes properly when other .tle files are used to load the satellite data, such as the .tle file in your linked example. This indicates that your .tle file might contain invalid data, leading to the code stalling at the simulation phase. Kindly review the data in your .tle file for any errors.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scenario Generation and Visualization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!