51 cout <<
"Initial PDF: mean: " << pdf.
getMeanVal() << endl;
54 #if MRPT_HAS_WXWIDGETS 65 mrpt::make_aligned_shared<CGridPlaneXY>(-5, 5, -5, 5, 0, 1));
70 #if MRPT_HAS_WXWIDGETS 73 win_before.unlockAccess3DScene();
74 win_before.setCameraZoom(5);
75 win_before.setCameraPointingToPoint(1, 0, 0);
76 win_before.forceRepaint();
82 cout <<
" # modes after: " << pdf.
size() << endl;
84 cout <<
"Final PDF: mean: " << pdf.
getMeanVal() << endl;
93 mrpt::make_aligned_shared<CGridPlaneXY>(-5, 5, -5, 5, 0, 1));
98 #if MRPT_HAS_WXWIDGETS 101 win_after.unlockAccess3DScene();
102 win_after.setCameraZoom(5);
103 win_after.setCameraPointingToPoint(1, 0, 0);
104 win_after.forceRepaint();
108 #if MRPT_HAS_WXWIDGETS 109 cout <<
"Push any key to exit..." << endl;
117 int main(
int argc,
char** argv)
125 catch (std::exception& e)
127 std::cout <<
"Exception: " << e.what() << std::endl;
132 printf(
"Untyped exception!");
void clear()
Clear the list of modes.
void mergeModes(double max_KLd=0.5, bool verbose=false)
Merge very close modes so the overall number of modes is reduced while preserving the total distribut...
The struct for each mode:
int getch() noexcept
An OS-independent version of getch, which waits until a key is pushed.
Declares a class that represents a Probability Density function (PDF) of a 2D pose ...
double DEG2RAD(const double x)
Degrees to radians.
void getCovariance(mrpt::math::CMatrixDouble &cov) const
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) ...
TDATA getMeanVal() const
Returns the mean, or mathematical expectation of the probability density distribution (PDF)...
void push_back(const TGaussianMode &m)
Inserts a copy of the given mode into the SOG.
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream, std::istream, std::ostream, std::stringstream
T square(const T x)
Inline function for the square of a number.
mrpt::math::CMatrixDouble33 cov
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
The namespace for 3D scene representation and rendering.
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives...
void getAs3DObject(OPENGL_SETOFOBJECTSPTR &out_obj) const
Returns a 3D representation of this PDF (it doesn't clear the current contents of out_obj...
Classes for creating GUI windows for 2D and 3D visualization.
size_t size() const
Return the number of Gaussian modes.
Saves data to a file and transparently compress the data using the given compression level...
void insert(const CRenderizable::Ptr &newObject, const std::string &viewportName=std::string("main"))
Insert a new object into the scene, in the given viewport (by default, into the "main" viewport)...
double log_w
The log-weight.
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.