59 mean(init_Mean), cov_inv()
65 mean(init_Mean), cov_inv(init_CovInv)
117 if (
this == &o)
return;
135 for (
unsigned int i=0;i<7;i++)
136 os::fprintf(f,
"%e %e %e %e %e %e %e\n",
cov_inv(i,0),
cov_inv(i,1),
cov_inv(i,2),
cov_inv(i,3),
cov_inv(i,4),
cov_inv(i,5),
cov_inv(i,6));
165 newReferenceBaseQuat,
175 df_du.multiply_HCHt( OLD_COV, NEW_COV);
176 NEW_COV.inv_fast(this->
cov_inv);
199 vector<CVectorDouble> &outSamples )
const 208 for (
unsigned int k=0;k<7;k++)
229 jacob.insertMatrix(0,0, df_dpose );
230 jacob.set_unsafe(3,3, 1);
231 jacob.set_unsafe(4,4, -1);
232 jacob.set_unsafe(5,5, -1);
233 jacob.set_unsafe(6,6, -1);
239 jacob.multiply_HCHt( COV, NEW_COV );
240 NEW_COV.inv_fast(out.cov_inv);
271 df_dx.multiply_HCHt( OLD_COV, NEW_COV);
272 NEW_COV.inv_fast(this->
cov_inv);
301 df_dx.multiply_HCHt( OLD_COV, NEW_COV);
302 df_du.multiply_HCHt( Ap_cov, NEW_COV,
true);
304 NEW_COV.inv_fast(this->
cov_inv);
315 *
this = inv_Ap + *
this;
341 out <<
"Mean: " <<
obj.mean <<
"\n";
342 out <<
"Information:\n" <<
obj.cov_inv <<
"\n";
A namespace of pseudo-random numbers genrators of diferent distributions.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
mrpt::math::CQuaternionDouble & quat()
Read/Write access to the quaternion representing the 3D rotation.
double x() const
Common members of all points & poses classes.
FILE BASE_IMPEXP * fopen(const char *fileName, const char *mode) MRPT_NO_THROWS
An OS-independent version of fopen.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
TConstructorFlags_Quaternions
void drawSingleSample(CPose3DQuat &outPart) const MRPT_OVERRIDE
Draws a single sample from the distribution.
int BASE_IMPEXP void BASE_IMPEXP fclose(FILE *f)
An OS-independent version of fclose.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
mrpt::math::TPoint2D BASE_IMPEXP operator+(const CPose2D &pose, const mrpt::math::TPoint2D &pnt)
Compose a 2D point from a new coordinate base given by a 2D pose.
Declares a class that represents a Probability Density function (PDF) of a 3D pose using a quaternion...
BASE_IMPEXP CRandomGenerator randomGenerator
A static instance of a CRandomGenerator class, for use in single-thread applications.
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const
Returns information about the class of an object in runtime.
int BASE_IMPEXP fprintf(FILE *fil, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(2
An OS-independent version of fprintf.
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
GLsizei GLsizei GLuint * obj
void drawGaussianMultivariateMany(VECTOR_OF_VECTORS &ret, size_t desiredSamples, const COVMATRIX &cov, const typename VECTOR_OF_VECTORS::value_type *mean=NULL)
Generate a given number of multidimensional random samples according to a given covariance matrix...
double evaluateNormalizedPDF(const CPose3DQuat &x) const
Evaluates the ratio PDF(x) / PDF(MEAN), that is, the normalized PDF in the range [0,1].
void operator+=(const CPose3DQuat &Ap)
Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matri...
CPose3DQuatPDFGaussianInf()
Default constructor - set all values to zero.
mrpt::math::CMatrixDouble77 cov_inv
The 7x7 information matrix (the inverse of the covariance)
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
void changeCoordinatesReference(const CPose3DQuat &newReferenceBase)
this = p (+) this.
A numeric matrix of compile-time fixed size.
This base provides a set of functions for maths stuff.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
void conj(CQuaternion &q_out) const
Return the conjugate quaternion.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
CPose2D BASE_IMPEXP operator-(const CPose2D &p)
Unary - operator: return the inverse pose "-p" (Note that is NOT the same than a pose with negative x...
void inverseComposePoint(const double gx, const double gy, const double gz, double &lx, double &ly, double &lz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *out_jacobian_df_dpose=NULL) const
Computes the 3D point L such as .
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
double evaluatePDF(const CPose3DQuat &x) const
Evaluates the PDF at a given point.
MATRIXLIKE::Scalar normalPDFInf(const VECTORLIKE1 &x, const VECTORLIKE2 &mu, const MATRIXLIKE &cov_inv, const bool scaled_pdf=false)
Evaluates the multivariate normal (Gaussian) distribution at a given point "x".
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
#define CLASS_ID(class_name)
Access to runtime class ID for a defined class name.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLdouble GLdouble GLdouble r
bool operator==(const CPoint< DERIVEDCLASS > &p1, const CPoint< DERIVEDCLASS > &p2)
void operator-=(const CPose3DQuatPDFGaussianInf &Ap)
Makes: thisPDF = thisPDF - Ap, where "-" is pose inverse composition (both the mean, and the covariance matrix are updated).
Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually)...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void inverse(CPose3DQuatPDF &o) const MRPT_OVERRIDE
Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
static void jacobiansPoseComposition(const CPose3DQuat &x, const CPose3DQuat &u, mrpt::math::CMatrixDouble77 &df_dx, mrpt::math::CMatrixDouble77 &df_du, CPose3DQuat *out_x_oplus_u=NULL)
This static method computes the two Jacobians of a pose composition operation $f(x,u)= x u$.
virtual void getCovarianceAndMean(mrpt::math::CMatrixFixedNumeric< double, STATE_LEN, STATE_LEN > &cov, TDATA &mean_point) const =0
Returns an estimate of the pose covariance matrix (STATE_LENxSTATE_LEN cov matrix) and the mean...
void copyFrom(const CPose3DQuatPDF &o) MRPT_OVERRIDE
Copy operator, translating if necesary (for example, between particles and gaussian representations) ...
CMatrixFixedNumeric< double, 7, 1 > CMatrixDouble71
void drawGaussianMultivariate(std::vector< T > &out_result, const mrpt::math::CMatrixTemplateNumeric< T > &cov, const std::vector< T > *mean=NULL)
Generate multidimensional random samples according to a given covariance matrix.
void saveToTextFile(const std::string &file) const MRPT_OVERRIDE
Save the PDF to a text file, containing the 3D pose in the first line (x y z qr qx qy qz)...
EIGEN_STRONG_INLINE double mean() const
Computes the mean of the entire matrix.
CPose3DQuat mean
The mean value.
void drawManySamples(size_t N, std::vector< mrpt::math::CVectorDouble > &outSamples) const MRPT_OVERRIDE
Draws a number of samples from the distribution, and saves as a list of 1x7 vectors, where each row contains a (x,y,z,qr,qx,qy,qz) datum.
std::ostream & operator<<(std::ostream &o, const CPoint< DERIVEDCLASS > &p)
Dumps a point as a string [x,y] or [x,y,z].