Main MRPT website > C++ reference for MRPT 1.5.7
lightweight_geom_data_unittest.cpp
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 
12 #include <gtest/gtest.h>
13 
14 using namespace mrpt;
15 using namespace mrpt::utils;
16 using namespace mrpt::math;
17 using namespace std;
18 
19 
20 TEST(LightGeomData, PragmaPack)
21 {
22  {
23  TPoint2D p;
24  EXPECT_TRUE(&p.x==&(p[0]));
25  EXPECT_TRUE(&p.y==&(p[1]));
26  }
27  {
28  TPoint3D p;
29  EXPECT_TRUE(&p.x==&(p[0]));
30  EXPECT_TRUE(&p.y==&(p[1]));
31  EXPECT_TRUE(&p.z==&(p[2]));
32  }
33  {
34  TPose2D p;
35  EXPECT_TRUE(&p.x==&(p[0]));
36  EXPECT_TRUE(&p.y==&(p[1]));
37  EXPECT_TRUE(&p.phi==&(p[2]));
38  }
39  {
40  TPose3D p;
41  EXPECT_TRUE(&p.x==&(p[0]));
42  EXPECT_TRUE(&p.y==&(p[1]));
43  EXPECT_TRUE(&p.z==&(p[2]));
44  EXPECT_TRUE(&p.yaw==&(p[3]));
45  EXPECT_TRUE(&p.pitch==&(p[4]));
46  EXPECT_TRUE(&p.roll==&(p[5]));
47  }
48  {
49  TSegment2D s;
50  EXPECT_TRUE(&s.point1==&(s[0]));
51  EXPECT_TRUE(&s.point2==&(s[1]));
52  }
53 }
54 
55 TEST(LightGeomData, ExpectedMemorySizes)
56 {
57  EXPECT_EQ(sizeof(TPoint2D),2*sizeof(double));
58  EXPECT_EQ(sizeof(TPoint3D),3*sizeof(double));
59  EXPECT_EQ(sizeof(TPoint3Df),3*sizeof(float));
60  EXPECT_EQ(sizeof(TPose2D),3*sizeof(double));
61  EXPECT_EQ(sizeof(TPose3D),6*sizeof(double));
62  EXPECT_EQ(sizeof(TPose3DQuat),7*sizeof(double));
63 }
64 
double y
X,Y coordinates.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
double roll
Roll coordinate (rotation angle over X coordinate).
STL namespace.
double z
X,Y,Z coordinates.
double yaw
Yaw coordinate (rotation angle over Z axis).
GLdouble s
Definition: glew.h:1295
This base provides a set of functions for maths stuff.
Definition: CArrayNumeric.h:19
2D segment, consisting of two points.
Lightweight 3D point (float version).
TEST(LightGeomData, PragmaPack)
TPoint2D point2
Destiny point.
GLfloat GLfloat p
Definition: glew.h:10113
double pitch
Pitch coordinate (rotation angle over Y axis).
Lightweight 3D pose (three spatial coordinates, plus a quaternion ).
TPoint2D point1
Origin point.
double y
X,Y coordinates.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Lightweight 2D pose.
Lightweight 3D point.
Lightweight 2D point.
double z
X,Y,Z, coords.
double phi
Orientation (rads)



Page generated by Doxygen 1.8.11 for MRPT 1.5.7 Git: 2190203 Tue May 15 02:01:15 2018 +0200 at miƩ may 16 12:40:16 CEST 2018