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

Fix handling of limbs versions in iKin #839

Merged
merged 6 commits into from
Dec 5, 2022
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.12)

set(ROOT_PROJECT_NAME ICUB)
project(${ROOT_PROJECT_NAME} LANGUAGES C CXX
VERSION 1.28.1)
VERSION 2.0.0)

set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 14)
Expand Down
6 changes: 3 additions & 3 deletions app/cartesianSolver/doc.dox
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ The Cartesian Solvers Launcher.

\section intro_sec Description
This application allows the user to launch instances of the iKinCartesianSolver
on a specific machine belonging to the cluster. Moreover the iCubInterface and
on a specific machine belonging to the cluster. Moreover the yarprobotinterface and
the server part of the gaze controller interface are launched as well.

\section int_sec Instantiated Modules
- \ref icub_iCubInterface
- yarprobotinterface
- \ref iKinCartesianSolver
- \ref iKinGazeCtrl

Expand All @@ -22,7 +22,7 @@ Customize the file ./scripts/*.template for your specific platform.

- ./scripts/cartesianSolver.xml.template
launches solvers for the following parts: <i>right_arm, left_arm, right_leg, left_leg.</i>
as well as the iCubInterface and the iKinGazeCtrl.
as well as the yarprobotinterface and the iKinGazeCtrl.

\author Ugo Pattacini

Expand Down
2 changes: 1 addition & 1 deletion app/controlBoardDumper/doc.dox
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ voltages, currents, tracking errors).


\section dep_sec Dependencies
Assumes \ref icub_iCubInterface is running.
Assumes the robot is running.

\section int_sec Instantiated Modules
- \ref icub_controlBoardDumper
Expand Down
4 changes: 2 additions & 2 deletions app/fingertipsPortScope/doc.dox
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*
*
* \section int_sec Instantiated Modules
* - \ref yarpscope --context fingertipsPortScope --xml FingertipsPortScopeConf-LeftHandAll.xml
* - \ref yarpscope --context fingertipsPortScope --xml FingertipsPortScopeConf-RightHandAll.xml
* - yarpscope --context fingertipsPortScope --xml FingertipsPortScopeConf-LeftHandAll.xml
* - yarpscope --context fingertipsPortScope --xml FingertipsPortScopeConf-RightHandAll.xml
*
*
* \section howto How to run the Application
Expand Down
2 changes: 1 addition & 1 deletion app/gazeboCartesianControl/conf/iKinGazeCtrl.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
robot icubSim
head_version 2.5
head_version v2.5
neck_position_control on
saccades off

Expand Down
2 changes: 1 addition & 1 deletion app/iCubStartup/doc.dox
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gaze control as well as the dynamics computed for the whole body.
- \ref wholeBodyDynamics
- \ref gravityCompensator
- \ref icub_fingersTuner
- \ref imuFilter
- imuFilter

\section howto How to run the Application
Customize the file ./scripts/*.template for your specific platform.
Expand Down
2 changes: 1 addition & 1 deletion app/robotScripting/doc.dox
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
\defgroup icub_robotscripting robotScripting

This application allows performing nice preprogrammed demonstrations with the robot. It just starts
an instance of \ref icub_ctpservice for each part. Commands will be sent from shell (but see
an instance of \ref ctpservice for each part. Commands will be sent from shell (but see
also the scripting.py utility in this app directory).

\section dep_sec Dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/doc/main.dox
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Topics:
- The <a href="http://www.robotcub.org/">RobotCub Website</a>.
- Our software architecture, <a href="http://www.yarp.it/">YARP</a>.

This page can be edited at \link src/doc/main.dox.
This page can be edited at src/doc/main.dox.

*
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/actionPrimitives/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_library(ICUB::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")

target_link_libraries(${PROJECT_NAME} perceptiveModels ${YARP_LIBRARIES})
target_link_libraries(${PROJECT_NAME} iKin perceptiveModels ${YARP_LIBRARIES})


set_target_properties(${PROJECT_NAME} PROPERTIES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* provides the user a collection of action primitives in task
* space and joint space along with an easy way to combine them
* together forming higher level actions (e.g. grasp(), tap(),
* �) in order to eventually execute more sophisticated tasks
* �) in order to eventually execute more sophisticated tasks
* without reference to the motion control details.
*
* \image html actionPrimitives.jpg
Expand Down Expand Up @@ -437,8 +437,7 @@ class ActionPrimitives : protected yarp::os::PeriodicThread
* @endcode
*
* @note A port called <i> /<local>/<part>/detectGrasp:i </i> is
* open to acquire data provided by \ref icub_graspDetector
* module.
* open to acquire data provided by graspDetector module.
*/
virtual bool open(yarp::os::Property &opt);

Expand Down
6 changes: 4 additions & 2 deletions src/libraries/actionPrimitives/src/actionPrimitives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <yarp/math/Rand.h>

