Added resolution parameters for Usb camera and realsense2 sources

This commit is contained in:
matlabbe
2019-05-15 19:21:32 -04:00
parent f8a8e55e7e
commit 71f7515775
6 changed files with 219 additions and 18 deletions

View File

@@ -59,7 +59,6 @@ public:
static bool available();
public:
// default local transform z in, x right, y down));
CameraRealSense2(
const std::string & deviceId = "",
float imageRate = 0,
@@ -72,8 +71,11 @@ public:
bool odomProvided() const;
// parameters are set during initialization
// D400 series
void setEmitterEnabled(bool enabled);
void setIRDepthFormat(bool enabled);
void setResolution(int width, int height, int fps = 30);
// T265 related parameters
void setImagesRectified(bool enabled);
void setOdomProvided(bool enabled);
@@ -117,6 +119,9 @@ private:
bool irDepth_;
bool rectifyImages_;
bool odometryProvided_;
int cameraWidth_;
int cameraHeight_;
int cameraFps_;
static Transform realsense2PoseRotation_;
static Transform realsense2PoseRotationInv_;

View File

@@ -58,6 +58,13 @@ public:
int getUsbDevice() const {return _usbDevice;}
const std::string & getFilePath() const {return _filePath;}
/**
* Set wanted usb resolution, should be set before initialization. 0 means
* default resolution. It won't be applied if a valid camera calibration
* has been loaded, thus resolution from calibration is used.
* */
void setResolution(int width, int height) {_width=width, _height=height;}
protected:
virtual SensorData captureImage(CameraInfo * info = 0);
@@ -72,6 +79,8 @@ private:
// Usb camera
int _usbDevice;
std::string _guid;
int _width;
int _height;
CameraModel _model;
};