58 static bool available();
62 const std::string & deviceId =
"",
64 const Transform & localTransform = Transform::getIdentity());
67 virtual bool init(
const std::string & calibrationFolder =
".",
const std::string & cameraName =
"");
68 virtual bool isCalibrated()
const;
71 virtual bool getPose(
double stamp,
Transform & pose, cv::Mat & covariance,
double maxWaitTime = 0.06);
75 void setEmitterEnabled(
bool enabled);
76 void setIRFormat(
bool enabled,
bool useDepthInsteadOfRightImage);
77 void setResolution(
int width,
int height,
int fps = 30);
78 void setDepthResolution(
int width,
int height,
int fps = 30);
79 void setGlobalTimeSync(
bool enabled);
87 void setJsonConfig(
const std::string & json);
89 void setImagesRectified(
bool enabled);
90 void setOdomProvided(
bool enabled,
bool imageStreamsDisabled=
false,
bool onlyLeftStream =
false);
92#ifdef RTABMAP_REALSENSE2
95 void imu_callback(rs2::frame frame);
96 void pose_callback(rs2::frame frame);
97 void frame_callback(rs2::frame frame);
98 void multiple_message_callback(rs2::frame frame);
100 const double & stamp,
102 unsigned int & poseConfidence,
104 int maxWaitTimeMs = 35);
111#ifdef RTABMAP_REALSENSE2
113 std::vector<rs2::device> dev_;
114 std::string deviceId_;
116 float depth_scale_meters_;
117 cv::Mat depthBuffer_;
122 std::map<double, cv::Vec3f> accBuffer_;
123 std::map<double, cv::Vec3f> gyroBuffer_;
124 std::map<double, std::pair<Transform, unsigned int> > poseBuffer_;
127 double lastImuStamp_;
128 bool clockSyncWarningShown_;
129 bool imuGlobalSyncWarningShown_;
131 bool emitterEnabled_;
135 bool odometryProvided_;
136 bool odometryImagesDisabled_;
137 bool odometryOnlyLeftStream_;
141 int cameraDepthWidth_;
142 int cameraDepthHeight_;
144 bool globalTimeSync_;
147 std::string jsonConfig_;
151 static Transform realsense2PoseRotation_;
152 static Transform realsense2PoseRotationInv_;
virtual bool getPose(double stamp, Transform &pose, cv::Mat &covariance, double maxWaitTime=0.06)
Gets the sensor's pose estimate at a specific timestamp.