59#ifndef GUCOORDINATES_TESTS_HPP
60#define GUCOORDINATES_TESTS_HPP
62#pragma clang diagnostic push
63#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
64#pragma clang diagnostic ignored "-Wfloat-equal"
65#pragma clang diagnostic ignored "-Wsign-compare"
66#pragma clang diagnostic ignored "-Wmissing-noreturn"
67#pragma clang diagnostic ignored "-Wshift-sign-overflow"
68#pragma clang diagnostic ignored "-Wused-but-marked-unused"
69#pragma clang diagnostic ignored "-Wundef"
70#pragma clang diagnostic ignored "-Wc++98-compat"
71#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
72#pragma clang diagnostic ignored "-Wc++11-long-long"
73#pragma clang diagnostic ignored "-Wc++11-extensions"
74#pragma clang diagnostic ignored "-Wdeprecated"
75#include <gtest/gtest.h>
76#pragma clang diagnostic pop
78#include "../gucoordinates.h"
80#define GU_NAO_V5_TOP_CAMERA gu_camera_make(6.364f, 5.871f, 1.2f, 47.64f, 60.97f)
81#define GU_NAO_V5_BOTTOM_CAMERA gu_camera_make(1.774f, 5.071f, 39.7f, 47.64f, 60.97f)
83#define GU_PEPPER_TOP_CAMERA gu_camera_make(115.3f, 8.68f, 0.0f, 44.3f, 55.2f)
84#define GU_PEPPER_BOTTOM_CAMERA gu_camera_make(105.15f, 9.36f, 40.0f, 44.3f, 55.2f)
86#define GU_NAO_V5_HEAD(p, y) (gu_camera_pivot) {.pitch = p, .yaw = y, .height = 41.7f, .cameras = {GU_NAO_V5_TOP_CAMERA, GU_NAO_V5_BOTTOM_CAMERA}, .numCameras = 2}
87#define GU_NAO_V5_TOP_CAMERA_INDEX 0
88#define GU_NAO_V5_BOTTOM_CAMERA_INDEX 1
90#define GU_PEPPER_HEAD(p, y) {p, y, 0.0f, {GU_PEPPER_TOP_CAMERA, GU_PEPPER_BOTTOM_CAMERA}, 2}
92#define GU_NAO_V5_ROBOT(hp, hy, x, y, t) (gu_robot) { .head = { hp, hy, 41.7f, {GU_NAO_V5_TOP_CAMERA, GU_NAO_V5_BOTTOM_CAMERA}, 2 }, .position = { { x, y }, t } }
94#define GU_PEPPER_ROBOT(hp, hy, x, y, t) (gu_robot) { .head = { hp, hy, 0.0f, {GU_PEPPER_TOP_CAMERA, GU_PEPPER_BOTTOM_CAMERA}, 2 }, .position = { { x, y }, t } }
109 ASSERT_EQ(lhs.
x, rhs.
x);
110 ASSERT_EQ(lhs.
y, rhs.
y);
117 ASSERT_EQ(lhs.
x, rhs.
x);
118 ASSERT_EQ(lhs.
y, rhs.
y);
125 ASSERT_EQ(lhs.
x, rhs.
x);
126 ASSERT_EQ(lhs.
y, rhs.
y);
131 ASSERT_LT(fabs(lhs.
x - rhs.
x), 0.001);
132 ASSERT_LT(fabs(lhs.
y - rhs.
y), 0.001);
void pixel_equal(const gu_pixel_coordinate lhs, const gu_pixel_coordinate rhs)
void percent_near(const gu_percent_coordinate lhs, const gu_percent_coordinate rhs)
void percent_equal(const gu_percent_coordinate lhs, const gu_percent_coordinate rhs)
void camera_equal(const gu_camera_coordinate lhs, const gu_camera_coordinate rhs)
A gu_camera_coordinate represents the coordinate of a pixel within an image where the (0,...
pixels_u x
The x coordinate of the pixel within the image.
pixels_u res_height
The height of the resolution of the image.
pixels_u res_width
The width of the resolution of the image.
pixels_u y
The y coordinate of the pixel within the image.
A gu_percent_coordinate represents the coordinate of a pixel within an image.
percent_d y
The y coordinate of the pixel within the image as a percentage.
percent_d x
The x coordinate of the pixel within the image as a percentage.
A gu_pixel_coordinate represents the coordinate of a pixel within an image.
pixels_u res_height
The height of the resolution of the image.
pixels_t x
The x coordinate of the pixel within the image.
pixels_u res_width
The width of the resolution of the image.
pixels_t y
The y coordinate of the pixel within the image.