diff --git a/compile_transformations.m b/compile_transformations.m index ee44512..68344ec 100644 --- a/compile_transformations.m +++ b/compile_transformations.m @@ -19,7 +19,13 @@ function compile_transformations() if isfile('miniVR_projection_wparameters.cpp') fprintf('================== Compiling miniVR_projection_wparameters ============\n'); - mex miniVR_projection_wparameters.cpp -R2018a + if ismac + % Newer Xcode linkers error on MATLAB's optional C++ MEX export + % symbols; the classic linker treats them as optional + mex('miniVR_projection_wparameters.cpp', '-R2018a', 'LDFLAGS=$LDFLAGS -Wl,-ld_classic'); + else + mex miniVR_projection_wparameters.cpp -R2018a + end end diff --git a/install_virmen.m b/install_virmen.m index fdacb2e..5120430 100644 --- a/install_virmen.m +++ b/install_virmen.m @@ -3,11 +3,13 @@ function install_virmen() [scriptDir,scriptName] = fileparts(mfilename('fullpath')); origLoc = cd(scriptDir); -fprintf(':: Copying git hooks...\n'); -copyfile('git-hooks/*', '.git/hooks'); +if exist('git-hooks', 'dir') + fprintf(':: Copying git hooks...\n'); + copyfile('git-hooks/*', '.git/hooks'); +end fprintf(':: Logging git status to version.txt...\n'); -system('git log -1 --pretty=oneline HEAD > $GIT_DIR/../version.txt'); +system('git log -1 --pretty=oneline HEAD > version.txt'); try @@ -35,14 +37,16 @@ function install_virmen() ' is properly configured, and then re-run ' scriptName '.\n' ... '\n\n' ... ]); - displayException(err); + disp(getReport(err)); end cd(scriptDir); if exist('extras/RigParameters.m', 'file') - system('start winmerge extras/RigParameters.m extras/RigParameters.m.example'); + if ispc + system('start winmerge extras/RigParameters.m extras/RigParameters.m.example'); + end fprintf(':: Please edit your existing RigParameters.m to match RigParameters.m.example.\n'); else copyfile('extras/RigParameters.m.example', 'extras/RigParameters.m'); diff --git a/sensors/calibrateBallMEX.m b/sensors/calibrateBallMEX.m index 39c8bf5..cb0651d 100644 --- a/sensors/calibrateBallMEX.m +++ b/sensors/calibrateBallMEX.m @@ -17,7 +17,7 @@ while true [dy1,dx1,dY,dX,dT] = arduinoReader('get'); arduinoReader('poll'); - java.lang.Thread.sleep(8); + pause(0.008); dx = dx + dX; dy = dy + dY; diff --git a/sensors/calibrateBallMEX_2sensors.m b/sensors/calibrateBallMEX_2sensors.m index db1f85e..1ec3b21 100644 --- a/sensors/calibrateBallMEX_2sensors.m +++ b/sensors/calibrateBallMEX_2sensors.m @@ -19,7 +19,7 @@ while true [dy1,dx1,dY,dX,dT] = arduinoReader('get'); arduinoReader('poll'); - java.lang.Thread.sleep(8); + pause(0.008); dx_bottom = dx_bottom + dX; dy_bottom = dy_bottom + dY; diff --git a/sensors/serialCommunications/compile_serialcomm.m b/sensors/serialCommunications/compile_serialcomm.m index 30a6bc9..bcc6c38 100644 --- a/sensors/serialCommunications/compile_serialcomm.m +++ b/sensors/serialCommunications/compile_serialcomm.m @@ -1,5 +1,11 @@ function compile_serialcomm() + % Serial.cpp uses the Windows COM-port API + if ~ispc + fprintf('!! WARNING: Serial communications MEX is only supported on Windows. Doing nothing.\n'); + return; + end + % Compilation options mexOpts = {'-O'};