Skip to content

Commit

Permalink
Merge pull request #182 from robotology/fixidyntreedeprec
Browse files Browse the repository at this point in the history
Remove iDynTree deprecation warnings
  • Loading branch information
traversaro authored Mar 6, 2024
2 parents d13b412 + 999d452 commit e3e8417
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 95 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ add_install_rpath_support(BIN_DIRS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BIND

set(YARP_REQUIRED_VERSION 3.0.1)

find_package(YARP ${YARP_REQUIRED_VERSION} REQUIRED COMPONENTS robotinterface idl_tools)
find_package(Eigen3 3.2.92 REQUIRED)
find_package(YARP ${YARP_REQUIRED_VERSION} REQUIRED COMPONENTS robotinterface idl_tools eigen os sig)
find_package(Eigen3 REQUIRED)
find_package(iDynTree 10.0.0 REQUIRED)
find_package(ICUB REQUIRED)

yarp_configure_plugins_installation(${PROJECT_NAME})

Expand Down
10 changes: 0 additions & 10 deletions devices/baseEstimatorV1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
# This software may be modified and distributed under the terms of the
# GNU Lesser General Public License v2.1 or any later version.

set(iDynTree_REQUIRED_VERSION 0.11.0)

find_package(iDynTree ${iDynTree_VERSION} REQUIRED)

find_package(ICUB REQUIRED)

find_package(YARP REQUIRED COMPONENTS
eigen
os
sig)

set(FBE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/baseEstimatorV1.h
${CMAKE_CURRENT_SOURCE_DIR}/include/WalkingLogger.tpp
Expand Down
8 changes: 4 additions & 4 deletions devices/baseEstimatorV1/include/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#include <yarp/sig/Vector.h>

// iDynTree
#include <iDynTree/Core/Triplets.h>
#include <iDynTree/Core/VectorFixSize.h>
#include <iDynTree/Core/SparseMatrix.h>
#include <iDynTree/Core/Rotation.h>
#include <iDynTree/Triplets.h>
#include <iDynTree/VectorFixSize.h>
#include <iDynTree/SparseMatrix.h>
#include <iDynTree/Rotation.h>

// eigen
#include <Eigen/Sparse>
Expand Down
17 changes: 8 additions & 9 deletions devices/baseEstimatorV1/include/baseEstimatorV1.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
#ifndef BASE_ESTIMATOR_V1_H
#define BASE_ESTIMATOR_V1_H

#include <iDynTree/Estimation/AttitudeMahonyFilter.h>
#include <iDynTree/Estimation/SimpleLeggedOdometry.h>
#include <iDynTree/Estimation/BipedFootContactClassifier.h>
#include <iDynTree/Estimation/AttitudeQuaternionEKF.h>
#include <iDynTree/AttitudeMahonyFilter.h>
#include <iDynTree/SimpleLeggedOdometry.h>
#include <iDynTree/BipedFootContactClassifier.h>
#include <iDynTree/AttitudeQuaternionEKF.h>

#include <iDynTree/Model/Model.h>
#include <iDynTree/Model.h>
#include <iDynTree/KinDynComputations.h>
#include <iDynTree/ModelIO/ModelLoader.h>
#include <iDynTree/yarp/YARPConversions.h>
#include <iDynTree/Core/EigenHelpers.h>
#include <iDynTree/ModelLoader.h>
#include <iDynTree/YARPConversions.h>
#include <iDynTree/EigenHelpers.h>

#include <yarp/os/PeriodicThread.h>
#include <yarp/os/ResourceFinder.h>
Expand Down Expand Up @@ -543,7 +543,6 @@ namespace yarp {

// robot model and sensors
iDynTree::Model m_model; ///< iDynTree object of loaded robot model
iDynTree::SensorsList m_sensors_list; ///< iDynTree object of loaded sensors list from URDF

const double m_sensor_timeout_in_seconds{2.0}; ///< Timeout to check for sensor measurements during dry run initial check
const size_t m_nr_of_channels_in_YARP_IMU_sensor{12}; ///< Number of channels available in YARP IMU sensor output port
Expand Down
2 changes: 1 addition & 1 deletion devices/baseEstimatorV1/src/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <yarp/os/LogStream.h>

// iDynTree
#include <iDynTree/Core/EigenHelpers.h>
#include <iDynTree/EigenHelpers.h>
#include <Utils.hpp>

iDynTree::Matrix3x3 iDynTreeHelper::Rotation::skewSymmetric(const iDynTree::Matrix3x3& input)
Expand Down
21 changes: 10 additions & 11 deletions devices/baseEstimatorV1/src/fbeRobotInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ bool yarp::dev::baseEstimatorV1::loadEstimator()
}

m_model = model_loader.model();
m_sensors_list = model_loader.sensors();
m_sensor_measurements.resize(m_sensors_list);
m_sensor_measurements.resize(m_model.sensors());

// check imu relevant information
auto imu_frame_idx = m_model.getFrameIndex(m_imu_name);
Expand Down Expand Up @@ -136,8 +135,8 @@ bool yarp::dev::baseEstimatorV1::loadEstimator()
resizeBuffers();
setPeriod(m_device_period_in_s);

ok = m_sensors_list.getSensorIndex(iDynTree::SIX_AXIS_FORCE_TORQUE, m_left_foot_ft_sensor, m_left_foot_ft_sensor_index) && ok;
ok = m_sensors_list.getSensorIndex(iDynTree::SIX_AXIS_FORCE_TORQUE, m_right_foot_ft_sensor, m_right_foot_ft_sensor_index) && ok;
ok = m_model.sensors().getSensorIndex(iDynTree::SIX_AXIS_FORCE_TORQUE, m_left_foot_ft_sensor, m_left_foot_ft_sensor_index) && ok;
ok = m_model.sensors().getSensorIndex(iDynTree::SIX_AXIS_FORCE_TORQUE, m_right_foot_ft_sensor, m_right_foot_ft_sensor_index) && ok;

m_r_sole_R_r_ft_sensor = m_kin_dyn_comp.getRelativeTransform(m_model.getFrameIndex(m_right_sole), m_right_foot_ft_sensor_index).getRotation();
m_l_sole_R_l_ft_sensor = m_kin_dyn_comp.getRelativeTransform(m_model.getFrameIndex(m_left_sole), m_left_foot_ft_sensor_index).getRotation();
Expand Down Expand Up @@ -185,16 +184,16 @@ bool yarp::dev::baseEstimatorV1::attachAllForceTorqueSensors(const yarp::dev::Po
}
}

if (ft_sensor_list.size() != m_sensors_list.getNrOfSensors(iDynTree::SIX_AXIS_FORCE_TORQUE))
if (ft_sensor_list.size() != m_model.sensors().getNrOfSensors(iDynTree::SIX_AXIS_FORCE_TORQUE))
{
yError() << "floatingBaseEstimatorV1: " << "Obtained " << m_sensors_list.getNrOfSensors(iDynTree::SIX_AXIS_FORCE_TORQUE) << "from the model, but trying to attach " << (int)ft_sensor_list.size() << " FT sensors in the attach list.";
yError() << "floatingBaseEstimatorV1: " << "Obtained " << m_model.sensors().getNrOfSensors(iDynTree::SIX_AXIS_FORCE_TORQUE) << "from the model, but trying to attach " << (int)ft_sensor_list.size() << " FT sensors in the attach list.";
return false;
}

m_whole_body_forcetorque_interface.resize(ft_sensor_list.size());
for (size_t iDyn_sensor_idx = 0; iDyn_sensor_idx < m_whole_body_forcetorque_interface.size(); iDyn_sensor_idx++)
{
std::string sensor_name = m_sensors_list.getSensor(iDynTree::SIX_AXIS_FORCE_TORQUE, iDyn_sensor_idx)->getName();
std::string sensor_name = m_model.sensors().getSensor(iDynTree::SIX_AXIS_FORCE_TORQUE, iDyn_sensor_idx)->getName();
// search in sensors list for ft sensor with same name as attach list
int idx_of_device_with_same_name{-1};
for (size_t dev_idx = 0; dev_idx < ft_sensor_list.size(); dev_idx++)
Expand Down Expand Up @@ -262,9 +261,9 @@ bool yarp::dev::baseEstimatorV1::attachAllInertialMeasurementUnits(const yarp::d
for (size_t imu = 0; imu < m_nr_of_IMUs_detected; imu++)
{
bool found_imu{false};
for (size_t iDyn_sensor_idx = 0; iDyn_sensor_idx < m_sensors_list.getNrOfSensors(iDynTree::ACCELEROMETER); iDyn_sensor_idx++)
for (size_t iDyn_sensor_idx = 0; iDyn_sensor_idx < m_model.sensors().getNrOfSensors(iDynTree::ACCELEROMETER); iDyn_sensor_idx++)
{
std::string imu_name = m_sensors_list.getSensor(iDynTree::ACCELEROMETER, iDyn_sensor_idx)->getName();
std::string imu_name = m_model.sensors().getSensor(iDynTree::ACCELEROMETER, iDyn_sensor_idx)->getName();
if (imu_sensor_name[imu] == imu_name)
{
found_imu = true;
Expand Down Expand Up @@ -341,7 +340,7 @@ bool yarp::dev::baseEstimatorV1::readFTSensors(bool verbose)

if (!ok && verbose)
{
yWarning() << "floatingBaseEstimatorV1: " << "unable to read from FT sensor " << m_sensors_list.getSensor(iDynTree::SIX_AXIS_FORCE_TORQUE, ft)->getName() << " correctly. using old measurements.";
yWarning() << "floatingBaseEstimatorV1: " << "unable to read from FT sensor " << m_model.sensors().getSensor(iDynTree::SIX_AXIS_FORCE_TORQUE, ft)->getName() << " correctly. using old measurements.";
}

bool is_NaN = false;
Expand All @@ -356,7 +355,7 @@ bool yarp::dev::baseEstimatorV1::readFTSensors(bool verbose)

if (is_NaN)
{
yError() << "floatingBaseEstimatorV1: " << "FT sensor " << m_sensors_list.getSensor(iDynTree::SIX_AXIS_FORCE_TORQUE, ft)->getName() << " contains nan: . using old measurements."<< m_ft_measurements_from_yarp_server.toString();
yError() << "floatingBaseEstimatorV1: " << "FT sensor " << m_model.sensors().getSensor(iDynTree::SIX_AXIS_FORCE_TORQUE, ft)->getName() << " contains nan: . using old measurements."<< m_ft_measurements_from_yarp_server.toString();
return false;
}

Expand Down
2 changes: 0 additions & 2 deletions devices/genericSensorClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Authors: Silvio Traversaro <silvio.traversaro@iit.it>
# CopyPolicy: Released under the terms of the GNU LGPL v2+

find_package(YARP REQUIRED)

yarp_prepare_plugin(genericSensorClient CATEGORY device
TYPE yarp::dev::GenericSensorClient
INCLUDE "GenericSensorClient.h"
Expand Down
3 changes: 0 additions & 3 deletions devices/virtualAnalogClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# Authors: Silvio Traversaro <silvio.traversaro@iit.it>
# CopyPolicy: Released under the terms of the GNU LGPL v2+

find_package(YARP REQUIRED)


yarp_prepare_plugin(virtualAnalogClient CATEGORY device
TYPE yarp::dev::VirtualAnalogClient
INCLUDE "VirtualAnalogClient.h"
Expand Down
2 changes: 0 additions & 2 deletions devices/virtualAnalogRemapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Authors: Silvio Traversaro <silvio.traversaro@iit.it>
# CopyPolicy: Released under the terms of the GNU LGPL v2+

find_package(YARP REQUIRED)

yarp_prepare_plugin(virtualAnalogRemapper CATEGORY device
TYPE yarp::dev::VirtualAnalogRemapper
INCLUDE "VirtualAnalogRemapper.h"
Expand Down
4 changes: 0 additions & 4 deletions devices/wholeBodyDynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
# Authors: Silvio Traversaro <silvio.traversaro@iit.it>
# CopyPolicy: Released under the terms of the GNU LGPL v2+

find_package(YARP REQUIRED)
# ICUB is required for skinDynLib
find_package(ICUB REQUIRED)
find_package(iDynTree REQUIRED)

yarp_prepare_plugin(wholebodydynamics CATEGORY device
TYPE yarp::dev::WholeBodyDynamicsDevice
Expand Down
10 changes: 5 additions & 5 deletions devices/wholeBodyDynamics/GravityCompensationHelpers.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "GravityCompensationHelpers.h"

#include <iDynTree/Model/Dynamics.h>
#include <iDynTree/Core/EigenHelpers.h>
#include <iDynTree/Core/Utils.h>
#include <iDynTree/Core/ClassicalAcc.h>
#include <iDynTree/Dynamics.h>
#include <iDynTree/EigenHelpers.h>
#include <iDynTree/Utils.h>
#include <iDynTree/ClassicalAcc.h>

#include <iDynTree/Estimation/ExternalWrenchesEstimation.h>
#include <iDynTree/ExternalWrenchesEstimation.h>

using namespace iDynTree;

Expand Down
6 changes: 3 additions & 3 deletions devices/wholeBodyDynamics/GravityCompensationHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define GRAVITY_COMPENSATION_HELPERS_H

// iDynTree includes
#include <iDynTree/Model/FreeFloatingState.h>
#include <iDynTree/Model/Model.h>
#include <iDynTree/Model/Traversal.h>
#include <iDynTree/FreeFloatingState.h>
#include <iDynTree/Model.h>
#include <iDynTree/Traversal.h>


namespace wholeBodyDynamics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "SixAxisForceTorqueMeasureHelpers.h"
#include <iDynTree/Core/EigenHelpers.h>
#include <iDynTree/EigenHelpers.h>


namespace wholeBodyDynamics
Expand Down
4 changes: 2 additions & 2 deletions devices/wholeBodyDynamics/SixAxisForceTorqueMeasureHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define SIX_AXIS_FORCE_TORQUE_MEASURE_PROCESSOR_H

// iDynTree includes
#include <iDynTree/Core/Wrench.h>
#include <iDynTree/Core/MatrixFixSize.h>
#include <iDynTree/Wrench.h>
#include <iDynTree/MatrixFixSize.h>


namespace wholeBodyDynamics
Expand Down
Loading

0 comments on commit e3e8417

Please sign in to comment.