mrpt_ekf_slam_3d_wrapper.h
Go to the documentation of this file.
1 /*
2  * File: mrpt_ekf_slam_3d_wrapper.h
3  * Author: Vladislav Tananaev
4  *
5  */
6 
7 #pragma once
8 #include <iostream> // std::cout
9 #include <fstream> // std::ifstream
10 #include <string>
12 // add ros libraries
13 #include <ros/ros.h>
14 #include <ros/package.h>
15 #include <tf/transform_listener.h>
17 //#include <tf_conversions/tf_eigen.h>
18 #include "Eigen/Core"
19 #include "Eigen/Geometry"
20 // add ros msgs
21 #include <std_msgs/String.h>
22 #include <std_msgs/Int32.h>
23 #include <geometry_msgs/PoseArray.h>
24 #include <geometry_msgs/PoseWithCovarianceStamped.h>
25 #include <visualization_msgs/MarkerArray.h>
26 #include <visualization_msgs/Marker.h>
27 // mrpt bridge libs
28 #include <mrpt_bridge/pose.h>
29 #include <mrpt_bridge/landmark.h>
31 #include <mrpt_bridge/time.h>
34 #include <mrpt/utils/CConfigFile.h>
35 #include <mrpt/random.h>
36 
37 #include <mrpt/system/filesystem.h>
38 #include <mrpt/system/os.h>
40 #include <mrpt/poses/CPose3DPDF.h>
43 #include <mrpt/opengl/CEllipsoid.h>
45 #include <mrpt_msgs/ObservationRangeBearing.h>
46 
47 #if MRPT_VERSION >= 0x130
48 #include <mrpt/obs/CActionRobotMovement2D.h>
49 #include <mrpt/obs/CActionRobotMovement3D.h>
50 #include <mrpt/obs/CObservationOdometry.h>
51 #include <mrpt/obs/CRawlog.h>
52 using namespace mrpt::maps;
53 using namespace mrpt::obs;
54 #else
55 #include <mrpt/slam/CActionRobotMovement2D.h>
56 #include <mrpt/slam/CActionRobotMovement3D.h>
57 #include <mrpt/slam/CObservationOdometry.h>
58 #include <mrpt/slam/CRawlog.h>
59 #endif
60 
66 {
67 public:
75  ~EKFslamWrapper();
79  void get_param();
87  void makeRightHanded(Eigen::Matrix3d& eigenvectors, Eigen::Vector3d& eigenvalues);
88 
96  void computeEllipseOrientationScale(tf::Quaternion& orientation, Eigen::Vector3d& scale,
97  const mrpt::math::CMatrixDouble covariance);
101  void init();
107  bool rawlogPlay();
113  bool is_file_exists(const std::string& name);
117  void viz_state();
121  void viz_dataAssociation();
128  void odometryForCallback(CObservationOdometry::Ptr& _odometry, const std_msgs::Header& _msg_header);
139  void landmarkCallback(const mrpt_msgs::ObservationRangeBearing& _msg);
145  void updateSensorPose(std::string _frame_id);
158  bool waitForTransform(mrpt::poses::CPose3D& des, const std::string& target_frame, const std::string& source_frame,
159  const ros::Time& time, const ros::Duration& timeout,
160  const ros::Duration& polling_sleep_duration = ros::Duration(0.01));
165  void publishTF();
166 
167 private:
172  // Subscribers
173  std::vector<ros::Subscriber> sensorSub_;
174  std::string rawlog_filename;
175  std::string ini_filename;
176  std::string global_frame_id;
177  std::string odom_frame_id;
178  std::string base_frame_id;
179 
180  // Sensor source
181  std::string sensor_source;
182 
183  std::map<std::string, mrpt::poses::CPose3D> landmark_poses_;
184 
186  float t_exec;
187 
188  ros::Publisher data_association_viz_pub_, state_viz_pub_;
191 };
192 
float t_exec
the time which take one SLAM update execution
The EKFslamWrapper class provides the ROS wrapper for EKF SLAM 3d from MRPT libraries.
CTicTac tictac
timer for SLAM performance evaluation
GLenum GLenum GLenum GLenum GLenum scale
std::string odom_frame_id
/odom frame
std::string target_frame
double rawlog_play_delay
delay of replay from rawlog file
std::string global_frame_id
/map frame
std::string base_frame_id
robot frame
ros::NodeHandle n_
Node handler.
bool rawlog_play_
true if rawlog file exists
GLuint const GLchar * name
tf::TransformListener listenerTF_
transform listener
std::string sensor_source
2D laser scans
std::string rawlog_filename
name of rawlog file
std::string ini_filename
name of ini file
The EKFslam class provides EKF SLAM 3d from MRPT libraries.
std::vector< ros::Subscriber > sensorSub_
list of sensors topics
tf::TransformBroadcaster tf_broadcaster_
transform broadcaster
std::map< std::string, mrpt::poses::CPose3D > landmark_poses_
landmark poses with respect to the map
ros::Publisher state_viz_pub_


mrpt_ekf_slam_3d
Author(s): Jose Luis, Vladislav Tananaev
autogenerated on Sat May 2 2020 03:44:08