Skip to content

Commit

Permalink
MATLAB bindings: add iDynTree prefix to SwigRef, SwigMem and SwigGet …
Browse files Browse the repository at this point in the history
…to avoid conflicts with CasADi (#868)

* MATLAB bindings: add iDynTree prefix to SwigRef, SwigMem and SwigGet to avoid conflicts with CasADi
  • Loading branch information
traversaro authored May 15, 2021
1 parent 9b783cd commit e8087cc
Show file tree
Hide file tree
Showing 153 changed files with 366 additions and 325 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/regenerate-matlab-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ jobs:
cmake -DIDYNTREE_USES_ASSIMP:BOOL=ON -DIDYNTREE_USES_IPOPT:BOOL=ON -DIDYNTREE_USES_IRRLICHT:BOOL=ON -DIDYNTREE_USES_OCTAVE:BOOL=ON -DIDYNTREE_GENERATE_MATLAB:BOOL=ON ..
cat CMakeCache.txt
make
# After bindings are generated, we modify the names of generic files to avoid conflicts with CasADi
cd ../bindings/matlab
./fix_generic_names_in_autogenerated_files.sh
- name: Check local changes due to bindings generation
run: |
git status
Expand Down
17 changes: 10 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Changelog
All notable changes to this project will be documented in this file.

Expand All @@ -7,7 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.1.0] - 2020-04-23
## [3.2.0] - 2021-05-15

