MRPT  1.9.9
CEllipsoidRangeBearing2D.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "opengl-precomp.h" // Precompiled header
11 
14 
15 using namespace mrpt;
16 using namespace mrpt::opengl;
17 using namespace mrpt::math;
18 using namespace std;
19 
22 
23 /*---------------------------------------------------------------
24  transformFromParameterSpace
25  ---------------------------------------------------------------*/
27  const std::vector<BASE::array_parameter_t>& in_pts,
28  std::vector<BASE::array_point_t>& out_pts) const
29 {
31 
32  // (range,bearing) --> (x,y)
33  const size_t N = in_pts.size();
34  out_pts.resize(N);
35  for (size_t i = 0; i < N; i++)
36  {
37  const float range = in_pts[i][0];
38  const float bearing = in_pts[i][1];
39  out_pts[i][0] = range * cosf(bearing);
40  out_pts[i][1] = range * sinf(bearing);
41  }
42 
43  MRPT_END
44 }
45 
46 uint8_t CEllipsoidRangeBearing2D::serializeGetVersion() const { return 0; }
49 {
50  writeToStreamRender(out);
51  BASE::thisclass_writeToStream(out);
52 }
53 
55  mrpt::serialization::CArchive& in, uint8_t version)
56 {
57  switch (version)
58  {
59  case 0:
60  {
61  readFromStreamRender(in);
62  BASE::thisclass_readFromStream(in);
63  }
64  break;
65  default:
67  };
69 }
IMPLEMENTS_SERIALIZABLE(CEllipsoidRangeBearing2D, CRenderizableShaderWireFrame, mrpt::opengl) void CEllipsoidRangeBearing2D
#define MRPT_START
Definition: exceptions.h:241
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
STL namespace.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Definition: exceptions.h:97
This base provides a set of functions for maths stuff.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:54
mrpt::vision::TStereoCalibResults out
Renderizable generic renderer for objects using the wireframe shader.
void transformFromParameterSpace(const std::vector< BASE::array_parameter_t > &in_pts, std::vector< BASE::array_point_t > &out_pts) const override
To be implemented by derived classes: maps, using some arbitrary space transformation, a list of points defining an ellipsoid in parameter space into their corresponding points in 2D/3D space.
#define MRPT_END
Definition: exceptions.h:245
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
An especial "ellipsoid" in 2D computed as the uncertainty iso-surfaces of a (range,bearing) variable.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020