29 const std::vector<mrpt::math::CMatrixFixed<float, 2, 1>>& pts,
33 const std::vector<mrpt::math::CMatrixFixed<float, 3, 1>>& pts,
46 std::vector<mrpt::math::CMatrixFixed<float, 2, 1>>& out_params_pts,
52 std::vector<mrpt::math::CMatrixFixed<float, 3, 1>>& out_params_pts,
88 template <
typename MATRIX,
typename VECTOR>
92 ASSERT_(new_cov.cols() == new_cov.rows() && new_cov.cols() == DIM);
165 if (fabs(d) < 1e-20 || d != d)
180 for (
int i = 0; i < DIM; i++)
181 if (
m_U.
coeff(i, i) == 0) eig_ok =
false;
186 std::vector<array_parameter_t> params_pts;
189 detail::generalizedEllipsoidPoints<DIM>(
193 std::vector<array_point_t> render_pts;
198 std::numeric_limits<double>::max(),
199 std::numeric_limits<double>::max(), 0);
201 -std::numeric_limits<double>::max(),
202 -std::numeric_limits<double>::max(), 0);
203 for (
size_t i = 0; i < render_pts.size(); i++)
204 for (
int k = 0; k < DIM; k++)
214 mrpt::opengl::detail::renderGeneralizedEllipsoidTemplate<DIM>(
247 const std::vector<array_point_t>& params_pts,
248 std::vector<array_point_t>& out_pts)
const = 0;
void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
A compile-time fixed-size numeric matrix container.
float m_lineWidth
The line width for 2D ellipses or 3D wireframe ellipsoids (default=1)
mrpt::math::TPoint3D m_bb_max
bool m_needToRecomputeEigenVals
void composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixed< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixed< double, 3, 6 > *out_jacobian_df_dpose=nullptr, mrpt::math::CMatrixFixed< double, 3, 6 > *out_jacobian_df_dse3=nullptr, bool use_small_rot_approx=false) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
#define THROW_EXCEPTION(msg)
void thisclass_writeToStream(mrpt::serialization::CArchive &out) const
bool chol(Derived &U) const
Cholesky M=UT * U decomposition for symmetric matrix (upper-half of the matrix is actually ignored...
void setNumberOfSegments(const uint32_t numSegments)
Set the number of segments of the surface/curve (higher means with greater resolution) ...
float m_quantiles
The number of "sigmas" for drawing the ellipse/ellipsoid (default=3)
GLdouble GLdouble GLdouble GLdouble q
float getLineWidth() const
void renderGeneralizedEllipsoidTemplate< 3 >(const std::vector< mrpt::math::CMatrixFixed< float, 3, 1 >> &pts, const float lineWidth, const uint32_t slices, const uint32_t stacks)
void keep_min(T &var, const K test_val)
If the second argument is below the first one, set the first argument to this lower value...
float getQuantiles() const
Refer to documentation of setQuantiles()
uint32_t m_numSegments
Number of segments in 2D/3D ellipsoids (default=10)
void generalizedEllipsoidPoints< 2 >(const mrpt::math::CMatrixFixed< double, 2, 2 > &U, const mrpt::math::CMatrixFixed< double, 2, 1 > &mean, std::vector< mrpt::math::CMatrixFixed< float, 2, 1 >> &out_params_pts, const uint32_t slices, const uint32_t stacks)
mrpt::poses::CPose3D m_pose
6D pose wrt the parent coordinate reference.
GLubyte GLubyte GLubyte GLubyte w
void setCovMatrixAndMean(const MATRIX &new_cov, const VECTOR &new_mean)
Set the NxN covariance matrix that will determine the aspect of the ellipsoid - Notice that the covar...
A renderizable object suitable for rendering with OpenGL's display lists.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
mrpt::math::TPoint3D m_bb_min
#define ASSERT_(f)
Defines an assertion mechanism.
This base provides a set of functions for maths stuff.
void keep_max(T &var, const K test_val)
If the second argument is above the first one, set the first argument to this higher value...
void setLineWidth(float w)
The line width for 2D ellipses or 3D wireframe ellipsoids (default=1)
void render_dl() const override
Render If one of the eigen value of the covariance matrix of the ellipsoid is null, ellipsoid will not be rendered to ensure stability in the rendering process.
Scalar det() const
Determinant of matrix.
uint32_t getNumberOfSegments()
const Scalar & coeff(int r, int c) const
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Ray tracing.
~CGeneralizedEllipsoidTemplate() override=default
A class that generalizes the concept of an ellipsoid to arbitrary parameterizations of uncertainty sh...
CGeneralizedEllipsoidTemplate()
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void generalizedEllipsoidPoints< 3 >(const mrpt::math::CMatrixFixed< double, 3, 3 > &U, const mrpt::math::CMatrixFixed< double, 3, 1 > &mean, std::vector< mrpt::math::CMatrixFixed< float, 3, 1 >> &out_params_pts, const uint32_t slices, const uint32_t stacks)
virtual void transformFromParameterSpace(const std::vector< array_point_t > ¶ms_pts, std::vector< array_point_t > &out_pts) const =0
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.
Virtual base class for "archives": classes abstracting I/O streams.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
void thisclass_readFromStream(mrpt::serialization::CArchive &in)
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void renderGeneralizedEllipsoidTemplate(const std::vector< mrpt::math::CMatrixFixed< float, DIM, 1 >> &pts, const float lineWidth, const uint32_t slices, const uint32_t stacks)
This file implements matrix/vector text and binary serialization.
const cov_matrix_t & getCovMatrix() const
Gets the current uncertainty covariance of parameter space.
void setQuantiles(float q)
Changes the scale of the "sigmas" for drawing the ellipse/ellipsoid (default=3, ~97 or ~98% CI); the ...
double mean(const CONTAINER &v)
Computes the mean value of a vector.
cov_matrix_t m_U
Cholesky U triangular matrix cache.
unsigned __int32 uint32_t
void generalizedEllipsoidPoints(const mrpt::math::CMatrixFixed< double, DIM, DIM > &U, const mrpt::math::CMatrixFixed< double, DIM, 1 > &mean, std::vector< mrpt::math::CMatrixFixed< float, DIM, 1 >> &out_params_pts, const uint32_t slices, const uint32_t stacks)
void renderGeneralizedEllipsoidTemplate< 2 >(const std::vector< mrpt::math::CMatrixFixed< float, 2, 1 >> &pts, const float lineWidth, const uint32_t slices, const uint32_t stacks)
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.