From 83f343f4262316768ae2335a53f0df48ac92371d Mon Sep 17 00:00:00 2001 From: Nicogene Date: Wed, 13 Dec 2023 14:53:23 +0100 Subject: [PATCH] CouplingXCubHandMk5: make it loadble as plugin --- CMakeLists.txt | 10 +---- .../couplingXCubHandMk5/CMakeLists.txt | 2 - .../CouplingXCubHandMk5.cpp | 7 ---- .../couplingXCubHandMk5/CouplingXCubHandMk5.h | 37 +++++++++---------- 4 files changed, 20 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca477c54..2619f445 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.12) project(ergocub-software LANGUAGES C CXX VERSION 0.6.0) -find_package(YARP 3.7.2 REQUIRED) +find_package(YARP 3.9.0 REQUIRED) # Give error if add_dependencies is called on a non-existing target if(POLICY CMP0046) @@ -72,10 +72,4 @@ if (BUILD_TESTING) endif() add_subdirectory(app) - -if(COMPILE_ergoCubEmotions) - add_subdirectory(src) -endif() - - - +add_subdirectory(src) diff --git a/src/modules/couplingXCubHandMk5/CMakeLists.txt b/src/modules/couplingXCubHandMk5/CMakeLists.txt index 60f9f0f1..a2207635 100644 --- a/src/modules/couplingXCubHandMk5/CMakeLists.txt +++ b/src/modules/couplingXCubHandMk5/CMakeLists.txt @@ -4,8 +4,6 @@ # This software may be modified and distributed under the terms of the # BSD-3-Clause license. See the accompanying LICENSE file for details. -find_package(YARP 3.9.0 REQUIRED) - yarp_configure_plugins_installation(ergocub-software) yarp_prepare_plugin(couplingXCubHandMk5 diff --git a/src/modules/couplingXCubHandMk5/CouplingXCubHandMk5.cpp b/src/modules/couplingXCubHandMk5/CouplingXCubHandMk5.cpp index e14b07fe..12b71a4f 100644 --- a/src/modules/couplingXCubHandMk5/CouplingXCubHandMk5.cpp +++ b/src/modules/couplingXCubHandMk5/CouplingXCubHandMk5.cpp @@ -72,13 +72,6 @@ double CouplingXCubHandMk5::evaluateCoupledJointJacobian(const double& q1, const } -CouplingXCubHandMk5::CouplingXCubHandMk5() -{ - m_couplingSize = 12; -} - - - bool CouplingXCubHandMk5::parseFingerParameters(yarp::os::Searchable& config) { diff --git a/src/modules/couplingXCubHandMk5/CouplingXCubHandMk5.h b/src/modules/couplingXCubHandMk5/CouplingXCubHandMk5.h index 421bf6e5..9e5fdb27 100644 --- a/src/modules/couplingXCubHandMk5/CouplingXCubHandMk5.h +++ b/src/modules/couplingXCubHandMk5/CouplingXCubHandMk5.h @@ -16,13 +16,28 @@ #include #include +/** + * Parameters from https://icub-tech-iit.github.io/documentation/hands/hands_mk5_coupling + */ +struct FingerParameters +{ + double L0x; + double L0y; + double q2bias; + double q1off; + double k; + double d; + double l; + double b; +}; + /** TBD */ class CouplingXCubHandMk5 : public yarp::dev::DeviceDriver, public yarp::dev::ImplementJointCoupling { public: - CouplingXCubHandMk5(); - ~CouplingXCubHandMk5() override; + CouplingXCubHandMk5() = default; + virtual ~CouplingXCubHandMk5() override = default; bool convertFromPhysicalJointsToActuatedAxesPos(const yarp::sig::Vector& physJointsPos, yarp::sig::Vector& actAxesPos) override; bool convertFromPhysicalJointsToActuatedAxesVel(const yarp::sig::Vector& physJointsPos, const yarp::sig::Vector& physJointsVel, yarp::sig::Vector& actAxesVel) override; bool convertFromPhysicalJointsToActuatedAxesAcc(const yarp::sig::Vector& physJointsPos, const yarp::sig::Vector& physJointsVel, const yarp::sig::Vector& physJointsAcc, yarp::sig::Vector& actAxesAcc) override; @@ -32,8 +47,7 @@ class CouplingXCubHandMk5 : public yarp::dev::DeviceDriver, bool convertFromActuatedAxesToPhysicalJointsAcc(const yarp::sig::Vector& actAxesPos, const yarp::sig::Vector& actAxesVel, const yarp::sig::Vector& actAxesAcc, yarp::sig::Vector& physJointsAcc) override; bool convertFromActuatedAxesToPhysicalJointsTrq(const yarp::sig::Vector& actAxesPos, const yarp::sig::Vector& actAxesTrq, yarp::sig::Vector& physJointsTrq) override; - //DeviceDriver - bool close() override; + // //DeviceDriver /** * Configure with a set of options. * @param config The options to use @@ -42,21 +56,6 @@ class CouplingXCubHandMk5 : public yarp::dev::DeviceDriver, bool open(yarp::os::Searchable& config) override; private: - /** - * Parameters from https://icub-tech-iit.github.io/documentation/hands/hands_mk5_coupling - */ - struct FingerParameters - { - double L0x; - double L0y; - double q2bias; - double q1off; - double k; - double d; - double l; - double b; - }; - std::unordered_map mFingerParameters;