38 #include <opencv2/imgproc/imgproc.hpp> 47 _imageRate(imageRate),
48 _localTransform(localTransform),
49 _targetImageSize(0,0),
50 _frameRateTimer(new
UTimer()),
74 bool warnFrameRateTooHigh =
false;
75 float actualFrameRate = 0;
84 else if(sleepTime < 0)
86 warnFrameRateTooHigh =
true;
98 UDEBUG(
"slept=%fs vs target=%fs", slept, 1.0/
double(imageRate));
103 double captureTime = timer.
ticks();
104 if(warnFrameRateTooHigh)
106 UWARN(
"Camera: Cannot reach target image rate %f Hz, current rate is %f Hz and capture time = %f s.",
107 imageRate, actualFrameRate, captureTime);
111 UDEBUG(
"Time capturing image = %fs", captureTime);
115 info->
id = data.
id();
static std::string getDir(const std::string &filePath)
Some conversion functions.
bool initFromFile(const std::string &calibrationPath)
Camera(float imageRate=0, const Transform &localTransform=CameraModel::opticalRotation())
virtual SensorData captureImage(CameraInfo *info=0)=0
std::list< std::string > uSplit(const std::string &str, char separator= ' ')
virtual bool init(const std::string &calibrationFolder=".", const std::string &cameraName="")=0
SensorData takeImage(CameraInfo *info=0)
Wrappers of STL for convenient functions.
void uSleep(unsigned int ms)