mrpt_rbpf_slam.h
Go to the documentation of this file.
1 /*
2  * File: mrpt_rbpf_slam.h
3  * Author: Vladislav Tananaev
4  */
5 
6 #pragma once
7 #include <ros/console.h>
8 
9 #include <mrpt/gui/CDisplayWindow3D.h>
10 #include <mrpt/random.h>
11 #include <mrpt/slam/CMetricMapBuilderRBPF.h>
12 #if MRPT_VERSION >= 0x199
13 #include <mrpt/config/CConfigFile.h>
14 #include <mrpt/io/CFileGZInputStream.h>
15 #include <mrpt/io/CFileGZOutputStream.h>
16 #else
17 #include <mrpt/utils/CConfigFile.h>
18 #include <mrpt/utils/CFileGZInputStream.h>
19 #include <mrpt/utils/CFileGZOutputStream.h>
20 #endif
21 #include <mrpt/opengl/CEllipsoid.h>
22 #include <mrpt/opengl/CGridPlaneXY.h>
23 #include <mrpt/opengl/CSetOfLines.h>
24 #include <mrpt/opengl/stock_objects.h>
25 #include <mrpt/poses/CPose3DPDF.h>
26 #include <mrpt/poses/CPosePDFGaussian.h>
27 #include <mrpt/system/filesystem.h>
28 #include <mrpt/system/os.h>
29 #include <mrpt/gui/CDisplayWindow3D.h>
30 #include <mrpt/version.h>
31 #include <mrpt/maps/CMultiMetricMap.h>
32 #include <mrpt/obs/CActionCollection.h>
33 #include <mrpt/obs/CActionRobotMovement2D.h>
34 #include <mrpt/obs/CActionRobotMovement3D.h>
35 #include <mrpt/obs/CObservationBeaconRanges.h>
36 #include <mrpt/obs/CObservationBearingRange.h>
37 #include <mrpt/obs/CObservationOdometry.h>
38 #include <mrpt/obs/CRawlog.h>
39 #include <mrpt/obs/CSensoryFrame.h>
40 
41 namespace mrpt_rbpf_slam
42 {
47 class PFslam
48 {
49 public:
50  struct Options
51  {
52  mrpt::obs::CActionRobotMovement2D::TMotionModelOptions motion_model_options_;
53  mrpt::slam::CMetricMapBuilderRBPF::TConstructionOptions rbpfMappingOptions_;
59  std::string simplemap_path_prefix;
60  } options_;
61 
62  PFslam() = default;
63  virtual ~PFslam();
64 
65  void init3Dwindow();
66 
67  void run3Dwindow();
68 
74  void readIniFile(const std::string& ini_filename);
75 
79  void initSlam(Options options);
80 
87  void readRawlog(const std::string& rawlog_filename,
88  std::vector<std::pair<mrpt::obs::CActionCollection, mrpt::obs::CSensoryFrame>>& data);
89 
96  void observation(const mrpt::obs::CSensoryFrame::ConstPtr sensory_frame,
97  const mrpt::obs::CObservationOdometry::ConstPtr odometry);
98 
99 protected:
100  mrpt::slam::CMetricMapBuilderRBPF mapBuilder_;
101  mrpt::obs::CActionCollection::Ptr action_;
102  mrpt::obs::CSensoryFrame::Ptr sensory_frame_;
103 
104  mrpt::poses::CPose2D odomLastObservation_;
106  mrpt::system::TTimeStamp timeLastUpdate_;
107 
108  const mrpt::maps::CMultiMetricMap* metric_map_;
109  mrpt::poses::CPose3DPDFParticles curPDF;
110 
111  mrpt::gui::CDisplayWindow3D::Ptr win3D_;
112 };
113 } // namespace mrpt_rbpf_slam
mrpt::slam::CMetricMapBuilderRBPF::TConstructionOptions rbpfMappingOptions_
options for SLAM from ini file
bool use_motion_model_default_options_
used default odom_params
The PFslam class provides Rao-Blackwellized Particle filter SLAM from MRPT libraries.
void observation(const mrpt::obs::CSensoryFrame::ConstPtr sensory_frame, const mrpt::obs::CObservationOdometry::ConstPtr odometry)
Calculate the actions from odometry model for current observation.
mrpt::poses::CPose3DPDFParticles curPDF
current robot pose
mrpt::gui::CDisplayWindow3D::Ptr win3D_
MRPT window.
struct mrpt_rbpf_slam::PFslam::Options options_
mrpt::obs::CSensoryFrame::Ptr sensory_frame_
observations
void readIniFile(const std::string &ini_filename)
Read ini file.
mrpt::slam::CMetricMapBuilderRBPF mapBuilder_
map builder
void initSlam(Options options)
initialize the SLAM
mrpt::obs::CActionCollection::Ptr action_
actions
void readRawlog(const std::string &rawlog_filename, std::vector< std::pair< mrpt::obs::CActionCollection, mrpt::obs::CSensoryFrame >> &data)
Read pairs of actions and observations from rawlog file.
mrpt::system::TTimeStamp timeLastUpdate_
last update of the pose and map
const mrpt::maps::CMultiMetricMap * metric_map_
receive map after iteration of SLAM to metric map
mrpt::poses::CPose2D odomLastObservation_
last observation of odometry
mrpt::obs::CActionRobotMovement2D::TMotionModelOptions motion_model_options_


mrpt_rbpf_slam
Author(s): Vladislav Tananaev
autogenerated on Thu Jun 6 2019 19:37:56