Skip to content

Commit

Permalink
CouplingXCubHandMk5: make it loadble as plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicogene committed Dec 13, 2023
1 parent 0358a28 commit 83f343f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 36 deletions.
10 changes: 2 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -72,10 +72,4 @@ if (BUILD_TESTING)
endif()

add_subdirectory(app)

if(COMPILE_ergoCubEmotions)
add_subdirectory(src)
endif()



add_subdirectory(src)
2 changes: 0 additions & 2 deletions src/modules/couplingXCubHandMk5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions src/modules/couplingXCubHandMk5/CouplingXCubHandMk5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ double CouplingXCubHandMk5::evaluateCoupledJointJacobian(const double& q1, const
}


CouplingXCubHandMk5::CouplingXCubHandMk5()
{
m_couplingSize = 12;
}



bool CouplingXCubHandMk5::parseFingerParameters(yarp::os::Searchable& config)
{

Expand Down
37 changes: 18 additions & 19 deletions src/modules/couplingXCubHandMk5/CouplingXCubHandMk5.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,28 @@
#include <vector>
#include <string>

/**
* 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;
Expand All @@ -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
Expand All @@ -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<std::string, FingerParameters> mFingerParameters;


Expand Down

0 comments on commit 83f343f

Please sign in to comment.