mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-04 09:07:47 +08:00
CameraOrbbec: support explicit rate on non-TOF cameras. (#1627)
* rtabmap-rgbd_camera: added width/height options, * using CameraViewer for visualization by default (use -pcl option for old visualization). * CameraViewer: added capture and render rate. * Note that non-TOF orbbec cameras could not be tested.
This commit is contained in:
@@ -54,7 +54,9 @@ CameraViewer::CameraViewer(QWidget * parent, const ParametersMap & parameters) :
|
||||
cloudView_(new CloudViewer(this)),
|
||||
processingImages_(false),
|
||||
parameters_(parameters),
|
||||
markerDetector_(0)
|
||||
markerDetector_(0),
|
||||
lastCapturePeriod_(0.0),
|
||||
previousCaptureStamp_(0.0)
|
||||
{
|
||||
qRegisterMetaType<rtabmap::SensorData>("rtabmap::SensorData");
|
||||
|
||||
@@ -115,6 +117,7 @@ CameraViewer::CameraViewer(QWidget * parent, const ParametersMap & parameters) :
|
||||
vlayout->addLayout(layout2);
|
||||
|
||||
this->setLayout(vlayout);
|
||||
fpsTimer_.start();
|
||||
}
|
||||
|
||||
CameraViewer::~CameraViewer()
|
||||
@@ -180,6 +183,7 @@ void CameraViewer::showImage(const rtabmap::SensorData & data)
|
||||
imageView_->setImageDepth(depthOrRight);
|
||||
sizes.append(QString(" Depth=%1x%2").arg(depthOrRight.cols).arg(depthOrRight.rows));
|
||||
}
|
||||
sizes.append(QString(" FPS capture=%1 render=%2").arg(lastCapturePeriod_>0.0?(int)round(1.0/lastCapturePeriod_):0).arg((int)round(1.0/fpsTimer_.restart()*1000)));
|
||||
imageSizeLabel_->setText(sizes);
|
||||
|
||||
if(!depthOrRight.empty() &&
|
||||
@@ -308,6 +312,8 @@ bool CameraViewer::handleEvent(UEvent * event)
|
||||
{
|
||||
if(camEvent->data().isValid())
|
||||
{
|
||||
lastCapturePeriod_ = camEvent->data().stamp() - previousCaptureStamp_;
|
||||
previousCaptureStamp_ = camEvent->data().stamp();
|
||||
if(!processingImages_ && this->isVisible() && camEvent->data().isValid())
|
||||
{
|
||||
processingImages_ = true;
|
||||
|
||||
Reference in New Issue
Block a user