Skip to content

Commit

Permalink
Do not deprecate or remove ExtWrenchesAndJointTorquesEstimator::loadM…
Browse files Browse the repository at this point in the history
…odelAndSensorsFromFile
  • Loading branch information
traversaro committed Oct 26, 2020
1 parent 5803747 commit ac98b6d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ 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.
*/
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
11 changes: 11 additions & 0 deletions src/estimation/src/ExtWrenchesAndJointTorquesEstimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ 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

0 comments on commit ac98b6d

Please sign in to comment.