diff --git a/CHANGELOG.md b/CHANGELOG.md index be78d0638d..d91d865c7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -124,6 +124,9 @@ The following errors are currently check: ### Changed - No warning is printed if a sensor not supported by iDynTree is found in an URDF file (https://github.com/robotology/idyntree/pull/997). +### Fixed +- Fix `iDynTreeWrappers.loadReducedModel` when `model_path` argument does not end in `\` (https://github.com/robotology/idyntree/pull/1126). + ## [5.2.1] - 2022-05-19 ### Fixed diff --git a/bindings/matlab/+iDynTreeWrappers/loadReducedModel.m b/bindings/matlab/+iDynTreeWrappers/loadReducedModel.m index ef1c9329e6..66522b3c06 100644 --- a/bindings/matlab/+iDynTreeWrappers/loadReducedModel.m +++ b/bindings/matlab/+iDynTreeWrappers/loadReducedModel.m @@ -23,7 +23,7 @@ % SPDX-License-Identifier: BSD-3-Clause %% ------------Initialization---------------- - disp(['[loadReducedModel]: loading the following model: ',[modelPath,modelName]]); + disp(['[loadReducedModel]: loading the following model: ',fullfile(modelPath,modelName)]); % if DEBUG option is set to TRUE, all the wrappers will be run in debug % mode. Wrappers concerning iDyntree simulator have their own debugger @@ -44,7 +44,7 @@ modelLoader = iDynTree.ModelLoader(); reducedModel = modelLoader.model(); - modelLoader.loadReducedModelFromFile([modelPath,modelName], jointList_idyntree); + modelLoader.loadReducedModelFromFile(fullfile(modelPath,modelName), jointList_idyntree); % get the number of degrees of freedom of the reduced model KinDynModel.NDOF = reducedModel.getNrOfDOFs(); @@ -58,5 +58,5 @@ % set the floating base link KinDynModel.kinDynComp.setFloatingBase(KinDynModel.BASE_LINK); - disp(['[loadReducedModel]: loaded model: ',[modelPath,modelName],', number of joints: ',num2str(KinDynModel.NDOF)]); + disp(['[loadReducedModel]: loaded model: ',fullfile(modelPath,modelName),', number of joints: ',num2str(KinDynModel.NDOF)]); end