24 #ifndef _PLUGINS_REALSENSE2THREAD_H_
25 #define _PLUGINS_REALSENSE2THREAD_H_
27 #include <aspect/blackboard.h>
28 #include <aspect/blocked_timing.h>
29 #include <aspect/clock.h>
30 #include <aspect/configurable.h>
31 #include <aspect/logging.h>
32 #include <aspect/pointcloud.h>
33 #include <core/threading/thread.h>
34 #include <librealsense2/rsutil.h>
35 #include <pcl/point_cloud.h>
36 #include <pcl/point_types.h>
38 #include <librealsense2/rs.hpp>
39 #include <librealsense2/rs_advanced_mode.hpp>
44 class SwitchInterface;
64 bool get_camera(rs2::device &dev);
65 void enable_depth_stream();
66 void disable_depth_stream();
84 typedef pcl::PointXYZ PointType;
87 typedef Cloud::Ptr CloudPtr;
88 typedef Cloud::ConstPtr CloudConstPtr;
91 CloudPtr realsense_depth_;
93 rs2::pipeline *rs_pipe_;
94 rs2::context * rs_context_;
95 rs2::device rs_device_;
96 rs2::frameset rs_data_;
97 rs2_intrinsics intrinsics_;
100 std::string frame_id_;
102 std::string switch_if_name_;
105 bool camera_running_ =
false;
106 bool enable_camera_ =
true;
107 bool depth_enabled_ =
false;
108 uint restart_after_num_errors_;
109 uint error_counter_ = 0;