35 #include <mrpt/version.h> 37 #include <mrpt/maps/COccupancyGridMap2D.h> 38 using mrpt::maps::COccupancyGridMap2D;
40 #include <mrpt/maps/CLandmarksMap.h> 41 using mrpt::maps::CLandmarksMap;
55 mrpt::math::CMatrixDouble33 cov;
56 cov(0, 0) = 1, cov(1, 1) = 1, cov(2, 2) = 2 * M_PI;
58 mrpt::poses::CPosePDFGaussian(mrpt::poses::CPose2D(0, 0, 0), cov);
62 CActionRobotMovement2D::mmGaussian;
69 #if MRPT_VERSION >= 0x199 70 const auto [cov, mean_point] =
initial_pose_.getCovarianceAndMean();
72 mrpt::math::CMatrixDouble33 cov;
73 mrpt::poses::CPose2D mean_point;
78 "InitializeFilter: %4.3fm, %4.3fm, %4.3frad ", mean_point.x(),
79 mean_point.y(), mean_point.phi());
80 float min_x = mean_point.x() - cov(0, 0);
81 float max_x = mean_point.x() + cov(0, 0);
82 float min_y = mean_point.y() - cov(1, 1);
83 float max_y = mean_point.y() + cov(1, 1);
84 float min_phi = mean_point.phi() - cov(2, 2);
85 float max_phi = mean_point.phi() + cov(2, 2);
87 #if MRPT_VERSION >= 0x199 90 pdf_.resetUniformFreeSpace(
91 metric_map_.mapByClass<COccupancyGridMap2D>().get(), 0.7f,
99 pdf_.resetUniformFreeSpace(
101 min_x, max_x, min_y, max_y, min_phi, max_phi);
107 min_x, max_x, min_y, max_y, min_phi, max_phi,
114 CActionCollection::Ptr _action, CSensoryFrame::Ptr _sf)
124 CSensoryFrame::Ptr _sf, CObservationOdometry::Ptr _odometry)
126 auto action = CActionCollection::Create();
127 CActionRobotMovement2D odom_move;
128 odom_move.timestamp = _sf->getObservationByIndex(0)->timestamp;
135 mrpt::poses::CPose2D incOdoPose =
139 action->insert(odom_move);
148 odom_move.computeFromOdometry(
150 action->insert(odom_move);
156 "No odometry at update %4i -> skipping observation",
CMultiMetricMap metric_map_
map
void updateFilter(CActionCollection::Ptr _action, CSensoryFrame::Ptr _sf)
mrpt::utils::CTicTac tictac_
timer to measure performance
mrpt::bayes::CParticleFilter::TParticleFilterStats pf_stats_
filter statistics
int initial_particle_count_
number of particles for initialization
mrpt::poses::CPose2D odom_last_observation_
correct time
void observation(CSensoryFrame::Ptr _sf, CObservationOdometry::Ptr _odometry)
mrpt::slam::CMonteCarloLocalization2D pdf_
the filter
mrpt::poses::CPosePDFGaussian initial_pose_
initial posed used in initializeFilter()
CActionRobotMovement2D::TMotionModelOptions motion_model_options_
used with odom value motion noise
mrpt::bayes::CParticleFilter pf_
common interface for particle filters
mrpt::system::TTimeStamp time_last_update_
time of the last update
bool use_motion_model_default_options_
used default odom_params
CActionRobotMovement2D::TMotionModelOptions motion_model_default_options_
used if there are is not odom