### Changed
- The `SwigRef.m`, `SwigMem.m` and `SwigGet.m` MATLAB files are now named `iDynTreeSwigRef.m`, `iDynTreeSwigMem.m` and `iDynTreeSwigGet.m`. This ensure prevent the possibility that other libraries (such as CasADi) install files with the same name in the MATLAB path with incompatible content (https://github.com/robotology/idyntree/issues/865, https://github.com/robotology/idyntree/pull/868).

## [3.1.0] - 2021-04-23

### Added
- Add the possibility to use `MatrixView` and `Span` as input/output objects for `InverseKinematics` class (https://github.com/robotology/idyntree/pull/822).
Expand All @@ -22,12 +26,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Dynamics: In RNEA Dynamic Loop, return zero for wrench corresponding to non-existing parent joint of base link (https://github.com/robotology/idyntree/pull/857).
- Fixed compilation when using Eigen 3.4 (https://github.com/robotology/idyntree/pull/861).

## [3.0.2] - 2020-04-11
## [3.0.2] - 2021-04-11

### Fixed
- Fixed compilation of Python bindings on Windows (https://github.com/robotology/idyntree/pull/843).

## [3.0.1] - 2020-03-11
## [3.0.1] - 2021-03-11

### Fixed
- Fixed the `IDYNTREE_USES_ASSIMP` option on Windows if `IDYNTREE_USES_YARP` is also enabled (https://github.com/robotology/idyntree/pull/832).
Expand All @@ -38,8 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
- The method `ModelVisualization::getWorldModelTransform()` is deprecated, and will be removed in iDynTree 4.0.

## [3.0.0] - 2020-02-03

## [3.0.0] - 2021-02-03
### Added
- Add the possibility to plot and update frames in the Matlab visualizer.
- Added ``getFileLocationOnLocalFileSystem`` method in ``ExternalMesh`` that attempts to find the mesh location in the local file system. This is now used by the ``Visualizer`` when loading the robot model (https://github.com/robotology/idyntree/pull/798). This can also be used by the `iDynTreeWrapper.prepareVisualization` MATLAB function, if `meshFilePrefix` is explicitly set to `""` (https://github.com/robotology/idyntree/pull/817).
Expand All @@ -54,7 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed the `IDYNTREE_USES_IRRLICHT` option when `irrlicht` is installed via vcpkg (https://github.com/robotology/idyntree/pull/806).


## [2.0.3] - 2020-02-03
## [2.0.3] - 2021-02-03

### Fixed
- Fixed use of sphere shape in MATLAB-based Visualizer (https://github.com/robotology/idyntree/pull/796).
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

cmake_minimum_required(VERSION 3.16)

project(iDynTree VERSION 3.1.0
project(iDynTree VERSION 3.2.0
LANGUAGES C CXX)

# Disable in source build, unless Eclipse is used
Expand Down
21 changes: 15 additions & 6 deletions bindings/matlab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ endmacro()
# COMPILE MATLAB
# ==============

# The SwigRef, SwigGet and SwigMem files are prefix with iDynTree
# by the fix_generic_names_in_autogenerated_files.sh script, but
# if we are generating the bindings we need to use the unprefix one
if(IDYNTREE_GENERATE_MATLAB)
set(SwigHelpersPrefix "")
else()
set(SwigHelpersPrefix "iDynTree")
endif()

if(IDYNTREE_USES_MATLAB)
find_package(Matlab REQUIRED)

Expand All @@ -110,9 +119,9 @@ if(IDYNTREE_USES_MATLAB)
DESTINATION ${CMAKE_INSTALL_PREFIX}/${IDYNTREE_INSTALL_MATLAB_MFILESDIR})
install(
FILES
${MEX_BINDINGS_SOURCE_DIR}/SwigGet.m
${MEX_BINDINGS_SOURCE_DIR}/SwigRef.m
${MEX_BINDINGS_SOURCE_DIR}/SwigMem.m
${MEX_BINDINGS_SOURCE_DIR}/${SwigHelpersPrefix}SwigGet.m
${MEX_BINDINGS_SOURCE_DIR}/${SwigHelpersPrefix}SwigRef.m
${MEX_BINDINGS_SOURCE_DIR}/${SwigHelpersPrefix}SwigMem.m
DESTINATION
${CMAKE_INSTALL_PREFIX}/${IDYNTREE_INSTALL_MATLAB_MFILESDIR})
install(
Expand Down Expand Up @@ -173,9 +182,9 @@ if(IDYNTREE_USES_OCTAVE)
DESTINATION ${CMAKE_INSTALL_PREFIX}/${IDYNTREE_INSTALL_OCTAVE_MFILESDIR})
install(
FILES
${MEX_BINDINGS_SOURCE_DIR}/SwigGet.m
${MEX_BINDINGS_SOURCE_DIR}/SwigRef.m
${MEX_BINDINGS_SOURCE_DIR}/SwigMem.m
${MEX_BINDINGS_SOURCE_DIR}/${SwigHelpersPrefix}SwigGet.m
${MEX_BINDINGS_SOURCE_DIR}/${SwigHelpersPrefix}SwigRef.m
${MEX_BINDINGS_SOURCE_DIR}/${SwigHelpersPrefix}SwigMem.m
DESTINATION
${CMAKE_INSTALL_PREFIX}/${IDYNTREE_INSTALL_OCTAVE_MFILESDIR})

Expand Down
4 changes: 2 additions & 2 deletions bindings/matlab/autogenerated/+iDynTree/AccelerometerSensor.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
classdef AccelerometerSensor < iDynTree.LinkSensor
methods
function self = AccelerometerSensor(varargin)
self@iDynTree.LinkSensor(SwigRef.Null);
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
self@iDynTree.LinkSensor(iDynTreeSwigRef.Null);
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
classdef ArticulatedBodyAlgorithmInternalBuffers < SwigRef
classdef ArticulatedBodyAlgorithmInternalBuffers < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
end
function self = ArticulatedBodyAlgorithmInternalBuffers(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
classdef ArticulatedBodyInertia < SwigRef
classdef ArticulatedBodyInertia < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
end
function self = ArticulatedBodyInertia(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef AttitudeEstimatorState < SwigRef
classdef AttitudeEstimatorState < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
Expand Down Expand Up @@ -34,7 +34,7 @@
end
end
function self = AttitudeEstimatorState(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
classdef AttitudeMahonyFilter < iDynTree.IAttitudeEstimator
methods
function self = AttitudeMahonyFilter(varargin)
self@iDynTree.IAttitudeEstimator(SwigRef.Null);
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
self@iDynTree.IAttitudeEstimator(iDynTreeSwigRef.Null);
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef AttitudeMahonyFilterParameters < SwigRef
classdef AttitudeMahonyFilterParameters < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
Expand Down Expand Up @@ -54,7 +54,7 @@
end
end
function self = AttitudeMahonyFilterParameters(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
this = iDynTreeMEX(3, self);
end
function self = AttitudeQuaternionEKF(varargin)
self@iDynTree.IAttitudeEstimator(SwigRef.Null);
self@iDynTree.DiscreteExtendedKalmanFilterHelper(SwigRef.Null);
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
self@iDynTree.IAttitudeEstimator(iDynTreeSwigRef.Null);
self@iDynTree.DiscreteExtendedKalmanFilterHelper(iDynTreeSwigRef.Null);
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef AttitudeQuaternionEKFParameters < SwigRef
classdef AttitudeQuaternionEKFParameters < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
Expand Down Expand Up @@ -104,7 +104,7 @@
end
end
function self = AttitudeQuaternionEKFParameters(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
4 changes: 2 additions & 2 deletions bindings/matlab/autogenerated/+iDynTree/Axis.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
classdef Axis < SwigRef
classdef Axis < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
end
function self = Axis(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef BerdyDynamicVariable < SwigRef
classdef BerdyDynamicVariable < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
Expand Down Expand Up @@ -40,7 +40,7 @@
[varargout{1:nargout}] = iDynTreeMEX(1540, self, varargin{:});
end
function self = BerdyDynamicVariable(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef BerdyDynamicVariables < SwigRef
classdef BerdyDynamicVariables < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
Expand Down Expand Up @@ -49,7 +49,7 @@
[varargout{1:nargout}] = iDynTreeMEX(110, self, varargin{:});
end
function self = BerdyDynamicVariables(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
4 changes: 2 additions & 2 deletions bindings/matlab/autogenerated/+iDynTree/BerdyHelper.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
classdef BerdyHelper < SwigRef
classdef BerdyHelper < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
end
function self = BerdyHelper(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
4 changes: 2 additions & 2 deletions bindings/matlab/autogenerated/+iDynTree/BerdyOptions.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
classdef BerdyOptions < SwigRef
classdef BerdyOptions < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
end
function self = BerdyOptions(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
4 changes: 2 additions & 2 deletions bindings/matlab/autogenerated/+iDynTree/BerdySensor.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef BerdySensor < SwigRef
classdef BerdySensor < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
Expand Down Expand Up @@ -40,7 +40,7 @@
[varargout{1:nargout}] = iDynTreeMEX(1530, self, varargin{:});
end
function self = BerdySensor(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
4 changes: 2 additions & 2 deletions bindings/matlab/autogenerated/+iDynTree/BerdySensors.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef BerdySensors < SwigRef
classdef BerdySensors < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
Expand Down Expand Up @@ -49,7 +49,7 @@
[varargout{1:nargout}] = iDynTreeMEX(85, self, varargin{:});
end
function self = BerdySensors(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
classdef BerdySparseMAPSolver < SwigRef
classdef BerdySparseMAPSolver < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
end
function self = BerdySparseMAPSolver(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
4 changes: 2 additions & 2 deletions bindings/matlab/autogenerated/+iDynTree/Box.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ function delete(self)
[varargout{1:nargout}] = iDynTreeMEX(1016, self, varargin{:});
end
function self = Box(varargin)
self@iDynTree.SolidShape(SwigRef.Null);
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
self@iDynTree.SolidShape(iDynTreeSwigRef.Null);
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
4 changes: 2 additions & 2 deletions bindings/matlab/autogenerated/+iDynTree/ClassicalAcc.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
classdef ClassicalAcc < iDynTree.Vector6
methods
function self = ClassicalAcc(varargin)
self@iDynTree.Vector6(SwigRef.Null);
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
self@iDynTree.Vector6(iDynTreeSwigRef.Null);
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
4 changes: 2 additions & 2 deletions bindings/matlab/autogenerated/+iDynTree/ColorViz.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef ColorViz < SwigRef
classdef ColorViz < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
Expand Down Expand Up @@ -44,7 +44,7 @@
end
end
function self = ColorViz(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
4 changes: 2 additions & 2 deletions bindings/matlab/autogenerated/+iDynTree/ContactWrench.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef ContactWrench < SwigRef
classdef ContactWrench < iDynTreeSwigRef
methods
function this = swig_this(self)
this = iDynTreeMEX(3, self);
Expand All @@ -13,7 +13,7 @@
[varargout{1:nargout}] = iDynTreeMEX(1141, self, varargin{:});
end
function self = ContactWrench(varargin)
if nargin==1 && strcmp(class(varargin{1}),'SwigRef')
if nargin==1 && strcmp(class(varargin{1}),'iDynTreeSwigRef')
if ~isnull(varargin{1})
self.swigPtr = varargin{1}.swigPtr;
end
Expand Down
Loading

0 comments on commit e8087cc

Please sign in to comment.