MRPT  2.0.4
CEllipsoidInverseDepth2D.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 
12 #include <mrpt/math/matrix_serialization.h> // for << >> ops of matrices
15 #include <Eigen/Dense>
16 
17 using namespace mrpt;
18 using namespace mrpt::opengl;
19 using namespace mrpt::math;
20 using namespace std;
21 
24 
25 /*---------------------------------------------------------------
26  transformFromParameterSpace
27  ---------------------------------------------------------------*/
29  const std::vector<BASE::array_parameter_t>& in_pts,
30  std::vector<BASE::array_point_t>& out_pts) const
31 {
33 
34  // (inv_range,yaw) --> (x,y)
35  const size_t N = in_pts.size();
36  out_pts.resize(N);
37  for (size_t i = 0; i < N; i++)
38  {
39  const double inv_range = in_pts[i][0];
40  const double yaw = in_pts[i][1];
41  const double range = inv_range < 0
42  ? m_underflowMaxRange
43  : (inv_range != 0 ? 1. / inv_range : 0);
44  out_pts[i][0] = d2f(range * cos(yaw));
45  out_pts[i][1] = d2f(range * sin(yaw));
46  }
47 
48  MRPT_END
49 }
50 
51 uint8_t CEllipsoidInverseDepth2D::serializeGetVersion() const { return 0; }
54 {
55  writeToStreamRender(out);
56  BASE::thisclass_writeToStream(out);
57 
58  out << m_underflowMaxRange;
59 }
61  mrpt::serialization::CArchive& in, uint8_t version)
62 {
63  switch (version)
64  {
65  case 0:
66  {
67  readFromStreamRender(in);
68  BASE::thisclass_readFromStream(in);
69 
70  in >> m_underflowMaxRange;
71  }
72  break;
73  default:
75  };
77 }
#define MRPT_START
Definition: exceptions.h:241
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
STL namespace.
An especial "ellipsoid" in 3D computed as the uncertainty iso-surfaces of a (inv_range,yaw) variable.
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
float d2f(const double d)
shortcut for static_cast<float>(double)
This base provides a set of functions for maths stuff.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
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
This file implements matrix/vector text and binary serialization.
Renderizable generic renderer for objects using the wireframe shader.
IMPLEMENTS_SERIALIZABLE(CEllipsoidInverseDepth2D, CRenderizableShaderWireFrame, mrpt::opengl) void CEllipsoidInverseDepth2D
#define MRPT_END
Definition: exceptions.h:245
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
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.



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020