Closed TheElectricDream closed 1 month ago
First, the easy one -- Mac OS paths use the forward slash, Windows paths use the backward slash.
Affected files:
Setup_Environment.m
GUI_v4_0_Main.mlapp
One possible fix is to replace all path-related uses of backslash with the filesep
command:
filesep in MATLAB
Also possible to build paths using the fullfile
command:
fullfile in MATLAB
...according to this thread, we could just YOLO and only use forward slashes: forward slash thread
Second, as the NVIDIA add-on isn't currently supported for Mac OS, experiments are not possible AND simulations need a few more things commented out:
HardwareBoard lines in GUI_v4_0_Main.mlapp
the project *.slx
file, blocks corresponding to experiment logic and the NVIDIA interface.
Commented lines in the GUI:
1973: setParam(activeConfigObj,'HardwareBoard','None');
1999: setParam(activeConfigObj,'HardwareBoard','NVIDIA Jetson');
Commented Simulink blocks:
> Check Connection
> PhaseSpace Camera Code > Use Hardware to Obtain States
> Send Data to TX2
> Thruster Control Code > UDP Send
@TheElectricDream , let's see how we can do this in an efficient manner.
Per the comments above, I've made changes to three files:
SetupEnvironment.m
GUI_v4_0_Main.mlapp
BetaMacs.slx
(my project copy of the template)
I've pushed the changes to my SPOT fork: https://github.com/adamvigneron/AdamVigneron-SPOT/commit/2eeefe4f9d93ccc0c31c05fe6068f345f108d513
where it's possible to see the plaintext M-file changes but not possible to see the binary changes. Luckily, the binary files can be compared to their Template_Files/
equivalents using MATLAB functionality for File Compare.
How do you want to go about capturing this in the wiki? How do you want to go about capturing this in the codebase?
I have create a Wiki entry on this subject here: https://github.com/Carleton-SRCL/SPOT/wiki/Regarding-MacOS-Compatibility
However, we will not be creating and supporting a MacOS compatible diagram - I do not have a MacOS system available and the lab stance is that it should not be used with SPOT. I've entered the steps as you laid out in the Wiki entry, but these steps may change with future versions and I will not dedicate time to keeping those steps up to date. Users who simply MUST use MacOS should expect to be on their own and will need to sort out compatibility on a case-by-case basis.
The wiki entry looks great, thanks Alex!
As discussed, there are two additional code snippets we could add to GUI_v4_0_Main.mlapp:
if ismac
fprintf('GUI_v4_0_Main.StartSimulationButtonPushed:\n');
fprintf(' MATLAB Coder for NVIDIA unavailable on Mac OS;\n');
fprintf(' pre-simulation switch of HardwareBoard disabled.\n\n')
else
set_param(activeConfigObj,'HardwareBoard','None');
end
if ismac
fprintf('GUI_v4_0_Main.StartSimulationButtonPushed:\n');
fprintf(' MATLAB Coder for NVIDIA unavailable on Mac OS;\n');
fprintf(' post-simulation switch of HardwareBoard disabled.\n\n')
else
set_param(activeConfigObj,'HardwareBoard','NVIDIA Jetson');
end
Title is self-explanatory