24 #ifndef _PLUGINS_REALSENSETHREAD_H_
25 #define _PLUGINS_REALSENSETHREAD_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 <pcl/point_cloud.h>
35 #include <pcl/point_types.h>
37 #ifdef HAVE_REALSENSE1
38 # include <librealsense1/rs.hpp>
40 # include <librealsense/rs.hpp>
46 class SwitchInterface;
65 bool connect_and_start_camera();
66 rs_device *get_camera();
67 void enable_depth_stream();
69 void log_depths(
const uint16_t *image);
70 void fill_pointcloud();
88 typedef pcl::PointXYZ PointType;
91 typedef Cloud::Ptr CloudPtr;
92 typedef Cloud::ConstPtr CloudConstPtr;
95 CloudPtr realsense_depth_;
97 rs_error * rs_error_ = 0;
98 rs_context * rs_context_;
99 rs_device * rs_device_;
100 rs_intrinsics z_intrinsic_;
101 rs_stream rs_stream_type_;
104 std::string frame_id_;
106 bool enable_camera_ =
true;
107 bool camera_running_ =
false;
109 uint restart_after_num_errors_;
110 uint error_counter_ = 0;
112 float cfg_poll_delay_;