1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-07-09 14:51:11 +02:00

Added equality operators for vector types

This commit is contained in:
Simon Rasmussen
2017-03-01 12:39:25 +01:00
parent d778559894
commit 71ebb4afbf
+14 -4
View File
@@ -2,11 +2,21 @@
#include <inttypes.h>
typedef struct {
struct double3_t {
double x, y, z;
} double3_t;
};
typedef struct {
struct cartesian_coord_t {
double3_t position;
double3_t rotation;
} cartesian_coord_t;
};
inline bool operator==(const double3_t& lhs, const double3_t& rhs)
{
return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z;
}
inline bool operator==(const cartesian_coord_t& lhs, const cartesian_coord_t& rhs)
{
return lhs.position == rhs.position && lhs.rotation == rhs.rotation;
}