diff --git a/source/RobotAPI/libraries/core/FramedPose.cpp b/source/RobotAPI/libraries/core/FramedPose.cpp index 21049a2747ff08053106151caadea826125dd2b6..e309cc113c75084e5c8853d9037c7259ac2efa9d 100644 --- a/source/RobotAPI/libraries/core/FramedPose.cpp +++ b/source/RobotAPI/libraries/core/FramedPose.cpp @@ -1220,5 +1220,16 @@ namespace armarx return stream; } + bool operator==(const FramedPose& pose1, const FramedPose& pose2) + { + if (pose1.frame != pose2.frame || pose1.agent != pose2.agent) return false; + return (pose1.toEigen().isApprox(pose2.toEigen())); + } + + bool operator!=(const FramedPose& pose1, const FramedPose& pose2) + { + return !(pose1 == pose2); + } + } diff --git a/source/RobotAPI/libraries/core/FramedPose.h b/source/RobotAPI/libraries/core/FramedPose.h index 01f5c9c6ae5715652516880b4b887fede5866ed6..0abe9ab2a73614542c830e0bd9343d60d576eb60 100644 --- a/source/RobotAPI/libraries/core/FramedPose.h +++ b/source/RobotAPI/libraries/core/FramedPose.h @@ -311,6 +311,8 @@ namespace armarx FramedOrientationPtr getOrientation() const; static VirtualRobot::LinkedCoordinate createLinkedCoordinate(const VirtualRobot::RobotPtr& virtualRobot, const FramedPositionPtr& position, const FramedOrientationPtr& orientation); + friend bool operator==(const FramedPose& pose1, const FramedPose& pose2); + friend bool operator!=(const FramedPose& pose1, const FramedPose& pose2); public: void serialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) const override;