Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce compilation warnings #146

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
# Compilation related dependencies
conda install cmake compilers make ninja pkg-config
# Actual dependencies
conda install yarp ycm-cmake-modules icub-main eigen idyntree bipedal-locomotion-framework human-dynamics-estimation wearables
conda install yarp ycm-cmake-modules icub-main eigen "idyntree>=10.0.0" human-dynamics-estimation wearables
conda install bipedal-locomotion-framework

- name: Linux-only Dependencies [Linux]
if: contains(matrix.os, 'ubuntu')
Expand Down
2 changes: 1 addition & 1 deletion cmake/WalkingTeleoperationFindDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ find_package(YARP REQUIRED)
find_package(YCM REQUIRED)
find_package(ICUB REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(iDynTree REQUIRED)
find_package(iDynTree 10.0.0 REQUIRED)

# Enable RPATH
option(ENABLE_RPATH "Enable RPATH for this library" ON)
Expand Down
12 changes: 6 additions & 6 deletions modules/HapticGlove_module/include/RobotInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class HapticGlove::RobotInterface

bool m_rightHand; /**< if the right hand is used, the variable is true*/

int m_noActuatedAxis; /**< Number of the actuated axis of the robot hand */
size_t m_noActuatedAxis; /**< Number of the actuated axis of the robot hand */
size_t
m_noAnalogSensor; /**< Number of the analog joints ( associated with the analog sensors) */
size_t m_noAllJoints; /**< Number of all the robot hand joints ( associated with the analog &
Expand Down Expand Up @@ -512,31 +512,31 @@ class HapticGlove::RobotInterface
* Get the number of actuated axis/motors
* @return the number of actuated axis/motors
*/
const int getNumberOfActuatedAxis() const;
size_t getNumberOfActuatedAxis() const;

/**
* Get the number of all axis/motors related to the used parts (robot hand)
* @return the number of all axis/motors
*/
const int getNumberOfAllAxis() const;
size_t getNumberOfAllAxis() const;

/**
* Get the number of all the joints related to the robot used parts (robot hand)
* @return the number of all the joints
*/
const int getNumberOfAllJoints() const;
size_t getNumberOfAllJoints() const;

/**
* Get the number of actuated joints of the used parts (robot hand)
* @return the number of actuated joints
*/
const int getNumberOfActuatedJoints() const;
size_t getNumberOfActuatedJoints() const;

/**
* Get the number of iCub robot hand fingers
* @return the number of icub robot hand fingers
*/
const int getNumberOfRobotFingers() const;
size_t getNumberOfRobotFingers() const;

/**
* Get the name of the robot fingers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class HapticGlove::Estimators
* constructor.
* @param noMotors number of motors or joints
*/
Estimators(const int noMotors);
Estimators(size_t noMotors);

/**
* destructor.
Expand Down
2 changes: 1 addition & 1 deletion modules/HapticGlove_module/src/LinearRegression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool LinearRegression::LearnOneShotMatrix(const CtrlHelper::Eigen_Mat& inputData
{

tetha.resize(0, 0);
for (size_t i = 0; i < ouputData.cols(); i++)
for (size_t i = 0; i < static_cast<size_t>(ouputData.cols()); i++)
{
CtrlHelper::Eigen_Mat tetha_i;
LearnOneShot(inputData, ouputData.col(i), tetha_i);
Expand Down
16 changes: 8 additions & 8 deletions modules/HapticGlove_module/src/RobotInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <limits>

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

// teleoperation
#include <ControlHelper.hpp>
Expand Down Expand Up @@ -790,7 +790,7 @@ bool RobotInterface::getFeedback()
return false;
}

for (unsigned j = 0; j < m_noActuatedAxis; ++j)
for (size_t j = 0; j < m_noActuatedAxis; ++j)
m_encoderPositionFeedbackInRadians(j)
= iDynTree::deg2rad(m_encoderPositionFeedbackInDegrees(j));

Expand All @@ -801,7 +801,7 @@ bool RobotInterface::getFeedback()
return false;
}

for (unsigned j = 0; j < m_noActuatedAxis; ++j)
for (size_t j = 0; j < m_noActuatedAxis; ++j)
m_encoderVelocityFeedbackInRadians(j)
= iDynTree::deg2rad(m_encoderVelocityFeedbackInDegrees(j));

Expand Down Expand Up @@ -1052,27 +1052,27 @@ bool RobotInterface::close()
return ok;
}

const int RobotInterface::getNumberOfActuatedAxis() const
size_t RobotInterface::getNumberOfActuatedAxis() const
{
return m_noActuatedAxis;
}

const int RobotInterface::getNumberOfAllAxis() const
size_t RobotInterface::getNumberOfAllAxis() const
{
return m_noAllAxis;
}

const int RobotInterface::getNumberOfAllJoints() const
size_t RobotInterface::getNumberOfAllJoints() const
{
return m_noAllJoints;
}

const int RobotInterface::getNumberOfActuatedJoints() const
size_t RobotInterface::getNumberOfActuatedJoints() const
{
return m_noActuatedJoints;
}

const int RobotInterface::getNumberOfRobotFingers() const
size_t RobotInterface::getNumberOfRobotFingers() const
{
return m_noFingers;
}
Expand Down
11 changes: 7 additions & 4 deletions modules/HapticGlove_module/src/RobotMotorsEstimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

using namespace HapticGlove;

Estimators::Estimators(const int noMotors)
Estimators::Estimators(size_t noMotors)
{
m_numOfMotors = noMotors;
m_isInitialized = false;
Expand Down Expand Up @@ -114,17 +114,20 @@ bool Estimators::getInfo(Eigen::VectorXd& estimatedValues,
{
if (estimatedValues.size() != m_numOfMotors)
{
estimatedValues.resize(m_numOfMotors, 0.0);
estimatedValues.resize(m_numOfMotors);
estimatedValues.setZero();
}

if (estimatedVelocities.size() != m_numOfMotors)
{
estimatedValues.resize(m_numOfMotors, 0.0);
estimatedVelocities.resize(m_numOfMotors);
estimatedVelocities.setZero();
}

if (estimatedAccelerations.size() != m_numOfMotors)
{
estimatedValues.resize(m_numOfMotors, 0.0);
estimatedAccelerations.resize(m_numOfMotors);
estimatedAccelerations.setZero();
}

if (P.rows() != m_numOfMotors && P.cols() == m_n * m_n)
Expand Down
8 changes: 4 additions & 4 deletions modules/HapticGlove_module/src/RobotSkin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool RobotSkin::configure(const yarp::os::Searchable& config,

m_areFingersInContact.resize(m_noFingers, false);
m_fingersInContactTimer.resize(m_noFingers, 0.0);
m_fingersLastElementInContact.resize(m_noFingers, 0.0);
m_fingersLastElementInContact.resize(m_noFingers, 0);
m_areFingersContactChanges.resize(m_noFingers, false);
m_areTactileSensorsWorking.resize(m_noFingers, false);

Expand Down Expand Up @@ -162,8 +162,8 @@ bool RobotSkin::configure(const yarp::os::Searchable& config,
return false;
}

fingerdata.indexStart = std::round(tactileInfo[0]);
fingerdata.indexEnd = std::round(tactileInfo[1]);
fingerdata.indexStart = static_cast<size_t>(std::round(tactileInfo[0]));
fingerdata.indexEnd = static_cast<size_t>(std::round(tactileInfo[1]));
fingerdata.noTactileSensors = fingerdata.indexEnd - fingerdata.indexStart + 1;

fingerdata.contactThresholdValue = tactileInfo[2];
Expand Down Expand Up @@ -398,7 +398,7 @@ void RobotSkin::computeAreFingersInContact()
}

// Update last finger in contact element fi contact is detected
m_fingersLastElementInContact[i] = m_areFingersInContact[i] ? m_fingersTactileData[i].maxTactileFeedbackAbsoluteElement() : -1;
m_fingersLastElementInContact[i] = m_areFingersInContact[i] ? static_cast<int>(m_fingersTactileData[i].maxTactileFeedbackAbsoluteElement()) : -1;

// Check if the finger has been diabled by the timer
m_areFingersInContact[i] = m_areFingersInContact[i] && m_fingersTactileData[i].isFingerContactEnabled;
Expand Down
2 changes: 1 addition & 1 deletion modules/Oculus_module/include/HandRetargeting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <yarp/sig/Vector.h>

// iDynTree
#include <iDynTree/Core/Transform.h>
#include <iDynTree/Transform.h>

/**
* HandRetargeing manages the retargeting of the hand.
Expand Down
2 changes: 1 addition & 1 deletion modules/Oculus_module/include/HeadRetargeting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <iCub/ctrl/minJerkCtrl.h>

// iDynTree
#include <iDynTree/Core/Rotation.h>
#include <iDynTree/Rotation.h>

#include <RetargetingController.hpp>

Expand Down
4 changes: 2 additions & 2 deletions modules/Oculus_module/include/RobotControlHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RobotControlHelper
{
yarp::dev::PolyDriver m_robotDevice; /**< Main robot device. */

int m_actuatedDOFs; /**< Number of the actuated DoF */
size_t m_actuatedDOFs; /**< Number of the actuated DoF */

std::vector<std::string>
m_axesList; /**< Vector containing the name of the controlled joints. */
Expand Down Expand Up @@ -142,7 +142,7 @@ class RobotControlHelper
* Get the number of degree of freedom
* @return the number of actuated DoF
*/
int getDoFs();
size_t getDoFs();

/**
* Close the helper
Expand Down
2 changes: 1 addition & 1 deletion modules/Oculus_module/src/FingersRetargeting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bool FingersRetargeting::configure(const yarp::os::Searchable& config, const std
return false;
}

int fingersJoints = m_controlHelper->getDoFs();
size_t fingersJoints = m_controlHelper->getDoFs();

double samplingTime;
if (!YarpHelper::getDoubleFromSearchable(config, "samplingTime", samplingTime))
Expand Down
6 changes: 3 additions & 3 deletions modules/Oculus_module/src/HandRetargeting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// SPDX-License-Identifier: BSD-3-Clause

// iDynTree
#include <iDynTree/Core/EigenHelpers.h>
#include <iDynTree/yarp/YARPConfigurationsLoader.h>
#include <iDynTree/yarp/YARPConversions.h>
#include <iDynTree/EigenHelpers.h>
#include <iDynTree/YARPConfigurationsLoader.h>
#include <iDynTree/YARPConversions.h>

#include <HandRetargeting.hpp>
#include <Utils.hpp>
Expand Down
14 changes: 7 additions & 7 deletions modules/Oculus_module/src/HeadRetargeting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// SPDX-License-Identifier: BSD-3-Clause

// iDynTree
#include <iDynTree/Core/EigenHelpers.h>
#include <iDynTree/yarp/YARPConversions.h>
#include <iDynTree/yarp/YARPEigenConversions.h>
#include <iDynTree/EigenHelpers.h>
#include <iDynTree/YARPConversions.h>
#include <iDynTree/YARPEigenConversions.h>

#include <HeadRetargeting.hpp>
#include <Utils.hpp>
Expand Down Expand Up @@ -140,7 +140,7 @@ bool HeadRetargeting::configure(const yarp::os::Searchable& config, const std::s
yError() << "[HeadRetargeting::configure] Unable to find the head smoothing time";
return false;
}
unsigned headDoFs = controlHelper()->getDoFs();
size_t headDoFs = controlHelper()->getDoFs();

yarp::sig::Vector preparationJointReferenceValues;
preparationJointReferenceValues.resize(headDoFs);
Expand All @@ -154,14 +154,14 @@ bool HeadRetargeting::configure(const yarp::os::Searchable& config, const std::s
}

m_headTrajectorySmoother
= std::make_unique<iCub::ctrl::minJerkTrajGen>(headDoFs, samplingTime, smoothingTime);
= std::make_unique<iCub::ctrl::minJerkTrajGen>(static_cast<unsigned int>(headDoFs), samplingTime, smoothingTime);
yarp::sig::Vector buff(headDoFs, 0.0);
m_headTrajectorySmoother->init(buff);

yarp::sig::Vector neckJointsFbk;
getNeckJointValues(neckJointsFbk);
pImpl->initializeNeckJointsSmoother(
headDoFs, samplingTime, preparationSmoothingTime, neckJointsFbk);
static_cast<unsigned int>(headDoFs), samplingTime, preparationSmoothingTime, neckJointsFbk);
pImpl->m_preparationJointReferenceValues = preparationJointReferenceValues;

m_playerOrientation = 0;
Expand Down Expand Up @@ -213,7 +213,7 @@ void HeadRetargeting::setDesiredHeadOrientationFromOpenXr(const yarp::sig::Matri
// desiredNeckJoint(0) = neckPitch, the angle around X, with X pointing right
// desiredNeckJoint(1) = neckRoll, the angle around Z, with Z pointing backward
// desiredNeckJoint(2) = neckYaw, the angle around Y, with Y pointing up
// The kinematic chain from the chest to the neck is composed of the pitch, roll, and yaw angles, in this order.
// The kinematic chain from the chest to the neck is composed of the pitch, roll, and yaw angles, in this order.
// The neck pitch axis is aligned with the x axis of the reference frame used by openxr, the roll with the z axis,
// and the yaw with the y axis. Hence, we need to find the Euler angles corresponding to R_x * R_z * R_y.
inverseKinematicsXZY(
Expand Down
6 changes: 3 additions & 3 deletions modules/Oculus_module/src/OculusModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <yarp/os/Property.h>
#include <yarp/os/Stamp.h>

#include <iDynTree/Core/EigenHelpers.h>
#include <iDynTree/yarp/YARPConversions.h>
#include <iDynTree/yarp/YARPEigenConversions.h>
#include <iDynTree/EigenHelpers.h>
#include <iDynTree/YARPConversions.h>
#include <iDynTree/YARPEigenConversions.h>

#include <OculusModule.hpp>
#include <Utils.hpp>
Expand Down
6 changes: 3 additions & 3 deletions modules/Oculus_module/src/RobotControlHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <limits>

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

#include <RobotControlHelper.hpp>
#include <Utils.hpp>
Expand Down Expand Up @@ -282,7 +282,7 @@ bool RobotControlHelper::getFeedback()
return false;
}

for (unsigned j = 0; j < m_actuatedDOFs; ++j)
for (size_t j = 0; j < m_actuatedDOFs; ++j)
m_positionFeedbackInRadians(j) = iDynTree::deg2rad(m_positionFeedbackInDegrees(j));

return true;
Expand Down Expand Up @@ -312,7 +312,7 @@ void RobotControlHelper::close()
yError() << "[RobotControlHelper::close] Unable to close the device.";
}

int RobotControlHelper::getDoFs()
size_t RobotControlHelper::getDoFs()
{
return m_actuatedDOFs;
}
Expand Down
Loading
Loading