Carleton-SRCL / SPOT

Spacecraft Proximity Operations Testbed
7 stars 18 forks source link

Manually Copy & Run Compiled Executable on Pi #3

Closed TheElectricDream closed 3 years ago

TheElectricDream commented 3 years ago

GUI should, upon clicking "Deploy Code," copy the compiled .elf file to the proper raspberry Pis. This way, Matlab won't generate a ridiculous file structure on the Pi which leads to outdated versions of the diagram being run when users generate code from different directories on the Ground Station.

Then, Begin Experiment should run said executable on the desired Pis simultaneously.

TheElectricDream commented 3 years ago

This issue is now resolved via the following code present in all GUIs going forward:

RED = raspberrypi('192.168.0.100','pi','raspberry');
rtwbuild(FileName(1:(end-4)));
putFile(RED,[cd '\' FileName(1:(end-4)) '.elf'],['/home/pi/ExperimentSoftware/MATLAB_ws/R2020a/' FileName(1:(end-4)) '.elf']);
assignin('base','simMode',1);

This code segment builds the diagram, and then manually places the .elf file into the correct directory. The runModel command looks for models in /home/pi/ExperimentSoftware/MATLAB_ws/R2020a/.