106 pixel_equal(ptopLeftEdge, otopLeftEdge);
107 pixel_equal(ptopRightEdge, otopRightEdge);
108 pixel_equal(pbottomLeftEdge, obottomLeftEdge);
109 pixel_equal(pbottomRightEdge, obottomRightEdge);
125 camera_equal(topLeftEdge, otopLeftEdge);
126 camera_equal(topRightEdge, otopRightEdge);
127 camera_equal(bottomLeftEdge, obottomLeftEdge);
128 camera_equal(bottomRightEdge, obottomRightEdge);
151 ASSERT_TRUE((result.
x - 0.0) < 0.01);
152 ASSERT_TRUE((result.
y - 0.0) < 0.01);
159 ASSERT_LT((result.
x - 0.0), 0.01);
160 ASSERT_LT((result.
y - 0.0), 0.01);
167 ASSERT_LT((result.
x - 0.0), 0.01);
168 ASSERT_LT((result.
y - 0.5), 0.01);
172 const gu_camera topCamera = { 6.364, 5.871, 1.2, 47.64, 60.91 };
176 ASSERT_GE(out.
x, -1.0);
177 ASSERT_GE(out.
y, -1.0);
178 ASSERT_LE(out.
x, 1.0);
179 ASSERT_LE(out.
y, 1.0);
192 ASSERT_EQ(target2.
heading, 40);
197 ASSERT_EQ(target3.
heading, 12);
216 ASSERT_EQ(coord3.
heading, -18);
233 ASSERT_EQ(round(result2.
direction), -45.0);
238 ASSERT_EQ(round(result3.
direction), 45.0);
243 ASSERT_EQ(round(result4.
direction), -45.0);
248 ASSERT_EQ(round(result5.
direction), -135.0);
253 ASSERT_EQ(round(result6.
direction), 135.0);
258 ASSERT_EQ(round(result7.
direction), -45.0);
263 ASSERT_EQ(round(result8.
direction), -15.0);
268 ASSERT_EQ(round(result9.
direction), -135.0);
273 ASSERT_EQ(round(result10.
direction), 105.0);
278 ASSERT_EQ(round(result11.
direction), 133.0);
283 ASSERT_EQ(round(result12.
direction), 180.0);
292 ASSERT_EQ(result1.
x, -640);
293 ASSERT_EQ(result1.
y, 1209);
297 ASSERT_EQ(result2.
x, 2507);
298 ASSERT_EQ(result2.
y, 1498);
306 ASSERT_EQ(round(result1.
direction), 2.0);
311 ASSERT_EQ(round(result2.
direction), 5.0);
320 ASSERT_EQ(result1.
x, -820);
321 ASSERT_EQ(result1.
y, 1447);
325 ASSERT_EQ(result2.
x, -15);
326 ASSERT_EQ(result2.
y, 4503);
334 ASSERT_EQ(round(result1.
direction), 5.0);
gu_percent_coordinate px_coord_to_pct_coord(const gu_pixel_coordinate coord)
gu_percent_coordinate clamped_rr_coord_to_pct_coord(const gu_relative_coordinate coord, const gu_camera_pivot camera_pivot, const int cameraOffset)
gu_relative_coordinate cartesian_coord_to_rr_coord_from_source(const gu_cartesian_coordinate source, const gu_cartesian_coordinate target)
gu_cartesian_coordinate rr_coord_to_cartesian_coord_from_source(const gu_relative_coordinate coord, const gu_cartesian_coordinate source)
gu_field_coordinate rr_coord_to_field_coord_from_source(const gu_relative_coordinate coord, const gu_field_coordinate source, const degrees_t heading)
gu_camera_coordinate px_coord_to_cam_coord(const gu_pixel_coordinate coord)
gu_pixel_coordinate pct_coord_to_px_coord(const gu_percent_coordinate coord, const pixels_u res_width, const pixels_u res_height)
gu_cartesian_coordinate rr_coord_to_cartesian_coord_from_field(const gu_relative_coordinate coord, const gu_field_coordinate source)
gu_relative_coordinate pct_coord_to_rr_coord(const gu_percent_coordinate coord, const gu_camera_pivot camera_pivot, const int cameraOffset)
gu_pixel_coordinate cam_coord_to_px_coord(const gu_camera_coordinate coord)
gu_percent_coordinate rr_coord_to_pct_coord(const gu_relative_coordinate coord, const gu_camera_pivot camera_pivot, const int cameraOffset)
gu_relative_coordinate field_coord_to_rr_coord_to_target(const gu_field_coordinate source, const gu_cartesian_coordinate target)
gu_field_coordinate rr_coord_to_field_coord(const gu_relative_coordinate coord, const degrees_t heading)
#define GU_NAO_V5_HEAD(p, y)
TEST_F(CameraCoordinateTests, Equality)
A gu_camera_coordinate represents the coordinate of a pixel within an image where the (0,...
A gu_camera_pivot represents the pivot point which a gu_camera is attached to.
A cartesian_coordinate is a general coordinate for representing positions on a tow dimensional plane.
millimetres_t y
The y coordinate of the position in centimetres.
millimetres_t x
The x coordinate of the position in centimetres.
A field_coordinate is a coordinate for an object that faces a certain direction (such as a robot) on ...
degrees_t heading
The direction where the object is facing.
gu_cartesian_coordinate position
The position of the object on the field.
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.
A coordinate that is relative to some other coordinate.
degrees_d direction
The heading towards the coordinate.
millimetres_u distance
The distance to the coordinate.