Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix matlab bindings issue #675 #676

Merged
merged 2 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions bindings/matlab/autogenerated/iDynTreeMATLAB_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3255,7 +3255,7 @@ SWIGINTERN void iDynTree_MatrixDynSize_fromMatlab(iDynTree::MatrixDynSize *self,

if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -3521,7 +3521,7 @@ SWIGINTERN void iDynTree_VectorDynSize_fromMatlab(iDynTree::VectorDynSize *self,

if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -3583,7 +3583,7 @@ SWIGINTERN void iDynTree_MatrixFixSize_Sl_1_Sc_6_Sg__fromMatlab(iDynTree::Matrix
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -3646,7 +3646,7 @@ SWIGINTERN void iDynTree_MatrixFixSize_Sl_2_Sc_3_Sg__fromMatlab(iDynTree::Matrix
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -3709,7 +3709,7 @@ SWIGINTERN void iDynTree_MatrixFixSize_Sl_3_Sc_3_Sg__fromMatlab(iDynTree::Matrix
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -3772,7 +3772,7 @@ SWIGINTERN void iDynTree_MatrixFixSize_Sl_4_Sc_4_Sg__fromMatlab(iDynTree::Matrix
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -3835,7 +3835,7 @@ SWIGINTERN void iDynTree_MatrixFixSize_Sl_6_Sc_6_Sg__fromMatlab(iDynTree::Matrix
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -3898,7 +3898,7 @@ SWIGINTERN void iDynTree_MatrixFixSize_Sl_6_Sc_10_Sg__fromMatlab(iDynTree::Matri
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -3961,7 +3961,7 @@ SWIGINTERN void iDynTree_MatrixFixSize_Sl_10_Sc_16_Sg__fromMatlab(iDynTree::Matr
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,43,MATRIXSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -4025,7 +4025,7 @@ SWIGINTERN void iDynTree_VectorFixSize_Sl_3_Sg__fromMatlab(iDynTree::VectorFixSi
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -4091,7 +4091,7 @@ SWIGINTERN void iDynTree_VectorFixSize_Sl_4_Sg__fromMatlab(iDynTree::VectorFixSi
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -4157,7 +4157,7 @@ SWIGINTERN void iDynTree_VectorFixSize_Sl_6_Sg__fromMatlab(iDynTree::VectorFixSi
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -4223,7 +4223,7 @@ SWIGINTERN void iDynTree_VectorFixSize_Sl_10_Sg__fromMatlab(iDynTree::VectorFixS
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -4289,7 +4289,7 @@ SWIGINTERN void iDynTree_VectorFixSize_Sl_16_Sg__fromMatlab(iDynTree::VectorFixS
{
if (mxIsSparse(in))
{
/*@SWIG:/home/iiticublap138/shared-folder/dev/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
/*@SWIG:/Users/lorenzorapetti/Software/robotology-superbuild/robotology/iDynTree/bindings/./matlab/matlab_matvec.i,6,VECTORSPARSECOPY@*/
//getting pointer to sparse structure
mwIndex* ir = mxGetIr(in);
mwIndex* jc = mxGetJc(in);
Expand Down Expand Up @@ -4542,10 +4542,10 @@ SWIGINTERN std::vector< iDynTree::MatrixFixSize< 4,4 > >::iterator std_vector_Sl
SWIGINTERN void std_vector_Sl_iDynTree_Matrix4x4_Sg__insert__SWIG_1(std::vector< iDynTree::Matrix4x4 > *self,std::vector< iDynTree::MatrixFixSize< 4,4 > >::iterator pos,std::vector< iDynTree::MatrixFixSize< 4,4 > >::size_type n,std::vector< iDynTree::MatrixFixSize< 4,4 > >::value_type const &x){ self->insert(pos, n, x); }
SWIGINTERN mxArray *std_vector_Sl_iDynTree_Matrix4x4_Sg__toMatlab(std::vector< iDynTree::Matrix4x4 > const *self){
const mwSize NDIMS=3;
int nMatrices=self->size();
mwSize nMatrices=self->size();
std::vector<iDynTree::Matrix4x4> :: const_iterator it =self->begin();
int nRows=it->rows();
int nCols=it->cols();
mwSize nRows=it->rows();
mwSize nCols=it->cols();
const mwSize dims[]={nMatrices,nRows,nCols};
mxArray *p = mxCreateNumericArray(NDIMS,dims,mxDOUBLE_CLASS,mxREAL);
double* d = static_cast<double*>(mxGetData(p));
Expand All @@ -4561,7 +4561,7 @@ SWIGINTERN mxArray *std_vector_Sl_iDynTree_Matrix4x4_Sg__toMatlab(std::vector< i
d[overall_index]=content[index_sequence];
}
}
//free(content); //Tried to free the pointer but got error.

++it;
}

Expand Down
6 changes: 3 additions & 3 deletions bindings/matlab/matlab_mat4x4vec.i
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
mxArray * toMatlab() const
{
const mwSize NDIMS=3;
int nMatrices=$self->size();
mwSize nMatrices=$self->size();
std::vector<iDynTree::Matrix4x4> :: const_iterator it =$self->begin();
int nRows=it->rows();
int nCols=it->cols();
mwSize nRows=it->rows();
mwSize nCols=it->cols();
const mwSize dims[]={nMatrices,nRows,nCols};
mxArray *p = mxCreateNumericArray(NDIMS,dims,mxDOUBLE_CLASS,mxREAL);
double* d = static_cast<double*>(mxGetData(p));
Expand Down