pointCloudPublisher.h
Go to the documentation of this file.
1 //
2 // Created by inspur on 2020/5/13.
3 //
4 
5 #ifndef ORB_SLAM2_POINTCLOUDPUBLISHER_H
6 #define ORB_SLAM2_POINTCLOUDPUBLISHER_H
7 
8 #include <ros/ros.h>
9 #include <cv_bridge/cv_bridge.h>
13 #include <sensor_msgs/PointCloud2.h>
14 
15 #include <ros/spinner.h>
16 #include <sensor_msgs/CameraInfo.h>
17 #include <sensor_msgs/Image.h>
19 
20 #include <image_transport/image_transport.h>
21 #include <image_transport/subscriber_filter.h>
22 
25 #include <pcl/point_cloud.h>
26 #include <pcl/point_types.h>
27 #include <pcl/io/pcd_io.h>
28 #include <pcl_conversions/pcl_conversions.h>
29 #include <pcl/filters/voxel_grid.h>
30 #include <pcl/filters/passthrough.h>
31 #include "System.h"
32 #include "nav_msgs/Odometry.h"
33 #include <tf/transform_datatypes.h>
34 #include <tf/transform_listener.h>
36 
38 {
39 public:
41 private:
43  ros::Publisher mOctomapPub;//八叉树发布
44  ros::Publisher mOccupancyMapPub;//2D占据栅格地图发布
45  ros::Publisher mOdomPub;//odom数据发布
46 
47  bool publish_tf;
48  std::string base_frame_id;
49  std::string camera_frame_id;
50  std::string world_frame_id;
51 
54  shared_ptr<thread> PointCloudPublishThread;
55  shared_ptr<thread> OdomPublishThread;
56  shared_ptr<PointCloudMapping> mpPointCloudMapping;
61  void PublishMap();
62  void PublishOdom();
63 
64  std::mutex MutexPose;
65 
67  cv::Mat Tcw;
68 
71 
73  tf::Transform base_to_camera; // static, cached
74  tf::Transform camera_to_base; // static, cached, calculated from base_to_laser_
75 
76  void getBaseToCameraTf();
77  int getPose(float &x, float &y, float &z, float &qx, float &qy, float &qz, float &qw);
78  void printTf(tf::Transform tf);
81 };
82 
83 
84 
85 #endif //ORB_SLAM2_POINTCLOUDPUBLISHER_H
shared_ptr< PointCloudMapping > mpPointCloudMapping
tf::Transform base_to_camera
ros::Publisher mOccupancyMapPub
tf::TransformBroadcaster tf_broadcaster
PointCloudPublisher(ros::NodeHandle *nh, ORB_SLAM2::System *SLAM)
void printTf(tf::Transform tf)
shared_ptr< thread > OdomPublishThread
int getPose(float &x, float &y, float &z, float &qx, float &qy, float &qz, float &qw)
tf::Transform camera_to_base
ros::NodeHandle * nh
ros::Publisher mPointCloudPub
DataCache< System::PointCloud > * mpPointCloudDataCache
tf::TransformListener tf_listener
DataCache< cv::Mat > * mpTcwDataCache
shared_ptr< thread > PointCloudPublishThread
ros::Publisher mOctomapPub
tf::Transform get_tf_from_stamped_tf(tf::StampedTransform sTf)
ORB_SLAM2::System * SLAM
void printStampedTf(tf::StampedTransform sTf)


orb_slam2_with_maps_odom
Author(s): teng zhang
autogenerated on Fri Sep 25 2020 03:24:47