Main MRPT website > C++ reference for MRPT 1.5.9
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 
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
STL namespace.
GLdouble s
Definition: glext.h:3602
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)
Lightweight 3D pose (three spatial coordinates, plus a quaternion ).
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.
GLfloat GLfloat p
Definition: glext.h:5587



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020