Skip to content

Commit

Permalink
Deprecate semantics checks
Browse files Browse the repository at this point in the history
See #621
  • Loading branch information
traversaro committed Jan 9, 2020
1 parent 71a38a1 commit 90bbd67
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/core/include/iDynTree/Core/AngularForceVector3.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

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

namespace iDynTree
{
Expand All @@ -24,7 +25,8 @@ namespace iDynTree
/**
* Class providing the semantics for any angular force vector (torque or angular momentum).
*/
class AngularForceVector3Semantics: public ForceVector3Semantics<AngularForceVector3Semantics>
class
AngularForceVector3Semantics: public ForceVector3Semantics<AngularForceVector3Semantics>
{
protected:
int point;
Expand All @@ -34,17 +36,21 @@ namespace iDynTree
* Constructors:
*/
inline AngularForceVector3Semantics() {}
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
AngularForceVector3Semantics(int _point, int _body, int _refBody, int _coordinateFrame);
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
AngularForceVector3Semantics(const AngularForceVector3Semantics & other);

/**
* Semantics operations
* Compute the semantics of the result given the semantics of the operands.
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
bool changePoint(const PositionSemantics & newPoint,
const LinearForceVector3Semantics & otherLinear,
AngularForceVector3Semantics & resultAngular) const;

IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
static bool compose(const AngularForceVector3Semantics & op1,
const AngularForceVector3Semantics & op2,
AngularForceVector3Semantics & result);
Expand Down
3 changes: 3 additions & 0 deletions src/core/include/iDynTree/Core/AngularMotionVector3.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

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

namespace iDynTree
{
Expand All @@ -26,7 +27,9 @@ namespace iDynTree
* Constructors:
*/
AngularMotionVector3Semantics();
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
AngularMotionVector3Semantics(int _body, int _refBody, int _coordinateFrame);
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
AngularMotionVector3Semantics(const AngularMotionVector3Semantics & other);
};

Expand Down
5 changes: 5 additions & 0 deletions src/core/include/iDynTree/Core/GeomVector3.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <iDynTree/Core/VectorFixSize.h>
#include <iDynTree/Core/Rotation.h>
#include <iDynTree/Core/PrivateMotionForceVertorAssociations.h>
#include <iDynTree/Core/Utils.h>

#define GEOMVECTOR3SEMANTICS_TEMPLATE_HDR \
template <class MotionForceSemanticsT>
Expand Down Expand Up @@ -41,7 +42,9 @@ namespace iDynTree
* Constructors:
*/
inline GeomVector3Semantics() {}
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
GeomVector3Semantics(int _body, int _refBody, int _coordinateFrame);
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
GeomVector3Semantics(const GeomVector3Semantics & other);

void setToUnknown();
Expand Down Expand Up @@ -97,7 +100,9 @@ namespace iDynTree
/**
* Getters & setters
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
const MotionForceSemanticsT& getSemantics() const;
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
void setSemantics(MotionForceSemanticsT& _semantics);

/**
Expand Down
2 changes: 2 additions & 0 deletions src/core/include/iDynTree/Core/LinearForceVector3.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ namespace iDynTree
* Constructors:
*/
inline LinearForceVector3Semantics() {}
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
LinearForceVector3Semantics(int _body, int _refBody, int _coordinateFrame);
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
LinearForceVector3Semantics(const LinearForceVector3Semantics & other);
};

Expand Down
4 changes: 4 additions & 0 deletions src/core/include/iDynTree/Core/LinearMotionVector3.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,21 @@ namespace iDynTree
* Constructors:
*/
inline LinearMotionVector3Semantics() {}
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
LinearMotionVector3Semantics(int _point, int _body, int _refBody, int _coordinateFrame);
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
LinearMotionVector3Semantics(const LinearMotionVector3Semantics & other);

