109 m_pkk.extractMatrix(0, 0, out_robotPose.
cov);
138 std::vector<TPoint3D>& out_landmarksPositions,
139 std::map<unsigned int, CLandmark::TLandmarkID>& out_landmarkIDs,
156 m_pkk.extractMatrix(0, 0, out_robotPose.
cov);
161 out_landmarksPositions.resize(nLMs);
162 for (i = 0; i < nLMs; i++)
164 out_landmarksPositions[i].x =
166 out_landmarksPositions[i].y =
168 out_landmarksPositions[i].z =
176 out_fullState.resize(
m_xkk.size());
177 for (KFVector::Index i = 0; i <
m_xkk.size(); i++)
178 out_fullState[i] =
m_xkk[i];
181 out_fullCovariance =
m_pkk;
231 vector<vector_uint> partitions;
238 vector<vector_uint> partitions;
244 for (
size_t i = 0; i <
m_SFs.
size(); i++)
246 tmpCluster.push_back(i);
249 partitions.push_back(tmpCluster);
251 tmpCluster.push_back(i);
271 m_action->getBestMovementEstimation();
281 actMov2D->poseChange->getMean(estMovMean);
298 for (KFArray_ACT::Index i = 0; i < u.size(); i++) u[i] = theIncr[i];
305 const KFArray_ACT& u, KFArray_VEH& xv,
bool& out_skipPrediction)
const 315 out_skipPrediction =
true;
326 odoIncrement.
m_quat[0] = u[3];
327 odoIncrement.
m_quat[1] = u[4];
328 odoIncrement.
m_quat[2] = u[5];
329 odoIncrement.
m_quat[3] = u[6];
332 robotPose += odoIncrement;
335 for (
size_t i = 0; i < xv.static_size; i++) xv[i] = robotPose[i];
356 CPose3DQuatPDF::jacobiansPoseComposition(
377 if (act3D && act2D)
THROW_EXCEPTION(
"Both 2D & 3D odometry are present!?!?")
397 odoIncr2D.
copyFrom(*act2D->poseChange);
422 vector_KFArray_OBS& out_predictions)
const 434 "*ERROR*: This method requires an observation of type " 435 "CObservationBearingRange")
465 const CPose3DQuat sensorPoseAbs = robotPose + sensorPoseOnRobot;
467 const size_t N = idx_landmarks_to_predict.
size();
468 out_predictions.resize(N);
469 for (
size_t i = 0; i < N; i++)
471 const size_t row_in = feature_size * idx_landmarks_to_predict[i];
475 m_xkk[vehicle_size + row_in + 0],
m_xkk[vehicle_size + row_in + 1],
476 m_xkk[vehicle_size + row_in + 2]);
482 out_predictions[i][0],
483 out_predictions[i][1],
484 out_predictions[i][2]
492 const size_t& idx_landmark_to_predict, KFMatrix_OxV& Hx,
493 KFMatrix_OxF& Hy)
const 505 "*ERROR*: This method requires an observation of type " 506 "CObservationBearingRange")
521 CPose3DQuatPDF::jacobiansPoseComposition(
522 robotPose, sensorPoseOnRobot, H_senpose_vehpose, H_senpose_senrelpose,
525 const size_t row_in = feature_size * idx_landmark_to_predict;
529 m_xkk[vehicle_size + row_in + 0],
m_xkk[vehicle_size + row_in + 1],
530 m_xkk[vehicle_size + row_in + 2]);
543 Hx.multiply(Hx_sensor, H_senpose_vehpose);
571 vector_KFArray_OBS& Z,
vector_int& data_association,
572 const vector_KFArray_OBS& all_predictions,
const KFMatrix& S,
587 "*ERROR*: This method requires an observation of type " 588 "CObservationBearingRange")
590 const size_t N = obs->sensedData.size();
594 for (
row = 0, itObs = obs->sensedData.begin();
595 itObs != obs->sensedData.end(); ++itObs, ++
row)
598 Z[
row][0] = itObs->range;
599 Z[
row][1] = itObs->yaw;
600 Z[
row][2] = itObs->pitch;
605 data_association.assign(N, -1);
609 obs_idxs_needing_data_assoc.reserve(N);
615 for (
row = 0, itObs = obs->sensedData.begin(),
616 itDA = data_association.begin();
617 itObs != obs->sensedData.end(); ++itObs, ++itDA, ++
row)
620 if (itObs->landmarkID < 0)
621 obs_idxs_needing_data_assoc.push_back(
row);
627 *itDA = itID->second;
636 if (obs_idxs_needing_data_assoc.empty())
642 for (
size_t idxObs = 0; idxObs < data_association.size(); idxObs++)
644 int da = data_association[idxObs];
647 data_association[idxObs];
653 const size_t nObsDA = obs_idxs_needing_data_assoc.size();
656 for (
size_t i = 0; i < nObsDA; i++)
658 const size_t idx = obs_idxs_needing_data_assoc[i];
659 for (
unsigned k = 0; k < obs_size; k++)
660 Z_obs_means.get_unsafe(i, k) =
Z[idx][k];
665 m_pkk.extractMatrix(0, 0, Pxx);
669 const size_t nPredictions = lm_indices_in_S.size();
677 for (
size_t q = 0;
q < nPredictions;
q++)
679 const size_t i = lm_indices_in_S[
q];
680 for (
size_t w = 0;
w < obs_size;
w++)
708 data_association[it->first] = it->second;
724 const double T = std::sqrt(
727 ASSERTMSG_(T > 0,
"Vehicle pose quaternion norm is not >0!!")
729 const double T_ = (
m_xkk[3] < 0 ? -1.0 : 1.0) / T;
796 std_sensor_range(0.01f),
798 std_sensor_pitch(
DEG2RAD(0.2f)),
799 std_odo_z_additional(0),
800 doPartitioningExperiment(false),
801 quantiles_3D_representation(3),
802 partitioningMethod(0),
805 data_assoc_IC_chi2_thres(0.99),
807 data_assoc_IC_ml_threshold(0.0),
808 create_simplemap(false),
809 force_ignore_odometry(false)
822 "\n----------- [CRangeBearingKFSLAM::TOptions] ------------ \n\n");
825 "doPartitioningExperiment = %c\n",
826 doPartitioningExperiment ?
'Y' :
'N');
828 "partitioningMethod = %i\n", partitioningMethod);
830 "data_assoc_method = %s\n",
834 "data_assoc_metric = %s\n",
838 "data_assoc_IC_chi2_thres = %.06f\n",
839 data_assoc_IC_chi2_thres);
841 "data_assoc_IC_metric = %s\n",
845 "data_assoc_IC_ml_threshold = %.06f\n",
846 data_assoc_IC_ml_threshold);
861 "*ERROR*: This method requires an observation of type " 862 "CObservationBearingRange")
875 CPose3DQuatPDF::jacobiansPoseComposition(
876 robotPose, sensorPoseOnRobot, dsensorabs_dvehpose,
877 dsensorabs_dsenrelpose, &sensorPoseAbs);
903 hn_r * chn_y * chn_p, hn_r * shn_y * chn_p, -hn_r * shn_p);
914 const kftype values_dynlocal_dhn[] = {chn_p * chn_y,
915 -hn_r * chn_p * shn_y,
916 -hn_r * chn_y * shn_p,
918 hn_r * chn_p * chn_y,
919 -hn_r * shn_p * shn_y,
929 yn_rel_sensor.
x, yn_rel_sensor.
y,
932 &jacob_dyn_dynrelsensor, &jacob_dyn_dsensorabs);
935 dyn_dhn.multiply_AB(jacob_dyn_dynrelsensor, dynlocal_dhn);
939 jacob_dyn_dsensorabs, dsensorabs_dvehpose);
955 const size_t in_obsIdx,
const size_t in_idxNewFeat)
963 "*ERROR*: This method requires an observation of type " 964 "CObservationBearingRange")
969 ASSERT_(in_obsIdx < obs->sensedData.size())
971 if (obs->sensedData[in_obsIdx].landmarkID >= 0)
974 m_IDs.
insert(obs->sensedData[in_obsIdx].landmarkID, in_idxNewFeat);
1004 m_pkk.extractMatrix(0, 0, 3, 3, COV);
1005 pointGauss.
cov = COV;
1009 mrpt::make_aligned_shared<opengl::CEllipsoid>();
1011 ellip->setPose(pointGauss.
mean);
1012 ellip->setCovMatrix(pointGauss.
cov);
1013 ellip->enableDrawSolid3D(
false);
1015 ellip->set3DsegmentsCount(10);
1016 ellip->setColor(1, 0, 0);
1018 outObj->insert(ellip);
1023 for (
size_t i = 0; i < nLMs; i++)
1031 m_pkk.extractMatrix(
1035 pointGauss.
cov = COV;
1038 mrpt::make_aligned_shared<opengl::CEllipsoid>();
1040 ellip->setName(
format(
"%u", static_cast<unsigned int>(i)));
1041 ellip->enableShowName(
true);
1042 ellip->setPose(pointGauss.
mean);
1043 ellip->setCovMatrix(pointGauss.
cov);
1044 ellip->enableDrawSolid3D(
false);
1046 ellip->set3DsegmentsCount(10);
1048 ellip->setColor(0, 0, 1);
1054 map<int, bool> belongToPartition;
1074 for (
size_t o = 0; o < obs->sensedData.size(); o++)
1076 if (obs->sensedData[o].landmarkID == i_th_ID)
1078 belongToPartition[
p] =
true;
1086 string strParts(
"[");
1089 it != belongToPartition.end(); ++it)
1091 if (it != belongToPartition.begin()) strParts +=
string(
",");
1092 strParts +=
format(
"%i", it->first);
1095 ellip->setName(ellip->getName() + strParts +
string(
"]"));
1098 outObj->insert(ellip);
1106 size_t K, std::vector<vector_uint>& landmarksMembership)
1114 vector<vector_uint> partitions;
1117 for (
size_t i = 0; i <
m_SFs.
size(); i++)
1119 tmpCluster.push_back(i);
1122 partitions.push_back(tmpCluster);
1124 tmpCluster.push_back(
1141 std::vector<vector_uint>& landmarksMembership)
const 1143 landmarksMembership.clear();
1150 for (
size_t i = 0; i < nLMs; i++)
1152 map<int, bool> belongToPartition;
1172 for (
size_t o = 0; o < obs->sensedData.size(); o++)
1174 if (obs->sensedData[o].landmarkID == i_th_ID)
1176 belongToPartition[
p] =
true;
1187 it != belongToPartition.end(); ++it)
1188 membershipOfThisLM.push_back(it->first);
1190 landmarksMembership.push_back(membershipOfThisLM);
1198 const std::vector<vector_uint>& landmarksMembership)
const 1206 fullCov(i, i) = max(fullCov(i, i), 1e-6);
1211 double sumOffBlocks = 0;
1212 unsigned int nLMs = landmarksMembership.size();
1216 fullCov.getColCount());
1218 for (i = 0; i < nLMs; i++)
1220 for (
size_t j = i + 1; j < nLMs; j++)
1225 landmarksMembership[i], landmarksMembership[j]))
1229 sumOffBlocks += 2 * H.block(
row, col, 2, 2).sum();
1234 return sumOffBlocks /
1249 vector<vector_uint> partitions;
1261 const string& fil,
float stdCount,
const string& styleLandmarks,
1262 const string& stylePath,
const string& styleRobot)
const 1273 "%%--------------------------------------------------------------------" 1275 os::fprintf(f,
"%% File automatically generated using the MRPT method:\n");
1279 "'CRangeBearingKFSLAM::saveMapAndPath2DRepresentationAsMATLABFile'\n");
1283 f,
"%% Jose Luis Blanco Claraco, University of Malaga @ 2008\n");
1287 "%%--------------------------------------------------------------------" 1295 for (
size_t i = 0; i < nLMs; i++)
1299 cov(0, 0) =
m_pkk(idx + 0, idx + 0);
1300 cov(1, 1) =
m_pkk(idx + 1, idx + 1);
1318 for (
size_t i = 0; i <
m_SFs.
size(); i++)
1333 f,
"plot(ROB_PATH(:,1),ROB_PATH(:,2),'%s');\n", stylePath.c_str());
1398 "*ERROR*: This method requires an observation of type " 1399 "CObservationBearingRange")
1401 #define USE_HEURISTIC_PREDICTION 1403 #ifdef USE_HEURISTIC_PREDICTION 1404 const double sensor_max_range = obs->maxSensorDistance;
1405 const double fov_yaw = obs->fieldOfView_yaw;
1406 const double fov_pitch = obs->fieldOfView_pitch;
1408 const double max_vehicle_loc_uncertainty =
1410 m_pkk.get_unsafe(0, 0) +
m_pkk.get_unsafe(1, 1) +
1411 m_pkk.get_unsafe(2, 2));
1414 out_LM_indices_to_predict.clear();
1415 for (
size_t i = 0; i < prediction_means.size(); i++)
1417 #ifndef USE_HEURISTIC_PREDICTION 1418 out_LM_indices_to_predict.push_back(i);
1421 if (prediction_means[i][0] <
1422 (15 + sensor_max_range + max_vehicle_loc_uncertainty +
1424 fabs(prediction_means[i][1]) <
1426 fabs(prediction_means[i][2]) <
1429 out_LM_indices_to_predict.push_back(i);
void changeCoordinatesReference(const CPose3DQuat &newReferenceBase)
this = p (+) this.
double x() const
Common members of all points & poses classes.
void copyFrom(const CPosePDF &o) override
Copy operator, translating if necesary (for example, between particles and gaussian representations) ...
void getCurrentRobotPose(mrpt::poses::CPose3DQuatPDFGaussian &out_robotPose) const
Returns the mean & the 7x7 covariance matrix of the robot 6D pose (with rotation as a quaternion)...
std::string MATLAB_plotCovariance2D(const CMatrixFloat &cov22, const CVectorFloat &mean, const float &stdCount, const std::string &style=std::string("b"), const size_t &nEllipsePoints=30)
Generates a string with the MATLAB commands required to plot an confidence interval (ellipse) for a 2...
void reset()
Reset the state of the SLAM filter: The map is emptied and the robot put back to (0,0,0).
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
mrpt::poses::CPose3DQuat getIncrementFromOdometry() const
Return the last odometry, as a pose increment.
void OnObservationJacobians(const size_t &idx_landmark_to_predict, KFMatrix_OxV &Hx, KFMatrix_OxF &Hy) const
Implements the observation Jacobians and (when applicable) .
std::vector< uint32_t > vector_uint
const_iterator end() const
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
bool force_ignore_odometry
Whether to ignore the input odometry and behave as if there was no odometry at all (default: false) ...
This class stores a sequence of <Probabilistic Pose,SensoryFrame> pairs, thus a "metric map" can be t...
std::shared_ptr< CPose3DPDFGaussian > Ptr
void markAllNodesForReconsideration()
Mark all nodes for reconsideration in the next call to "updatePartitions", instead of considering jus...
int void fclose(FILE *f)
An OS-independent version of fclose.
void reconsiderPartitionsNow()
The partitioning of the entire map is recomputed again.
void OnPreComputingPredictions(const vector_KFArray_OBS &in_all_prediction_means, vector_size_t &out_LM_indices_to_predict) const
This will be called before OnGetObservationsAndDataAssociation to allow the application to reduce the...
mrpt::math::CMatrixFixedNumeric< double, FEAT_SIZE, VEH_SIZE > KFMatrix_FxV
CPoint3D mean
The mean value.
size_t countCommonElements(const CONTAINER1 &a, const CONTAINER2 &b)
Counts the number of elements that appear in both STL-like containers (comparison through the == oper...
size_t getNumberOfLandmarksInTheMap() const
CPose3DQuat mean
The mean value.
void OnObservationModel(const vector_size_t &idx_landmarks_to_predict, vector_KFArray_OBS &out_predictions) const
#define THROW_EXCEPTION(msg)
GLdouble GLdouble GLdouble GLdouble q
bool useMapMatching
If set to true (default), adjacency matrix is computed from maps matching; otherwise, the method CObservation::likelihoodWith will be called directly from the SFs.
void updatePartitions(std::vector< vector_uint > &partitions)
This method executed only the neccesary part of the partition to take into account the lastest added ...
void processActionObservation(mrpt::obs::CActionCollection::Ptr &action, mrpt::obs::CSensoryFrame::Ptr &SF)
Process one new action and observations to update the map and robot pose estimate.
This file implements several operations that operate element-wise on individual or pairs of container...
void OnNormalizeStateVector()
This method is called after the prediction and after the update, to give the user an opportunity to n...
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
mrpt::math::CMatrixDouble77 cov
The 7x7 covariance matrix.
mrpt::vector_size_t predictions_IDs
void saveMapAndPath2DRepresentationAsMATLABFile(const std::string &fil, float stdCount=3.0f, const std::string &styleLandmarks=std::string("b"), const std::string &stylePath=std::string("r"), const std::string &styleRobot=std::string("r")) const
Save the current state of the filter (robot pose & map) to a MATLAB script which displays all the ele...
mrpt::utils::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int > m_IDs
The mapping between landmark IDs and indexes in the Pkk cov.
void OnGetAction(KFArray_ACT &out_u) const
Must return the action vector u.
void OnTransitionJacobian(KFMatrix_VxV &out_F) const
Implements the transition Jacobian .
double computeOffDiagonalBlocksApproximationError(const std::vector< vector_uint > &landmarksMembership) const
Computes the ratio of the missing information matrix elements which are ignored under a certain parti...
void sphericalCoordinates(const mrpt::math::TPoint3D &point, double &out_range, double &out_yaw, double &out_pitch, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacob_dryp_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *out_jacob_dryp_dpose=nullptr) const
Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object...
void runOneKalmanIteration()
The main entry point, executes one complete step: prediction + update.
const Scalar * const_iterator
KFMatrix m_pkk
The system full covariance matrix.
mrpt::poses::CPose3DQuat getCurrentRobotPoseMean() const
Get the current robot pose mean, as a 3D+quaternion pose.
int64_t TLandmarkID
The type for the IDs of landmarks.
TDataAssocInfo m_last_data_association
Last data association.
void getLastPartitionLandmarks(std::vector< vector_uint > &landmarksMembership) const
Return the partitioning of the landmarks in clusters accoring to the last partition.
float std_odo_z_additional
Additional std.
GLubyte GLubyte GLubyte GLubyte w
void OnNewLandmarkAddedToMap(const size_t in_obsIdx, const size_t in_idxNewFeat)
If applicable to the given problem, do here any special handling of adding a new landmark to the map...
mrpt::math::CMatrixTemplateNumeric< kftype > Y_pred_means
Declares a class that represents a Probability Density function (PDF) of a 3D pose using a quaternion...
This class allows loading and storing values and vectors of different types from a configuration text...
T square(const T x)
Inline function for the square of a number.
mrpt::math::CMatrixFixedNumeric< double, OBS_SIZE, OBS_SIZE > KFMatrix_OxO
vector_KFArray_OBS all_predictions
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion) override
This method load the options from a ".ini"-like file or memory-stored string list.
void composePoint(const double lx, const double ly, const double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *out_jacobian_df_dpose=nullptr) const
Computes the 3D point G such as .
Represents a probabilistic 3D (6D) movement.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion) override
This method load the options from a ".ini"-like file or memory-stored string list.
void clear()
Clear the contents of the bi-map.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
const std::map< VALUE, KEY > & getInverseMap() const
Return a read-only reference to the internal map KEY->VALUES.
void OnTransitionNoise(KFMatrix_VxV &out_Q) const
Implements the transition noise covariance .
void wrapToPiInPlace(T &a)
Modifies the given angle to translate it into the ]-pi,pi] range.
A numeric matrix of compile-time fixed size.
This base provides a set of functions for maths stuff.
Declares a class that represents a Probability Density function (PDF) of a 2D pose ...
std::shared_ptr< CActionRobotMovement2D > Ptr
static size_t get_vehicle_size()
TKF_options KF_options
Generic options for the Kalman Filter algorithm itself.
TDataAssociationMetric data_assoc_metric
A helper class that can convert an enum value into its textual representation, and viceversa...
int partitioningMethod
Applicable only if "doPartitioningExperiment=true".
TDataAssociationMetric
Different metrics for data association, used in mrpt::slam::data_association For a comparison of both...
TOptions()
Default values.
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
CMatrixTemplateNumeric< double > CMatrixDouble
Declares a matrix of double numbers (non serializable).
void OnSubstractObservationVectors(KFArray_OBS &A, const KFArray_OBS &B) const
Computes A=A-B, which may need to be re-implemented depending on the topology of the individual scala...
static size_t get_observation_size()
mrpt::aligned_containers< KFArray_OBS >::vector_t vector_KFArray_OBS
CONTAINER::Scalar sum(const CONTAINER &v)
Computes the sum of all the elements.
A bidirectional version of std::map, declared as bimap<KEY,VALUE> and which actually contains two std...
const_iterator find_key(const KEY &k) const
std::shared_ptr< CPose3DPDF > Ptr
std::shared_ptr< CSetOfObjects > Ptr
This namespace contains representation of robot actions and observations.
void loadOptions(const mrpt::utils::CConfigFileBase &ini)
Load options from a ini-like file/text.
bool inverse(const VALUE &v, KEY &out_k) const
Get the key associated the given value, VALUE->KEY, returning false if not present.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
mrpt::slam::CIncrementalMapPartitioner::TOptions options
CIncrementalMapPartitioner mapPartitioner
Used for map partitioning experiments.
std::shared_ptr< CSensoryFrame > Ptr
TDataAssociationMetric data_assoc_IC_metric
Whether to use mahalanobis (->chi2 criterion) vs.
double x
X,Y,Z coordinates.
std::shared_ptr< CActionRobotMovement3D > Ptr
size_t size() const
Returns the count of pairs (pose,sensory data)
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
void get(size_t index, mrpt::poses::CPose3DPDF::Ptr &out_posePDF, mrpt::obs::CSensoryFrame::Ptr &out_SF) const
Access to the i'th pair, first one is index '0'.
mrpt::maps::CSimpleMap m_SFs
The sequence of all the observations and the robot path (kept for debugging, statistics,etc)
GLsizei const GLchar ** string
double data_assoc_IC_ml_threshold
Only if data_assoc_IC_metric==ML, the log-ML threshold (Default=0.0)
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
mrpt::math::CArrayDouble< 3 > m_coords
The translation vector [x,y,z].
int fprintf(FILE *fil, const char *format,...) noexcept MRPT_printf_format_check(2
An OS-independent version of fprintf.
double kftype
The numeric type used in the Kalman Filter (default=double)
void OnGetObservationNoise(KFMatrix_OxO &out_R) const
Return the observation NOISE covariance matrix, that is, the model of the Gaussian additive noise of ...
mrpt::math::CArrayNumeric< double, OBS_SIZE > KFArray_OBS
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
uint64_t TLandmarkID
Unique IDs for landmarks.
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
std::shared_ptr< CActionCollection > Ptr
mrpt::obs::CSensoryFrame::Ptr m_SF
Set up by processActionObservation.
void getCurrentState(mrpt::poses::CPose3DQuatPDFGaussian &out_robotPose, std::vector< mrpt::math::TPoint3D > &out_landmarksPositions, std::map< unsigned int, mrpt::maps::CLandmark::TLandmarkID > &out_landmarkIDs, mrpt::math::CVectorDouble &out_fullState, mrpt::math::CMatrixDouble &out_fullCovariance) const
Returns the complete mean and cov.
mrpt::slam::CRangeBearingKFSLAM::TOptions options
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
float quantiles_3D_representation
Default = 3.
std::shared_ptr< CObservationBearingRange > Ptr
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &iniFile, const std::string §ion) override
This method load the options from a ".ini"-like file or memory-stored string list.
CSetOfObjects::Ptr CornerXYZ(float scale=1.0)
Returns three arrows representing a X,Y,Z 3D corner.
std::map< observation_index_t, prediction_index_t > associations
For each observation (with row index IDX_obs in the input "Z_observations"), its association in the p...
mrpt::math::CMatrixFixedNumeric< double, FEAT_SIZE, OBS_SIZE > KFMatrix_FxO
GLenum GLenum GLvoid * row
This observation represents a number of range-bearing value pairs, each one for a detected landmark...
void dumpToTextStream(mrpt::utils::CStream &out) const override
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
void OnTransitionModel(const KFArray_ACT &in_u, KFArray_VEH &inout_x, bool &out_skipPrediction) const
Implements the transition model .
void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const
Returns a 3D representation of the landmarks in the map and the robot 3D position according to the cu...
GLsizei GLsizei GLchar * source
void OnGetObservationsAndDataAssociation(vector_KFArray_OBS &out_z, vector_int &out_data_association, const vector_KFArray_OBS &in_all_predictions, const KFMatrix &in_S, const vector_size_t &in_lm_indices_in_S, const KFMatrix_OxO &in_R)
This is called between the KF prediction step and the update step, and the application must return th...
Declares a class that represents a Probability Density function (PDF) of a 3D pose ...
Information for data-association:
mrpt::math::CMatrixFixedNumeric< double, OBS_SIZE, VEH_SIZE > KFMatrix_OxV
std::vector< size_t > vector_size_t
void OnInverseObservationModel(const KFArray_OBS &in_z, KFArray_FEAT &out_yn, KFMatrix_FxV &out_dyn_dxv, KFMatrix_FxO &out_dyn_dhn) const
If applicable to the given problem, this method implements the inverse observation model needed to ex...
CRangeBearingKFSLAM()
Constructor.
bool create_simplemap
Whether to fill m_SFs (default=false)
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen.
std::vector< int32_t > vector_int
mrpt::math::CMatrixFixedNumeric< double, VEH_SIZE, VEH_SIZE > KFMatrix_VxV
TDataAssociationMethod data_assoc_method
Eigen::Matrix< typename MATRIX::Scalar, MATRIX::ColsAtCompileTime, MATRIX::ColsAtCompileTime > cov(const MATRIX &v)
Computes the covariance matrix from a list of samples in an NxM matrix, where each row is a sample...
bool doPartitioningExperiment
If set to true (default=false), map will be partitioned using the method stated by partitioningMethod...
mrpt::math::CQuaternionDouble m_quat
The quaternion.
TDataAssociationResults results
void insert(const KEY &k, const VALUE &v)
Insert a new pair KEY<->VALUE in the bi-map.
#define MRPT_LOAD_CONFIG_VAR( variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
mrpt::math::CMatrixTemplateNumeric< kftype > Y_pred_covs
unsigned int addMapFrame(const mrpt::obs::CSensoryFrame::Ptr &frame, const mrpt::poses::CPosePDF::Ptr &robotPose2D)
void insert(const mrpt::poses::CPose3DPDF *in_posePDF, const mrpt::obs::CSensoryFrame &in_SF)
Add a new pair to the sequence.
static size_t get_feature_size()
mrpt::obs::CActionCollection::Ptr m_action
Set up by processActionObservation.
TDataAssociationMethod
Different algorithms for data association, used in mrpt::slam::data_association.
virtual ~CRangeBearingKFSLAM()
Destructor:
mrpt::math::CArrayNumeric< double, FEAT_SIZE > KFArray_FEAT
std::vector< vector_uint > m_lastPartitionSet
#define ASSERTMSG_(f, __ERROR_MSG)
float std_sensor_range
The std.
KFVector m_xkk
The system state vector.
double data_assoc_IC_chi2_thres
Threshold in [0,1] for the chi2square test for individual compatibility between predictions and obser...
void data_association_full_covariance(const mrpt::math::CMatrixDouble &Z_observations_mean, const mrpt::math::CMatrixDouble &Y_predictions_mean, const mrpt::math::CMatrixDouble &Y_predictions_cov, TDataAssociationResults &results, const TDataAssociationMethod method=assocJCBB, const TDataAssociationMetric metric=metricMaha, const double chi2quantile=0.99, const bool DAT_ASOC_USE_KDTREE=true, const std::vector< prediction_index_t > &predictions_IDs=std::vector< prediction_index_t >(), const TDataAssociationMetric compatibilityTestMetric=metricMaha, const double log_ML_compat_test_threshold=0.0)
Computes the data-association between the prediction of a set of landmarks and their observations...
EIGEN_STRONG_INLINE double mean() const
Computes the mean of the entire matrix.
void clear()
Remove all stored pairs.
A gaussian distribution for 3D points.
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
void getLastPartitionLandmarksAsIfFixedSubmaps(size_t K, std::vector< vector_uint > &landmarksMembership)
For testing only: returns the partitioning as "getLastPartitionLandmarks" but as if a fixed-size subm...
mrpt::math::CVectorFloat stds_Q_no_odo
A 7-length vector with the std.
std::shared_ptr< CEllipsoid > Ptr