#include <iCub/ctrl/math.h>
#include <iCub/iKin/iKinFwd.h>
#include <iCub/perception/springyFingers.h>
#include <iCub/perception/tactileFingers.h>
#include <iCub/action/actionPrimitives.h>
Expand Down Expand Up @@ -57,6 +58,7 @@ using namespace yarp::dev;
using namespace yarp::sig;
using namespace yarp::math;
using namespace iCub::ctrl;
using namespace iCub::iKin;
using namespace iCub::perception;
using namespace iCub::action;

Expand Down Expand Up @@ -407,9 +409,9 @@ bool ActionPrimitives::handleTorsoDOF(Property &opt, const string &key)
{
Bottle info;
cartCtrl->getInfo(info);
double hwver=info.find("arm_version").asFloat64();
iKinLimbVersion hwver(info.find("arm_version").asString());
map<string,int> remap{{ACTIONPRIM_TORSO_PITCH,0},{ACTIONPRIM_TORSO_ROLL,1},{ACTIONPRIM_TORSO_YAW,2}};
if (hwver>=3.0)
if (hwver>=iKinLimbVersion("3.0"))
{
remap[ACTIONPRIM_TORSO_ROLL]=0;
remap[ACTIONPRIM_TORSO_PITCH]=1;
Expand Down
124 changes: 118 additions & 6 deletions src/libraries/iKin/include/iCub/iKin/iKinFwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,118 @@ class iKinLimb : public iKinChain
};


/**
* \ingroup iKinFwd
*
* A class for defining the versions of the iCub limbs.
*/
class iKinLimbVersion
{
protected:
unsigned long int major;
unsigned long int minor;

public:
/**
* Default Constructor.
*/
iKinLimbVersion();

/**
* Constructor.
* @param version is a string for specifying different
* kinematics, e.g., "1.23".
*/
iKinLimbVersion(const std::string &version);

/**
* Constructor.
* @param major the major version.
* @param minor the mninor version.
*/
iKinLimbVersion(const unsigned long int major, const unsigned long int minor);

/**
* Copy Constructor.
*/
iKinLimbVersion(const iKinLimbVersion& v);

/**
* Return the major version.
* @return the major version.
*/
unsigned long int get_major() const;

/**
* Return the minor version.
* @return the minor version.
*/
unsigned long int get_minor() const;

/**
* Return the version string.
* @return the version string.
*/
std::string get_version() const;

/**
* Overloaded assignment operator.
* @param v the version to be assigned.
* @return .
*/
iKinLimbVersion& operator=(const iKinLimbVersion& v);

/**
* Overloaded < operator.
* @param v the version to compare with.
* @return true iff < v.
*/
bool operator<(const iKinLimbVersion& v) const;

/**
* Overloaded <= operator.
* @param v the version to compare with.
* @return true iff <= v.
*/
bool operator<=(const iKinLimbVersion& v) const;

/**
* Overloaded == operator.
* @param v the version to compare with.
* @return true iff == v.
*/
bool operator==(const iKinLimbVersion& v) const;

/**
* Overloaded != operator.
* @param v the version to compare with.
* @return true iff != v.
*/
bool operator!=(const iKinLimbVersion& v) const;

/**
* Overloaded >=</=> operator.
* @param v the version to compare with.
* @return true iff >= v.
*/
bool operator>=(const iKinLimbVersion& v) const;

/**
* Overloaded > operator.
* @param v the version to compare with.
* @return true iff > v.
*/
bool operator>(const iKinLimbVersion& v) const;

/**
* Overloaded - operator.
* @param v the version to compare with.
* @return the distance from v.
*/
iKinLimbVersion operator-(const iKinLimbVersion& v) const;
};


/**
* \ingroup iKinFwd
*
Expand All @@ -1045,7 +1157,7 @@ class iKinLimb : public iKinChain
class iCubTorso : public iKinLimb
{
protected:
double version;
iKinLimbVersion version;

virtual void allocate(const std::string &_type);

Expand Down Expand Up @@ -1081,7 +1193,7 @@ class iCubTorso : public iKinLimb
class iCubArm : public iKinLimb
{
protected:
double version;
iKinLimbVersion version;

virtual void allocate(const std::string &_type);

Expand Down Expand Up @@ -1236,7 +1348,7 @@ class iCubFinger : public iKinLimb
class iCubLeg : public iKinLimb
{
protected:
double version;
iKinLimbVersion version;

virtual void allocate(const std::string &_type);

Expand Down Expand Up @@ -1273,7 +1385,7 @@ class iCubLeg : public iKinLimb
class iCubEye : public iKinLimb
{
protected:
double version;
iKinLimbVersion version;

virtual void allocate(const std::string &_type);

Expand Down Expand Up @@ -1364,7 +1476,7 @@ class iCubHeadCenter : public iCubEye
class iCubInertialSensor : public iKinLimb
{
protected:
double version;
iKinLimbVersion version;

virtual void allocate(const std::string &_type);

Expand Down Expand Up @@ -1401,7 +1513,7 @@ class iCubInertialSensor : public iKinLimb
class iCubInertialSensorWaist : public iKinLimb
{
protected:
double version;
iKinLimbVersion version;

virtual void allocate(const std::string &_type);

Expand Down
Loading