Node.h
Go to the documentation of this file.
1 
21 #ifndef ORBSLAM2_ROS_NODE_H_
22 #define ORBSLAM2_ROS_NODE_H_
23 
24 #include <vector>
25 #include <ros/ros.h>
26 #include <ros/time.h>
28 #include <cv_bridge/cv_bridge.h>
29 #include <opencv2/core/core.hpp>
30 
33 #include <tf2_ros/buffer.h>
34 #include <tf2_geometry_msgs/tf2_geometry_msgs.h>
35 
36 #include <dynamic_reconfigure/server.h>
37 #include <orb_slam2_ros/dynamic_reconfigureConfig.h>
38 
39 #include "orb_slam2_ros/SaveMap.h"
40 
45 #include <sensor_msgs/PointCloud2.h>
46 #include <geometry_msgs/PoseStamped.h>
47 #include <sensor_msgs/CameraInfo.h>
48 #include <std_msgs/Bool.h>
49 
50 #include "System.h"
51 
52 
53 
54 class Node
55 {
56  public:
58  ~Node ();
59  void Init ();
60 
61  protected:
62  void Update ();
65 
66  std::string camera_info_topic_;
67 
68  private:
69  void PublishMapPoints (std::vector<ORB_SLAM2::MapPoint*> map_points);
70  void PublishPositionAsTransform (cv::Mat position);
71  void PublishPositionAsPoseStamped(cv::Mat position);
72  void PublishGBAStatus (bool gba_status);
73  void PublishRenderedImage (cv::Mat image);
74  void ParamsChangedCallback(orb_slam2_ros::dynamic_reconfigureConfig &config, uint32_t level);
75  bool SaveMapSrv (orb_slam2_ros::SaveMap::Request &req, orb_slam2_ros::SaveMap::Response &res);
77 
78  // initialization Transform listener
81 
82  tf2::Transform TransformFromMat (cv::Mat position_mat);
83  tf2::Transform TransformToTarget (tf2::Transform tf_in, std::string frame_in, std::string frame_target);
84  sensor_msgs::PointCloud2 MapPointsToPointCloud (std::vector<ORB_SLAM2::MapPoint*> map_points);
85 
86  dynamic_reconfigure::Server<orb_slam2_ros::dynamic_reconfigureConfig> dynamic_param_server_;
87 
92 
94 
95  std::string name_of_node_;
98 
100 
101  std::string map_frame_id_param_;
104  std::string map_file_name_param_;
105  std::string voc_file_name_param_;
111 };
112 
113 #endif //ORBSLAM2_ROS_NODE_H_
std::string camera_info_topic_
Definition: Node.h:66
image_transport::Publisher rendered_image_publisher_
Definition: Node.h:88
ros::Publisher status_gba_publisher_
Definition: Node.h:91
std::string name_of_node_
Definition: Node.h:95
std::string map_frame_id_param_
Definition: Node.h:101
Definition: Node.h:54
void ParamsChangedCallback(orb_slam2_ros::dynamic_reconfigureConfig &config, uint32_t level)
Definition: Node.cc:279
ros::Publisher map_points_publisher_
Definition: Node.h:89
dynamic_reconfigure::Server< orb_slam2_ros::dynamic_reconfigureConfig > dynamic_param_server_
Definition: Node.h:86
ros::NodeHandle node_handle_
Definition: Node.h:96
ORB_SLAM2::System * orb_slam_
Definition: Node.h:63
ros::ServiceServer service_server_
Definition: Node.h:93
void PublishGBAStatus(bool gba_status)
Definition: Node.cc:181
void PublishPositionAsPoseStamped(cv::Mat position)
Definition: Node.cc:167
void LoadOrbParameters(ORB_SLAM2::ORBParameters &parameters)
Definition: Node.cc:305
void PublishMapPoints(std::vector< ORB_SLAM2::MapPoint * > map_points)
Definition: Node.cc:90
std::string camera_frame_id_param_
Definition: Node.h:102
std::string map_file_name_param_
Definition: Node.h:104
ros::Time current_frame_time_
Definition: Node.h:64
void Init()
Definition: Node.cc:23
void PublishPositionAsTransform(cv::Mat position)
Definition: Node.cc:150
bool SaveMapSrv(orb_slam2_ros::SaveMap::Request &req, orb_slam2_ros::SaveMap::Response &res)
Definition: Node.cc:292
std::string voc_file_name_param_
Definition: Node.h:105
sensor_msgs::PointCloud2 MapPointsToPointCloud(std::vector< ORB_SLAM2::MapPoint * > map_points)
Definition: Node.cc:232
Node(ORB_SLAM2::System::eSensor sensor, ros::NodeHandle &node_handle, image_transport::ImageTransport &image_transport)
Definition: Node.cc:5
tf2::Transform TransformToTarget(tf2::Transform tf_in, std::string frame_in, std::string frame_target)
Definition: Node.cc:95
void PublishRenderedImage(cv::Mat image)
Definition: Node.cc:187
~Node()
Definition: Node.cc:13
std::string target_frame_id_param_
Definition: Node.h:103
tf2::Transform TransformFromMat(cv::Mat position_mat)
Definition: Node.cc:196
bool publish_pointcloud_param_
Definition: Node.h:107
bool load_map_param_
Definition: Node.h:106
int min_observations_per_point_
Definition: Node.h:110
bool publish_tf_param_
Definition: Node.h:108
ros::Publisher pose_publisher_
Definition: Node.h:90
void Update()
Definition: Node.cc:66
boost::shared_ptr< tf2_ros::TransformListener > tfListener
Definition: Node.h:80
boost::shared_ptr< tf2_ros::Buffer > tfBuffer
Definition: Node.h:79
image_transport::ImageTransport image_transport_
Definition: Node.h:97
ORB_SLAM2::System::eSensor sensor_
Definition: Node.h:99
bool publish_pose_param_
Definition: Node.h:109


orb_slam2_ros
Author(s):
autogenerated on Wed Apr 21 2021 02:53:05