/**
* Semantics operations
* Compute the semantics of the result given the semantics of the operands.
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
bool changePoint(const PositionSemantics & newPoint,
const AngularMotionVector3Semantics & otherAngular,
LinearMotionVector3Semantics & resultLinear) const;

IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
static bool compose(const LinearMotionVector3Semantics & op1,
const LinearMotionVector3Semantics & op2,
LinearMotionVector3Semantics & result);
Expand Down
2 changes: 2 additions & 0 deletions src/core/include/iDynTree/Core/Position.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ namespace iDynTree
/**
* Semantic getter
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
PositionSemantics& getSemantics();

/**
* Const Semantic getter
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
const PositionSemantics& getSemantics() const;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/core/include/iDynTree/Core/Rotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ namespace iDynTree
/**
* Semantic getter
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
RotationSemantics& getSemantics();

/**
* Semantic getter
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
const RotationSemantics& getSemantics() const;

/**
Expand Down
18 changes: 17 additions & 1 deletion src/core/include/iDynTree/Core/RotationSemantics.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#include <string>

#include <iDynTree/Core/Utils.h>

namespace iDynTree
{
class PositionSemantics;
Expand All @@ -22,7 +24,8 @@ namespace iDynTree
*
* \ingroup iDynTreeCore
*/
class RotationSemantics
class
RotationSemantics
{
protected:
int orientationFrame;
Expand Down Expand Up @@ -54,30 +57,43 @@ namespace iDynTree
* Constructor: initialize semantics from individual parameters
*
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
RotationSemantics(int _orientationFrame, int _body, int _refOrientationFrame, int _refBody);

/**
* Copy constructor: create a RotationSemantics from another RotationSemantics
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
RotationSemantics(const RotationSemantics & other);

IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
void setToUnknown();

/**
* @name Semantics setters and getters.
* Semantics setters and getters.
*/
///@{
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
int getOrientationFrame() const;
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
int getBody() const;
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
int getReferenceOrientationFrame() const;
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
int getRefBody() const;
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
int getCoordinateFrame() const;

IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
void setOrientationFrame(int _orientationFrame);
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
void setBody(int _body);
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
void setReferenceOrientationFrame(int _refOrientationFrame);
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
void setRefBody(int _refBody);
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
void setCoordinateFrame(int _coordinateFrame);
///@}

Expand Down
1 change: 1 addition & 0 deletions src/core/include/iDynTree/Core/SpatialVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ SpatialVectorSemantics<LinearVec3SemanticsT, AngularVec3SemanticsT>
*/
SpatialVectorSemantics(LinearVec3SemanticsT & linearVec3, AngularVec3SemanticsT & angularVec3);

IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
bool check_linear2angularConsistency(const LinearVec3SemanticsT & linearVec3, const AngularVec3SemanticsT & angularVec3);

/**
Expand Down
2 changes: 2 additions & 0 deletions src/core/include/iDynTree/Core/Transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@ namespace iDynTree
/**
* Semantic accessor
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
TransformSemantics & getSemantics();

/**
* Const semantic getter
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
const TransformSemantics & getSemantics() const;

/**
Expand Down
6 changes: 6 additions & 0 deletions src/core/include/iDynTree/Core/TransformSemantics.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#include <string>

#include <iDynTree/Core/Utils.h>

namespace iDynTree
{
class PositionSemantics;
Expand Down Expand Up @@ -44,12 +46,14 @@ namespace iDynTree
/**
* Constructor: initialize all semantics from a Transform object (create links)
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
TransformSemantics(PositionSemantics & position, RotationSemantics & rotation);


/**
* Get the rotation part of the transform
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
const RotationSemantics & getRotationSemantics() const;

/**
Expand All @@ -60,11 +64,13 @@ namespace iDynTree
/**
* Set the rotation part of the transform
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
bool setRotationSemantics(const RotationSemantics & rotation);

/**
* Set the translation part of the transform
*/
IDYNTREE_DEPRECATED_WITH_MSG("All iDynTree semantics class and methods will be removed in iDynTree 2.0")
bool setPositionSemantics(const PositionSemantics & position);

/**
Expand Down
1 change: 0 additions & 1 deletion src/core/include/iDynTree/Core/Wrench.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace iDynTree
*
* \ingroup iDynTreeCore
*
* Currently this class does not support semantics.
*/
class Wrench: public SpatialForceVector
{
Expand Down

0 comments on commit 90bbd67

Please sign in to comment.