Skip to content

Commit

Permalink
CameraRealSense2: refactored for freezing/crash issues on stop
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Jan 18, 2021
1 parent 70e9dff commit 5d77746
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 98 deletions.
14 changes: 8 additions & 6 deletions corelib/include/rtabmap/core/camera/CameraRealSense2.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <pcl/pcl_config.h>

#ifdef RTABMAP_REALSENSE2
#include <librealsense2/rs.hpp>
#include <librealsense2/hpp/rs_frame.hpp>
#endif

Expand Down Expand Up @@ -86,6 +87,7 @@ class RTABMAP_EXP CameraRealSense2 :

#ifdef RTABMAP_REALSENSE2
private:
void close();
void imu_callback(rs2::frame frame);
void pose_callback(rs2::frame frame);
void frame_callback(rs2::frame frame);
Expand All @@ -103,14 +105,14 @@ class RTABMAP_EXP CameraRealSense2 :

private:
#ifdef RTABMAP_REALSENSE2
rs2::context * ctx_;
std::vector<rs2::device *> dev_;
rs2::context ctx_;
std::vector<rs2::device> dev_;
std::string deviceId_;
rs2::syncer * syncer_;
rs2::syncer syncer_;
float depth_scale_meters_;
rs2_intrinsics * depthIntrinsics_;
rs2_intrinsics * rgbIntrinsics_;
rs2_extrinsics * depthToRGBExtrinsics_;
rs2_intrinsics depthIntrinsics_;
rs2_intrinsics rgbIntrinsics_;
rs2_extrinsics depthToRGBExtrinsics_;
cv::Mat depthBuffer_;
cv::Mat rgbBuffer_;
CameraModel model_;
Expand Down
Loading

0 comments on commit 5d77746

Please sign in to comment.