Skip to content

Commit

Permalink
Remove functionalities deprecated in iDynTree 1
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro committed Oct 26, 2020
1 parent d8808b0 commit bba67e6
Show file tree
Hide file tree
Showing 38 changed files with 100 additions and 935 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The Python package name of the SWIG bindings changed from `iDynTree` to `idyntree.bindings` (https://github.com/robotology/idyntree/pull/733, https://github.com/robotology/idyntree/pull/735). To continue referring to iDynTree classes as `iDynTree.<ClassName>`, you can change your `import iDynTree` statements to `import idyntree.bindings as iDynTree`. Otherwise, you can use `import idyntree.bindings` to refer them as `idyntree.bindings.<ClassName>`.
- Improve the use of `const` keyword in `KinDynComputations`(https://github.com/robotology/idyntree/pull/736).

### Removed
### Removed
- Remove the CMake option IDYNTREE_USES_KDL and all the classes available when enabling it. They were deprecated in iDynTree 1.0 .
- Remove the semantics related classes. They were deprecated in iDynTree 1.0 .
- Remove unnecessary warning messages from [ModelSensorsTransformers.cpp](https://github.com/robotology/idyntree/blob/master/src/sensors/src/ModelSensorsTransformers.cpp) and [URDFDocument.cpp](https://github.com/robotology/idyntree/blob/master/src/model_io/urdf/src/URDFDocument.cpp) (see [PR 718](https://github.com/robotology/idyntree/pull/718))
- Python2 will not be maintained past 2020 and its support has been dropped (https://github.com/robotology/idyntree/pull/726).
- Remove the need to call `iDynTree.init_helpers()` and `iDynTree.init_numpy_helpers()` from Python (https://github.com/robotology/idyntree/pull/726).
- Remove headers and methods that were deprecated in iDynTree 1.0 (https://github.com/robotology/idyntree/pull/751).

## [Unreleased]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,6 @@ class ExtWrenchesAndJointTorquesEstimator
*/
bool setModelAndSensors(const Model & _model, const SensorsList & _sensors);

/**
* Load model and sensors from file.
*
* @deprecated Use iDynTree::ModelLoader::loadModelFromFile and call setModelAndSensors
* on the parsed Model and SensorsList
*
* @param[in] filename path to the file to load.
* @param[in] filetype (optional) explicit definiton of the filetype to load.
* Only "urdf" is supported at the moment.
* @return true if all went well (files were correctly loaded and consistent), false otherwise.
*/
IDYNTREE_DEPRECATED_WITH_MSG("Use iDynTree::ModelLoader::loadModelFromFile and call setModelAndSensors on the parsed Model and SensorsList")
bool loadModelAndSensorsFromFile(const std::string filename, const std::string filetype="");

/**
* Load model and sensors from file, specifieng the dof considered for the estimation.
*
Expand Down
32 changes: 0 additions & 32 deletions src/estimation/include/iDynTree/Estimation/SimpleLeggedOdometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,38 +118,6 @@ class SimpleLeggedOdometry
*/
bool setModel(const Model & _model);

/**
* Load model from file.
*
* @deprecated Use iDynTree::ModelLoader::loadModelFromFile and call setModel on the parsed Model
*
* @param[in] filename path to the file to load.
* @param[in] filetype (optional) explicit definiton of the filetype to load.
* Only "urdf" is supported at the moment.
* @return true if all went well (files were correctly loaded and consistent), false otherwise.
*
*/
IDYNTREE_DEPRECATED_WITH_MSG("Use iDynTree::ModelLoader::loadModelFromFile and call setModel on the parsed Model")
bool loadModelFromFile(const std::string filename, const std::string filetype="");

/**
* Load model from file, specifieng the dof considered for the estimation.
*
* @deprecated Use iDynTree::ModelLoader::loadReducedModelFromFile and call setModel on the parsed Model
*
* @note this will create e a reduced model only with the joint specified in consideredDOFs
*
* @param[in] filename path to the file to load.
* @param[in] consideredDOFs list of dof to consider in the model.
* @param[in] filetype (optional) explicit definiton of the filetype to load.
* Only "urdf" is supported at the moment.
* @return true if all went well (files were correctly loaded and consistent), false otherwise.
*/
IDYNTREE_DEPRECATED_WITH_MSG("Use iDynTree::ModelLoader::loadReducedModelFromFile and call setModel on the parsed Model")
bool loadModelFromFileWithSpecifiedDOFs(const std::string filename,
const std::vector<std::string> & consideredDOFs,
const std::string filetype="");

/**
* Get used model.
*
Expand Down
11 changes: 0 additions & 11 deletions src/estimation/src/ExtWrenchesAndJointTorquesEstimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,6 @@ bool ExtWrenchesAndJointTorquesEstimator::setModelAndSensors(const Model& _model
return true;
}

bool ExtWrenchesAndJointTorquesEstimator::loadModelAndSensorsFromFile(const std::string filename,
const std::string filetype)
{
ModelLoader loader;
if (!loader.loadModelFromFile(filename, filetype)) {
reportError("ExtWrenchesAndJointTorquesEstimator", "loadModelAndSensorsFromFile", "Error in parsing from URDF.");
return false;
}
return setModelAndSensors(loader.model(), loader.sensors());
}

bool ExtWrenchesAndJointTorquesEstimator::loadModelAndSensorsFromFileWithSpecifiedDOFs(const std::string filename,
const std::vector< std::string >& consideredDOFs,
const std::string filetype)
Expand Down
30 changes: 0 additions & 30 deletions src/estimation/src/SimpleLeggedOdometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,36 +182,6 @@ bool SimpleLeggedOdometry::setModel(const Model& _model)
return true;
}


bool SimpleLeggedOdometry::loadModelFromFile(const std::string filename,
const std::string filetype)
{
ModelLoader loader;
if (!loader.loadModelFromFile(filename, filetype)) {
reportError("SimpleLeggedOdometry",
"loadModelFromFile",
"Error in parsing model from URDF.");
return false;
}
return setModel(loader.model());
}

bool SimpleLeggedOdometry::loadModelFromFileWithSpecifiedDOFs(const std::string filename,
const std::vector<std::string>& consideredDOFs,
const std::string filetype)
{
ModelLoader loader;
if (!loader.loadReducedModelFromFile(filename, consideredDOFs, filetype)) {
reportError("SimpleLeggedOdometry",
"loadModelFromFileWithSpecifiedDOFs",
"Error in parsing model from URDF.");
return false;
}
return setModel(loader.model());
}



std::string SimpleLeggedOdometry::getCurrentFixedLink()
{
if( this->m_isModelValid && this->m_isOdometryInitialized )
Expand Down
5 changes: 4 additions & 1 deletion src/estimation/tests/SimpleLeggedOdometryUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "testModels.h"

#include <iDynTree/Core/TestUtils.h>
#include <iDynTree/ModelIO/ModelLoader.h>


using namespace iDynTree;
Expand Down Expand Up @@ -71,7 +72,9 @@ int main()

std::vector<std::string> consideredJoints = getCanonical_iCubJoints();

bool ok = simpleOdometry.loadModelFromFileWithSpecifiedDOFs(getAbsModelPath("iCubDarmstadt01.urdf"),consideredJoints);
iDynTree::ModelLoader mdlLoader;
bool ok = mdlLoader.loadReducedModelFromFile(getAbsModelPath("iCubDarmstadt01.urdf"),consideredJoints);
ok = ok && simpleOdometry.setModel(mdlLoader.model());

ASSERT_IS_TRUE(ok);

Expand Down
22 changes: 1 addition & 21 deletions src/high-level/include/iDynTree/KinDynComputations.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,27 +121,7 @@ class KinDynComputations {
* @param model the model to use in this class.
* @return true if all went ok, false otherwise.
*/
bool loadRobotModel(const iDynTree::Model & model );

/**
* Load the model of the robot from an external file.
*
* @param filename path to the file to load
* @param filetype type of the file to load, currently supporting only urdf type.
*
*/
IDYNTREE_DEPRECATED_WITH_MSG("Use iDynTree::ModelLoader::loadRobotModelFromFile and pass the Model to loadRobotModel")
bool loadRobotModelFromFile(const std::string & filename, const std::string & filetype="urdf");

/**
* Load the model of the robot from a string.
*
* @param modelString string containg the model of the robot.
* @param filetype type of the file to load, currently supporting only urdf type.
*
*/
IDYNTREE_DEPRECATED_WITH_MSG("Use iDynTree::ModelLoader::loadRobotModelFromString and pass the Model to loadRobotModel")
bool loadRobotModelFromString(const std::string & modelString, const std::string & filetype="urdf");
bool loadRobotModel(const iDynTree::Model & model);

/**
* Return true if the models for the robot have been correctly.
Expand Down
22 changes: 0 additions & 22 deletions src/high-level/src/KinDynComputations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,28 +460,6 @@ void KinDynComputations::computeBiasAccFwdKinematics()
this->pimpl->m_areBiasAccelerationsUpdated = ok;
}

bool KinDynComputations::loadRobotModelFromFile(const std::string& filename,
const std::string& filetype)
{
ModelLoader loader;
if (!loader.loadModelFromFile(filename, filetype)) {
reportError("KinDynComputations", "loadRobotModelFromFile", "Error in loading robot model");
return false;
}
return this->loadRobotModel(loader.model());
}

bool KinDynComputations::loadRobotModelFromString(const std::string& modelString,
const std::string& filetype)
{
ModelLoader loader;
if (!loader.loadModelFromString(modelString, filetype)) {
reportError("KinDynComputations", "loadRobotModelFromString", "Error in loading robot model");
return false;
}
return this->loadRobotModel(loader.model());
}

bool KinDynComputations::loadRobotModel(const Model& model)
{
this->pimpl->m_robot_model = model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include <iDynTree/Model/JointState.h>
#include <iDynTree/Model/FreeFloatingState.h>

#include <iDynTree/ModelIO/ModelLoader.h>


namespace Eigen
{
using Vector6d = Eigen::Matrix<double, 6, 1>;
Expand Down Expand Up @@ -384,8 +387,9 @@ void testAbsoluteJacobiansAndFrameBiasAcc(KinDynComputations & dynComp)
void testModelConsistency(std::string modelFilePath, const FrameVelocityRepresentation frameVelRepr)
{
iDynTree::KinDynComputations dynComp;

bool ok = dynComp.loadRobotModelFromFile(modelFilePath);
iDynTree::ModelLoader mdlLoader;
bool ok = mdlLoader.loadModelFromFile(modelFilePath);
ok = ok && dynComp.loadRobotModel(mdlLoader.model());
ASSERT_IS_TRUE(ok);

ok = dynComp.setFrameVelocityRepresentation(frameVelRepr);
Expand Down Expand Up @@ -492,9 +496,10 @@ void testAbsoluteJacobianSparsity(KinDynComputations & dynComp)

void testSparsityPattern(std::string modelFilePath, const FrameVelocityRepresentation frameVelRepr)
{
iDynTree::KinDynComputations dynComp;

bool ok = dynComp.loadRobotModelFromFile(modelFilePath);
iDynTree::KinDynComputations dynComp;
iDynTree::ModelLoader mdlLoader;
bool ok = mdlLoader.loadModelFromFile(modelFilePath);
ok = ok && dynComp.loadRobotModel(mdlLoader.model());
ASSERT_IS_TRUE(ok);

ok = dynComp.setFrameVelocityRepresentation(frameVelRepr);
Expand Down
17 changes: 11 additions & 6 deletions src/high-level/tests/KinDynComputationsUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include <iDynTree/Model/JointState.h>
#include <iDynTree/Model/FreeFloatingState.h>

#include <iDynTree/ModelIO/ModelLoader.h>


using namespace iDynTree;

double random_double()
Expand Down Expand Up @@ -392,9 +395,10 @@ void testAbsoluteJacobiansAndFrameBiasAcc(KinDynComputations & dynComp)

void testModelConsistency(std::string modelFilePath, const FrameVelocityRepresentation frameVelRepr)
{
iDynTree::KinDynComputations dynComp;

bool ok = dynComp.loadRobotModelFromFile(modelFilePath);
iDynTree::KinDynComputations dynComp;
iDynTree::ModelLoader mdlLoader;
bool ok = mdlLoader.loadModelFromFile(modelFilePath);
ok = ok && dynComp.loadRobotModel(mdlLoader.model());
ASSERT_IS_TRUE(ok);

ok = dynComp.setFrameVelocityRepresentation(frameVelRepr);
Expand Down Expand Up @@ -502,9 +506,10 @@ void testAbsoluteJacobianSparsity(KinDynComputations & dynComp)

void testSparsityPattern(std::string modelFilePath, const FrameVelocityRepresentation frameVelRepr)
{
iDynTree::KinDynComputations dynComp;

bool ok = dynComp.loadRobotModelFromFile(modelFilePath);
iDynTree::KinDynComputations dynComp;
iDynTree::ModelLoader mdlLoader;
bool ok = mdlLoader.loadModelFromFile(modelFilePath);
ok = ok && dynComp.loadRobotModel(mdlLoader.model());
ASSERT_IS_TRUE(ok);

ok = dynComp.setFrameVelocityRepresentation(frameVelRepr);
Expand Down
4 changes: 0 additions & 4 deletions src/icub/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,3 @@ install(TARGETS ${libraryname}

set_property(GLOBAL APPEND PROPERTY ${VARS_PREFIX}_TARGETS idyntree-icub)

# Install headers in deprecated location
install(DIRECTORY include/iDynTree/iCub
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/iDynTree")

20 changes: 0 additions & 20 deletions src/icub/include/iDynTree/iCub/skinDynLibConversions.h

This file was deleted.

Loading

0 comments on commit bba67e6

Please sign in to comment.