MRPT  2.0.3
CEllipsoidInverseDepth3D.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  // (inv_range,yaw,pitch) --> (x,y,z)
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 inv_range = in_pts[i][0];
38  const float yaw = in_pts[i][1];
39  const float pitch = in_pts[i][2];
40 
41  const float range = inv_range < 0
42  ? m_underflowMaxRange
43  : (inv_range != 0 ? 1.f / inv_range : 0);
44 
45  out_pts[i][0] = range * cosf(yaw) * cosf(pitch);
46  out_pts[i][1] = range * sinf(yaw) * cosf(pitch);
47  out_pts[i][2] = -range * sinf(pitch);
48  }
49 
50  MRPT_END
51 }
52 
53 uint8_t CEllipsoidInverseDepth3D::serializeGetVersion() const { return 0; }
56 {
57  writeToStreamRender(out);
58  BASE::thisclass_writeToStream(out);
59 
60  out << m_underflowMaxRange;
61 }
62 
64  mrpt::serialization::CArchive& in, uint8_t version)
65 {
66  switch (version)
67  {
68  case 0:
69  {
70  readFromStreamRender(in);
71  BASE::thisclass_readFromStream(in);
72 
73  in >> m_underflowMaxRange;
74  }
75  break;
76  default:
78  };
80 }
mrpt::opengl::CRenderizable::notifyChange
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
Definition: CRenderizable.h:315
IMPLEMENTS_SERIALIZABLE
IMPLEMENTS_SERIALIZABLE(CEllipsoidInverseDepth3D, CRenderizableShaderWireFrame, mrpt::opengl) void CEllipsoidInverseDepth3D
Definition: CEllipsoidInverseDepth3D.cpp:20
mrpt::opengl::CRenderizableShaderWireFrame
Renderizable generic renderer for objects using the wireframe shader.
Definition: CRenderizableShaderWireFrame.h:24
out
mrpt::vision::TStereoCalibResults out
Definition: chessboard_stereo_camera_calib_unittest.cpp:25
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: BaseAppDataSource.h:15
mrpt::serialization::CArchive
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:54
mrpt::opengl::CEllipsoidInverseDepth3D::serializeGetVersion
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
MRPT_START
#define MRPT_START
Definition: exceptions.h:241
mrpt::opengl::CEllipsoidInverseDepth3D::serializeFrom
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
CEllipsoidInverseDepth3D.h
mrpt::obs::gnss::pitch
double pitch
Definition: gnss_messages_novatel.h:306
mrpt::opengl::CEllipsoidInverseDepth3D
An especial "ellipsoid" in 3D computed as the uncertainty iso-surfaces of a (inv_range,...
Definition: CEllipsoidInverseDepth3D.h:46
mrpt::opengl::CEllipsoidInverseDepth3D::transformFromParameterSpace
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,...
mrpt::opengl::CEllipsoidInverseDepth3D::serializeTo
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
opengl-precomp.h
MRPT_END
#define MRPT_END
Definition: exceptions.h:245
mrpt::math
This base provides a set of functions for maths stuff.
Definition: math/include/mrpt/math/bits_math.h:11
CArchive.h
MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Definition: exceptions.h:97
mrpt::opengl
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13



Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 15:49:54 UTC 2020