From 18a62066ab7b6191852735e762184b113fcf6b67 Mon Sep 17 00:00:00 2001 From: Mattia Montanari Date: Tue, 18 Oct 2022 22:23:32 +0200 Subject: [PATCH 1/3] Point to source and include dir after repo refactor --- examples/matlab/runme.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/matlab/runme.m b/examples/matlab/runme.m index 1657436..bc1a1d1 100644 --- a/examples/matlab/runme.m +++ b/examples/matlab/runme.m @@ -38,11 +38,11 @@ end % TRY COMPILING MEX FILE fprintf('Compiling mex function... ') try -mex(fullfile('..','..','src','openGJK.c'),... % Source of openGJK +mex(fullfile('..','..','openGJK.c'),... % Source of openGJK '-largeArrayDims', ... % Support large arrays optflug, ... % Compiler flag for debug/optimisation - fullfile('-I..','..','include'),... % Folder to header files - '-outdir', pwd,... % Ouput directory for writing mex function + fullfile('-I','..','..','include'),... % Folder to header files + '-outdir', pwd, ... % Ouput directory for writing mex function '-output', 'openGJK',... % Name of ouput mex file '-DMATLAB_MEX_BUILD',... % Define variable for mex function in source files silflag ) % Silent/verbose flag From f70776dcdae03ab6e9227268e95520fdf2df8e73 Mon Sep 17 00:00:00 2001 From: Mattia Montanari Date: Tue, 18 Oct 2022 22:26:04 +0200 Subject: [PATCH 2/3] Renamed gjk to compute_minimum_distance for Matlab build --- openGJK.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openGJK.c b/openGJK.c index c5a0417..c430d9e 100644 --- a/openGJK.c +++ b/openGJK.c @@ -763,7 +763,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { s.nvrtx = 0; /* Compute squared distance using GJK algorithm */ - distance[0] = gjk(bd1, bd2, &s); + distance[0] = compute_minimum_distance(bd1, bd2, &s); mxFree(arr1); mxFree(arr2); From 5c72572fabb7053903e1c8e551fcbb5a9f41e08a Mon Sep 17 00:00:00 2001 From: Mattia Montanari Date: Wed, 19 Oct 2022 19:05:54 +0200 Subject: [PATCH 3/3] Correct typo on function name Replace mxCreategkFloatMatrix with mxCreateDoubleMatrix --- openGJK.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openGJK.c b/openGJK.c index c430d9e..d80cd99 100644 --- a/openGJK.c +++ b/openGJK.c @@ -730,7 +730,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { nCoordsB = mxGetN(prhs[1]); /* Create output */ - plhs[0] = mxCreategkFloatMatrix(1, 1, mxREAL); + plhs[0] = mxCreateDoubleMatrix(1, 1, mxREAL); /* get a pointer to the real data in the output matrix */ distance = mxGetPr(plhs[0]);