Go to the documentation of this file.
39 #include <QtCore/QMetaType>
40 #include <QHBoxLayout>
41 #include <QVBoxLayout>
44 #include <QDialogButtonBox>
46 #include <QPushButton>
55 processingImages_(
false),
56 parameters_(parameters),
59 qRegisterMetaType<rtabmap::SensorData>(
"rtabmap::SensorData");
64 QHBoxLayout * layout =
new QHBoxLayout();
65 layout->setContentsMargins(0,0,0,0);
69 QLabel * decimationLabel =
new QLabel(
"Decimation",
this);
75 pause_ =
new QPushButton(
"Pause",
this);
76 pause_->setCheckable(
true);
85 #ifdef HAVE_OPENCV_ARUCO
90 markerCheckbox_->setToolTip(
"Disabled: RTAB-Map is not built with OpenCV's aruco module.");
96 QDialogButtonBox * buttonBox =
new QDialogButtonBox(
this);
97 buttonBox->setStandardButtons(QDialogButtonBox::Close);
98 connect(buttonBox, SIGNAL(rejected()),
this, SLOT(reject()));
100 QHBoxLayout * layout2 =
new QHBoxLayout();
101 layout2->addWidget(
pause_);
102 layout2->addWidget(decimationLabel);
108 layout2->addStretch(1);
109 layout2->addWidget(buttonBox);
111 QVBoxLayout * vlayout =
new QVBoxLayout(
this);
112 vlayout->setContentsMargins(0,0,0,0);
113 vlayout->setSpacing(0);
114 vlayout->addLayout(layout, 1);
115 vlayout->addLayout(layout2);
117 this->setLayout(vlayout);
136 std::map<int, MarkerInfo> detections;
137 if(!
data.imageRaw().empty())
139 std::vector<CameraModel> models;
142 models =
data.cameraModels();
145 for(
size_t i=0;
i<
data.stereoCameraModels().
size(); ++
i)
147 models.push_back(
data.stereoCameraModels()[
i].left());
152 if(!models.empty() && models[0].isValidForProjection())
154 cv::Mat imageWithDetections;
164 if(!
data.depthOrRightRaw().empty())
167 sizes.append(QString(
" Depth=%1x%2").
arg(
data.depthOrRightRaw().cols).
arg(
data.depthOrRightRaw().rows));
171 if(!
data.depthOrRightRaw().empty() &&
172 ((
data.stereoCameraModels().size() &&
data.stereoCameraModels()[0].isValidForProjection()) || (
data.cameraModels().size() &&
data.cameraModels().at(0).isValidForProjection())))
176 if(!
data.imageRaw().empty() && !
data.depthOrRightRaw().empty())
181 else if(!
data.depthOrRightRaw().empty())
188 #if PCL_VERSION_COMPARE(>=, 1, 7, 2)
192 if(!detections.empty())
194 for(std::map<int, MarkerInfo>::const_iterator
iter=detections.begin();
iter!=detections.end(); ++
iter)
196 #if PCL_VERSION_COMPARE(>=, 1, 7, 2)
201 std::string(
"landmark_str_") + num,
211 if(!
data.laserScanRaw().isEmpty())
216 if(
data.laserScanRaw().hasNormals())
218 if(
data.laserScanRaw().hasIntensity())
222 else if(
data.laserScanRaw().hasRGB())
231 else if(
data.laserScanRaw().hasIntensity())
235 else if(
data.laserScanRaw().hasRGB())
278 QMetaObject::invokeMethod(
this,
"showImage",
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudINormal(const LaserScan &laserScan, const Transform &transform=Transform(), float intensity=0.0f)
void removeAllCoordinates(const std::string &prefix="")
RTABMAP_DEPRECATED MapIdPose detect(const cv::Mat &image, const CameraModel &model, const cv::Mat &depth=cv::Mat(), float *estimatedMarkerLength=0, cv::Mat *imageWithDetections=0)
void setImageDepthShown(bool shown)
constexpr arg(const char *name=nullptr)
bool addCloud(const std::string &id, const pcl::PCLPointCloud2Ptr &binaryCloud, const Transform &pose, bool rgb, bool hasNormals, bool hasIntensity, const QColor &color=QColor(), int viewport=1)
QCheckBox * showScanCheckbox_
std::vector< Array2i > sizes
std::map< std::string, std::string > ParametersMap
MarkerDetector * markerDetector_
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT cloudRGBFromSensorData(const SensorData &sensorData, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0, const ParametersMap &stereoParameters=ParametersMap(), const std::vector< float > &roiRatios=std::vector< float >())
void setImage(const QImage &image, const std::vector< CameraModel > &models=std::vector< CameraModel >(), const Transform &pose=Transform())
virtual std::string getClassName() const =0
std::string UTILITE_EXPORT uNumber2Str(unsigned int number)
QSpinBox * decimationSpin_
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudRGB(const LaserScan &laserScan, const Transform &transform=Transform(), unsigned char r=100, unsigned char g=100, unsigned char b=100)
void addOrUpdateCoordinate(const std::string &id, const Transform &transform, double scale, bool foreground=false)
CameraViewer(QWidget *parent=0, const ParametersMap ¶meters=ParametersMap())
QCheckBox * showCloudCheckbox_
LaserScan RTABMAP_CORE_EXPORT downsample(const LaserScan &cloud, int step)
void unregisterFromEventsManager()
void setCloudVisibility(const std::string &id, bool isVisible)
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudI(const LaserScan &laserScan, const Transform &transform=Transform(), float intensity=0.0f)
virtual bool handleEvent(UEvent *event)
std::string UTILITE_EXPORT uFormat(const char *fmt,...)
const QMap< std::string, Transform > & getAddedClouds() const
void setImageDepth(const cv::Mat &imageDepth)
ULogger class and convenient macros.
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT cloudFromSensorData(const SensorData &sensorData, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0, const ParametersMap &stereoParameters=ParametersMap(), const std::vector< float > &roiRatios=std::vector< float >())
const SensorData & data() const
ParametersMap parameters_
iterator iter(handle obj)
void setDecimation(int value)
void showImage(const rtabmap::SensorData &data)
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloud(const LaserScan &laserScan, const Transform &transform=Transform())
QImage uCvMat2QImage(const cv::Mat &image, bool isBgr=true, uCvQtDepthColorMap colorMap=uCvQtDepthWhiteToBlack, float depthMin=0, float depthMax=0)
void addOrUpdateText(const std::string &id, const std::string &text, const Transform &position, double scale, const QColor &color, bool foreground=true)
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudRGBNormal(const LaserScan &laserScan, const Transform &transform=Transform(), unsigned char r=100, unsigned char g=100, unsigned char b=100)
QCheckBox * markerCheckbox_
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudNormal(const LaserScan &laserScan, const Transform &transform=Transform())
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:07