mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-03 16:47:47 +08:00
Support AprilTAg library not built with aruco
This commit is contained in:
+12
-2
@@ -870,7 +870,14 @@ ENDIF(WITH_FASTCV)
|
|||||||
IF(WITH_APRILTAG)
|
IF(WITH_APRILTAG)
|
||||||
FIND_PACKAGE(apriltag QUIET)
|
FIND_PACKAGE(apriltag QUIET)
|
||||||
IF(apriltag_FOUND)
|
IF(apriltag_FOUND)
|
||||||
MESSAGE(STATUS "Found apriltag")
|
get_target_property(APRILTAG_LOCATION apriltag::apriltag LOCATION)
|
||||||
|
get_target_property(APRILTAG_INCLUDES apriltag::apriltag INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
FIND_FILE(apriltag_aruco_4x4_50_header NAMES tagAruco4x4_50.h PATH_SUFFIXES aruco PATHS ${APRILTAG_INCLUDES} NO_DEFAULT_PATH)
|
||||||
|
SET(WITH_APRILTAG_ARUCO False)
|
||||||
|
IF(apriltag_aruco_4x4_50_header)
|
||||||
|
SET(WITH_APRILTAG_ARUCO True)
|
||||||
|
ENDIF()
|
||||||
|
MESSAGE(STATUS "Found apriltag (with aruco=${WITH_APRILTAG_ARUCO}): ${APRILTAG_LOCATION} ${APRILTAG_INCLUDES}")
|
||||||
ENDIF(apriltag_FOUND)
|
ENDIF(apriltag_FOUND)
|
||||||
ENDIF(WITH_APRILTAG)
|
ENDIF(WITH_APRILTAG)
|
||||||
|
|
||||||
@@ -1076,7 +1083,10 @@ IF(NOT FastCV_FOUND)
|
|||||||
ENDIF(NOT FastCV_FOUND)
|
ENDIF(NOT FastCV_FOUND)
|
||||||
IF(NOT apriltag_FOUND)
|
IF(NOT apriltag_FOUND)
|
||||||
SET(APRILTAG "//")
|
SET(APRILTAG "//")
|
||||||
ENDIF(NOT apriltag_FOUND)
|
SET(APRILTAG_ARUCO "//")
|
||||||
|
ELSEIF(NOT WITH_APRILTAG_ARUCO)
|
||||||
|
SET(APRILTAG_ARUCO "//")
|
||||||
|
ENDIF()
|
||||||
IF(NOT opengv_FOUND OR NOT WITH_OPENGV)
|
IF(NOT opengv_FOUND OR NOT WITH_OPENGV)
|
||||||
SET(OPENGV "//")
|
SET(OPENGV "//")
|
||||||
ENDIF(NOT opengv_FOUND OR NOT WITH_OPENGV)
|
ENDIF(NOT opengv_FOUND OR NOT WITH_OPENGV)
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
@PYTHON@#define RTABMAP_PYTHON
|
@PYTHON@#define RTABMAP_PYTHON
|
||||||
@MADGWICK@#define RTABMAP_MADGWICK
|
@MADGWICK@#define RTABMAP_MADGWICK
|
||||||
@APRILTAG@#define RTABMAP_APRILTAG
|
@APRILTAG@#define RTABMAP_APRILTAG
|
||||||
|
@APRILTAG_ARUCO@#define RTABMAP_APRILTAG_WITH_ARUCO
|
||||||
|
|
||||||
#include <pcl/pcl_config.h>
|
#include <pcl/pcl_config.h>
|
||||||
|
|
||||||
|
|||||||
@@ -534,9 +534,9 @@ IF(FastCV_FOUND)
|
|||||||
ENDIF(FastCV_FOUND)
|
ENDIF(FastCV_FOUND)
|
||||||
|
|
||||||
IF(apriltag_FOUND)
|
IF(apriltag_FOUND)
|
||||||
SET(PUBLIC_LIBRARIES
|
SET(LIBRARIES
|
||||||
${PUBLIC_LIBRARIES}
|
|
||||||
apriltag::apriltag
|
apriltag::apriltag
|
||||||
|
${LIBRARIES}
|
||||||
)
|
)
|
||||||
ENDIF(apriltag_FOUND)
|
ENDIF(apriltag_FOUND)
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ namespace cv{
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#include "apriltag/apriltag.h"
|
#include "apriltag/apriltag.h"
|
||||||
#include "apriltag/apriltag_pose.h"
|
#include "apriltag/apriltag_pose.h"
|
||||||
|
#ifdef RTABMAP_APRILTAG_WITH_ARUCO
|
||||||
#include "apriltag/aruco/tagAruco4x4_50.h"
|
#include "apriltag/aruco/tagAruco4x4_50.h"
|
||||||
#include "apriltag/aruco/tagAruco4x4_100.h"
|
#include "apriltag/aruco/tagAruco4x4_100.h"
|
||||||
#include "apriltag/aruco/tagAruco4x4_250.h"
|
#include "apriltag/aruco/tagAruco4x4_250.h"
|
||||||
@@ -63,11 +64,12 @@ extern "C" {
|
|||||||
#include "apriltag/aruco/tagAruco7x7_100.h"
|
#include "apriltag/aruco/tagAruco7x7_100.h"
|
||||||
#include "apriltag/aruco/tagAruco7x7_250.h"
|
#include "apriltag/aruco/tagAruco7x7_250.h"
|
||||||
#include "apriltag/aruco/tagAruco7x7_1000.h"
|
#include "apriltag/aruco/tagAruco7x7_1000.h"
|
||||||
|
#include "apriltag/aruco/tagArucoMIP36h12.h"
|
||||||
|
#endif
|
||||||
#include "apriltag/tag16h5.h"
|
#include "apriltag/tag16h5.h"
|
||||||
#include "apriltag/tag25h9.h"
|
#include "apriltag/tag25h9.h"
|
||||||
#include "apriltag/tag36h10.h"
|
#include "apriltag/tag36h10.h"
|
||||||
#include "apriltag/tag36h11.h"
|
#include "apriltag/tag36h11.h"
|
||||||
#include "apriltag/aruco/tagArucoMIP36h12.h"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_OPENCV_ARUCO
|
#ifndef HAVE_OPENCV_ARUCO
|
||||||
@@ -121,6 +123,11 @@ apriltag_family_t * createAprilTagPredefinedDictionary(int opencvArucoDictionary
|
|||||||
apriltag_family_t * af = NULL;
|
apriltag_family_t * af = NULL;
|
||||||
switch(opencvArucoDictionary)
|
switch(opencvArucoDictionary)
|
||||||
{
|
{
|
||||||
|
APRILTAG_CASE(16, 5)
|
||||||
|
APRILTAG_CASE(25, 9)
|
||||||
|
APRILTAG_CASE(36, 10)
|
||||||
|
APRILTAG_CASE(36, 11)
|
||||||
|
#ifdef RTABMAP_APRILTAG_WITH_ARUCO
|
||||||
ARUCO_CASE(4, 50)
|
ARUCO_CASE(4, 50)
|
||||||
ARUCO_CASE(4, 100)
|
ARUCO_CASE(4, 100)
|
||||||
ARUCO_CASE(4, 250)
|
ARUCO_CASE(4, 250)
|
||||||
@@ -137,14 +144,10 @@ apriltag_family_t * createAprilTagPredefinedDictionary(int opencvArucoDictionary
|
|||||||
ARUCO_CASE(7, 100)
|
ARUCO_CASE(7, 100)
|
||||||
ARUCO_CASE(7, 250)
|
ARUCO_CASE(7, 250)
|
||||||
ARUCO_CASE(7, 1000)
|
ARUCO_CASE(7, 1000)
|
||||||
APRILTAG_CASE(16, 5)
|
|
||||||
APRILTAG_CASE(25, 9)
|
|
||||||
APRILTAG_CASE(36, 10)
|
|
||||||
APRILTAG_CASE(36, 11)
|
|
||||||
case cv::aruco::DICT_ARUCO_MIP_36h12:
|
case cv::aruco::DICT_ARUCO_MIP_36h12:
|
||||||
af = tagArucoMIP36h12_create();
|
af = tagArucoMIP36h12_create();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -157,7 +160,12 @@ void destroyAprilTagDictionary(apriltag_family_t * dictionary)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char* name = dictionary->name;
|
const char* name = dictionary->name;
|
||||||
if(strcmp(name, "tagAruco4x4_50") == 0) tagAruco4x4_50_destroy(dictionary);
|
if(strcmp(name, "tag16h5") == 0) tag16h5_destroy(dictionary);
|
||||||
|
else if(strcmp(name, "tag25h9") == 0) tag25h9_destroy(dictionary);
|
||||||
|
else if(strcmp(name, "tag36h10") == 0) tag36h10_destroy(dictionary);
|
||||||
|
else if(strcmp(name, "tag36h11") == 0) tag36h11_destroy(dictionary);
|
||||||
|
#ifdef RTABMAP_APRILTAG_WITH_ARUCO
|
||||||
|
else if(strcmp(name, "tagAruco4x4_50") == 0) tagAruco4x4_50_destroy(dictionary);
|
||||||
else if(strcmp(name, "tagAruco4x4_100") == 0) tagAruco4x4_100_destroy(dictionary);
|
else if(strcmp(name, "tagAruco4x4_100") == 0) tagAruco4x4_100_destroy(dictionary);
|
||||||
else if(strcmp(name, "tagAruco4x4_250") == 0) tagAruco4x4_250_destroy(dictionary);
|
else if(strcmp(name, "tagAruco4x4_250") == 0) tagAruco4x4_250_destroy(dictionary);
|
||||||
else if(strcmp(name, "tagAruco4x4_1000") == 0) tagAruco4x4_1000_destroy(dictionary);
|
else if(strcmp(name, "tagAruco4x4_1000") == 0) tagAruco4x4_1000_destroy(dictionary);
|
||||||
@@ -173,11 +181,8 @@ void destroyAprilTagDictionary(apriltag_family_t * dictionary)
|
|||||||
else if(strcmp(name, "tagAruco7x7_100") == 0) tagAruco7x7_100_destroy(dictionary);
|
else if(strcmp(name, "tagAruco7x7_100") == 0) tagAruco7x7_100_destroy(dictionary);
|
||||||
else if(strcmp(name, "tagAruco7x7_250") == 0) tagAruco7x7_250_destroy(dictionary);
|
else if(strcmp(name, "tagAruco7x7_250") == 0) tagAruco7x7_250_destroy(dictionary);
|
||||||
else if(strcmp(name, "tagAruco7x7_1000") == 0) tagAruco7x7_1000_destroy(dictionary);
|
else if(strcmp(name, "tagAruco7x7_1000") == 0) tagAruco7x7_1000_destroy(dictionary);
|
||||||
else if(strcmp(name, "tag16h5") == 0) tag16h5_destroy(dictionary);
|
|
||||||
else if(strcmp(name, "tag25h9") == 0) tag25h9_destroy(dictionary);
|
|
||||||
else if(strcmp(name, "tag36h10") == 0) tag36h10_destroy(dictionary);
|
|
||||||
else if(strcmp(name, "tag36h11") == 0) tag36h11_destroy(dictionary);
|
|
||||||
else if(strcmp(name, "tagArucoMIP_36h12") == 0) tagArucoMIP36h12_destroy(dictionary);
|
else if(strcmp(name, "tagArucoMIP_36h12") == 0) tagArucoMIP36h12_destroy(dictionary);
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UFATAL("AprilTag: Didn't find the right desctructor for dictionary \"%s\"", name);
|
UFATAL("AprilTag: Didn't find the right desctructor for dictionary \"%s\"", name);
|
||||||
@@ -332,6 +337,16 @@ void MarkerDetector::parseParameters(const ParametersMap & parameters)
|
|||||||
dictionary_.reset(new cv::aruco::Dictionary());
|
dictionary_.reset(new cv::aruco::Dictionary());
|
||||||
*dictionary_ = cv::aruco::getPredefinedDictionary(cv::aruco::PredefinedDictionaryType(dictionaryId_));
|
*dictionary_ = cv::aruco::getPredefinedDictionary(cv::aruco::PredefinedDictionaryType(dictionaryId_));
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
if(strategy_ == 0)
|
||||||
|
{
|
||||||
|
#ifdef RTABMAP_APRILTAG
|
||||||
|
UERROR("RTAB-Map is not built with opencv-aruco library! Fallback to AprilTag strategy (%s=1).", Parameters::kMarkerStrategy().c_str());
|
||||||
|
strategy_ = 1;
|
||||||
|
#else
|
||||||
|
UERROR("RTAB-Map is not built with opencv-aruco library!");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RTABMAP_APRILTAG
|
#ifdef RTABMAP_APRILTAG
|
||||||
@@ -357,13 +372,26 @@ void MarkerDetector::parseParameters(const ParametersMap & parameters)
|
|||||||
Parameters::parse(parameters, Parameters::kMarkerAprilTagDebug(), ((apriltag_detector_t*)apriltagLibDetector_)->debug);
|
Parameters::parse(parameters, Parameters::kMarkerAprilTagDebug(), ((apriltag_detector_t*)apriltagLibDetector_)->debug);
|
||||||
|
|
||||||
cv::aruco::PredefinedDictionaryType dictFamily = cv::aruco::PredefinedDictionaryType(dictionaryId_);
|
cv::aruco::PredefinedDictionaryType dictFamily = cv::aruco::PredefinedDictionaryType(dictionaryId_);
|
||||||
|
#ifndef RTABMAP_APRILTAG_WITH_ARUCO
|
||||||
|
if((dictFamily >= cv::aruco::DICT_4X4_50 && dictFamily < cv::aruco::DICT_APRILTAG_16h5) || dictFamily==cv::aruco::DICT_ARUCO_MIP_36h12)
|
||||||
|
{
|
||||||
|
UERROR("Cannot set aruco dictionaries with current AprilTag library version. "
|
||||||
|
"Use opencv-aruco implementation instead or rebuild/install latest "
|
||||||
|
"AprilTag from source. Setting %s to default apriltag dictionary (%d)",
|
||||||
|
Parameters::kMarkerDictionary().c_str(),
|
||||||
|
cv::aruco::DICT_APRILTAG_36h11);
|
||||||
|
dictionaryId_ = cv::aruco::DICT_APRILTAG_36h11;
|
||||||
|
dictFamily = cv::aruco::PredefinedDictionaryType(dictionaryId_);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if(dictFamily == cv::aruco::DICT_ARUCO_ORIGINAL)
|
if(dictFamily == cv::aruco::DICT_ARUCO_ORIGINAL)
|
||||||
{
|
{
|
||||||
UERROR("Cannot set ARUCO_ORIGINAL dictionary with AprilTag library implementation. "
|
UERROR("Cannot set ARUCO_ORIGINAL (%d) dictionary with AprilTag library implementation. "
|
||||||
"Use opencv-aruco implementation instead. Setting %s to default (%d)",
|
"Use opencv-aruco implementation instead. Setting %s to default apriltag dictionary (%d)",
|
||||||
|
dictionaryId_,
|
||||||
Parameters::kMarkerDictionary().c_str(),
|
Parameters::kMarkerDictionary().c_str(),
|
||||||
Parameters::defaultMarkerDictionary());
|
cv::aruco::DICT_APRILTAG_36h11);
|
||||||
dictionaryId_ = Parameters::defaultMarkerDictionary();
|
dictionaryId_ = cv::aruco::DICT_APRILTAG_36h11;
|
||||||
dictFamily = cv::aruco::PredefinedDictionaryType(dictionaryId_);
|
dictFamily = cv::aruco::PredefinedDictionaryType(dictionaryId_);
|
||||||
}
|
}
|
||||||
apriltagLibFamily_ = createAprilTagPredefinedDictionary(dictFamily);
|
apriltagLibFamily_ = createAprilTagPredefinedDictionary(dictFamily);
|
||||||
@@ -374,6 +402,16 @@ void MarkerDetector::parseParameters(const ParametersMap & parameters)
|
|||||||
UFATAL("Unable to add family to detector due to insufficient memory to allocate the tag-family decoder with the default maximum hamming value of 2. Try choosing an alternative tag family.");
|
UFATAL("Unable to add family to detector due to insufficient memory to allocate the tag-family decoder with the default maximum hamming value of 2. Try choosing an alternative tag family.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if(strategy_ == 1)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_OPENCV_ARUCO
|
||||||
|
UERROR("RTAB-Map is not built with apriltag library! Fallback to OpenCV (%s=0).", Parameters::kMarkerStrategy().c_str());
|
||||||
|
strategy_ = 0;
|
||||||
|
#else
|
||||||
|
UERROR("RTAB-Map is not built with apriltag library!");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -364,6 +364,7 @@ private Q_SLOTS:
|
|||||||
void updateStereoDisparityVisibility();
|
void updateStereoDisparityVisibility();
|
||||||
void updateFeatureMatchingVisibility();
|
void updateFeatureMatchingVisibility();
|
||||||
void updateGlobalDescriptorVisibility();
|
void updateGlobalDescriptorVisibility();
|
||||||
|
void updateAvailableMarkerDictionaries();
|
||||||
void updateOdometryStackedIndex(int index);
|
void updateOdometryStackedIndex(int index);
|
||||||
void useOdomFeatures();
|
void useOdomFeatures();
|
||||||
void changeWorkingDirectory();
|
void changeWorkingDirectory();
|
||||||
|
|||||||
@@ -475,16 +475,6 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
|||||||
_ui->checkBox_showOdomFrustums->setChecked(false);
|
_ui->checkBox_showOdomFrustums->setChecked(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//if OpenCV < 3.4.2
|
|
||||||
#if !defined(RTABMAP_APRILTAG) && (CV_MAJOR_VERSION < 3 || (CV_MAJOR_VERSION == 3 && (CV_MINOR_VERSION <4 || (CV_MINOR_VERSION ==4 && CV_SUBMINOR_VERSION<2))))
|
|
||||||
_ui->MarkerDictionary->setItemData(17, 0, Qt::UserRole - 1);
|
|
||||||
_ui->MarkerDictionary->setItemData(18, 0, Qt::UserRole - 1);
|
|
||||||
_ui->MarkerDictionary->setItemData(19, 0, Qt::UserRole - 1);
|
|
||||||
_ui->MarkerDictionary->setItemData(20, 0, Qt::UserRole - 1);
|
|
||||||
#endif
|
|
||||||
#if !defined(RTABMAP_APRILTAG) && (CV_MAJOR_VERSION < 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION <8))
|
|
||||||
_ui->MarkerDictionary->setItemData(21, 0, Qt::UserRole - 1);
|
|
||||||
#endif
|
|
||||||
#if !defined(HAVE_OPENCV_ARUCO) && !defined(RTABMAP_APRILTAG)
|
#if !defined(HAVE_OPENCV_ARUCO) && !defined(RTABMAP_APRILTAG)
|
||||||
_ui->label_markerDetection->setText(_ui->label_markerDetection->text()+" This option works only if OpenCV has been built with \"aruco\" module and/or RTAB-Map has been built with AprilTag library support.");
|
_ui->label_markerDetection->setText(_ui->label_markerDetection->text()+" This option works only if OpenCV has been built with \"aruco\" module and/or RTAB-Map has been built with AprilTag library support.");
|
||||||
#endif
|
#endif
|
||||||
@@ -1762,19 +1752,22 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
|||||||
// Aruco marker
|
// Aruco marker
|
||||||
_ui->MarkerStrategy->setObjectName(Parameters::kMarkerStrategy().c_str());
|
_ui->MarkerStrategy->setObjectName(Parameters::kMarkerStrategy().c_str());
|
||||||
connect(_ui->MarkerStrategy, SIGNAL(currentIndexChanged(int)), _ui->stackedWidget_markerStrategy, SLOT(setCurrentIndex(int)));
|
connect(_ui->MarkerStrategy, SIGNAL(currentIndexChanged(int)), _ui->stackedWidget_markerStrategy, SLOT(setCurrentIndex(int)));
|
||||||
|
connect(_ui->MarkerStrategy, SIGNAL(currentIndexChanged(int)), this, SLOT(updateAvailableMarkerDictionaries()));
|
||||||
_ui->MarkerStrategy->setCurrentIndex(Parameters::defaultMarkerStrategy());
|
_ui->MarkerStrategy->setCurrentIndex(Parameters::defaultMarkerStrategy());
|
||||||
|
updateAvailableMarkerDictionaries();
|
||||||
_ui->MarkerDictionary->setObjectName(Parameters::kMarkerDictionary().c_str());
|
_ui->MarkerDictionary->setObjectName(Parameters::kMarkerDictionary().c_str());
|
||||||
_ui->ArucoMarkerLength->setObjectName(Parameters::kMarkerLength().c_str());
|
_ui->MarkerLength->setObjectName(Parameters::kMarkerLength().c_str());
|
||||||
_ui->ArucoMaxDepthError->setObjectName(Parameters::kMarkerMaxDepthError().c_str());
|
_ui->MarkerLengths->setObjectName(Parameters::kMarkerLengths().c_str());
|
||||||
_ui->ArucoVarianceLinear->setObjectName(Parameters::kMarkerVarianceLinear().c_str());
|
_ui->MarkerMaxDepthError->setObjectName(Parameters::kMarkerMaxDepthError().c_str());
|
||||||
_ui->ArucoVarianceAngular->setObjectName(Parameters::kMarkerVarianceAngular().c_str());
|
_ui->MarkerVarianceLinear->setObjectName(Parameters::kMarkerVarianceLinear().c_str());
|
||||||
_ui->ArucoVarianceOrientationIgnored->setObjectName(Parameters::kMarkerVarianceOrientationIgnored().c_str());
|
_ui->MarkerVarianceAngular->setObjectName(Parameters::kMarkerVarianceAngular().c_str());
|
||||||
_ui->ArucoMarkerRangeMin->setObjectName(Parameters::kMarkerMinRange().c_str());
|
_ui->MarkerVarianceOrientationIgnored->setObjectName(Parameters::kMarkerVarianceOrientationIgnored().c_str());
|
||||||
_ui->ArucoMarkerRangeMax->setObjectName(Parameters::kMarkerMaxRange().c_str());
|
_ui->MarkerRangeMin->setObjectName(Parameters::kMarkerMinRange().c_str());
|
||||||
_ui->ArucoMarkerPriors->setObjectName(Parameters::kMarkerPriors().c_str());
|
_ui->MarkerRangeMax->setObjectName(Parameters::kMarkerMaxRange().c_str());
|
||||||
_ui->ArucoPriorsVarianceLinear->setObjectName(Parameters::kMarkerPriorsVarianceLinear().c_str());
|
_ui->MarkerPriors->setObjectName(Parameters::kMarkerPriors().c_str());
|
||||||
_ui->ArucoPriorsVarianceAngular->setObjectName(Parameters::kMarkerPriorsVarianceAngular().c_str());
|
_ui->MarkerPriorsVarianceLinear->setObjectName(Parameters::kMarkerPriorsVarianceLinear().c_str());
|
||||||
_ui->ArucoCornerRefinementMethod->setObjectName(Parameters::kMarkerOpenCVCornerRefinementMethod().c_str());
|
_ui->MarkerPriorsVarianceAngular->setObjectName(Parameters::kMarkerPriorsVarianceAngular().c_str());
|
||||||
|
_ui->OpenCVCornerRefinementMethod->setObjectName(Parameters::kMarkerOpenCVCornerRefinementMethod().c_str());
|
||||||
_ui->apriltag_nthreads->setObjectName(Parameters::kMarkerAprilTagNThreads().c_str());
|
_ui->apriltag_nthreads->setObjectName(Parameters::kMarkerAprilTagNThreads().c_str());
|
||||||
_ui->apriltag_quad_decimate->setObjectName(Parameters::kMarkerAprilTagQuadDecimate().c_str());
|
_ui->apriltag_quad_decimate->setObjectName(Parameters::kMarkerAprilTagQuadDecimate().c_str());
|
||||||
_ui->apriltag_quad_sigma->setObjectName(Parameters::kMarkerAprilTagQuadSigma().c_str());
|
_ui->apriltag_quad_sigma->setObjectName(Parameters::kMarkerAprilTagQuadSigma().c_str());
|
||||||
@@ -3970,9 +3963,20 @@ bool PreferencesDialog::validateForm()
|
|||||||
if(_ui->MarkerDictionary->currentIndex()>=21)
|
if(_ui->MarkerDictionary->currentIndex()>=21)
|
||||||
{
|
{
|
||||||
QMessageBox::warning(this, tr("Parameter warning"),
|
QMessageBox::warning(this, tr("Parameter warning"),
|
||||||
tr("opencv-aruco: cannot use selected dictionary (%1), OpenCV version should be at least 4.8.0. Setting back to 0.").arg(_ui->MarkerDictionary->currentIndex()));
|
tr("Opencv Strategy: cannot use selected dictionary (%1), OpenCV version should be at least 4.8.0. Setting back to 0.").arg(_ui->MarkerDictionary->currentIndex()));
|
||||||
_ui->MarkerDictionary->setCurrentIndex(0);
|
_ui->MarkerDictionary->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else if(_ui->MarkerStrategy->currentIndex() == 1)
|
||||||
|
{
|
||||||
|
#ifndef RTABMAP_APRILTAG_WITH_ARUCO
|
||||||
|
if(_ui->MarkerDictionary->currentIndex() < 17 || _ui->MarkerDictionary->currentIndex() == 21)
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Parameter warning"),
|
||||||
|
tr("AprilTag Strategy: cannot use selected dictionary (%1), AprilTag should be built with aruco support. Setting back to 17.").arg(_ui->MarkerDictionary->currentIndex()));
|
||||||
|
_ui->MarkerDictionary->setCurrentIndex(17);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -5601,6 +5605,53 @@ void PreferencesDialog::updateGlobalDescriptorVisibility()
|
|||||||
_ui->groupBox_pydescriptor->setVisible(_ui->comboBox_globalDescriptorExtractor->currentIndex() == 1);
|
_ui->groupBox_pydescriptor->setVisible(_ui->comboBox_globalDescriptorExtractor->currentIndex() == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PreferencesDialog::updateAvailableMarkerDictionaries()
|
||||||
|
{
|
||||||
|
Qt::ItemFlags enableFlags = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||||
|
for(int i=0;i<_ui->MarkerDictionary->count();++i) {
|
||||||
|
_ui->MarkerDictionary->setItemData(i, QVariant(static_cast<int>(enableFlags)), Qt::UserRole - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_ui->MarkerStrategy->currentIndex() == 1) // AprilTag Strategy is selected
|
||||||
|
{
|
||||||
|
// ARUCO_ORIGINAL not available with AprilTag lib
|
||||||
|
_ui->MarkerDictionary->setItemData(16, 0, Qt::UserRole - 1);
|
||||||
|
#if !defined(RTABMAP_APRILTAG_WITH_ARUCO)
|
||||||
|
// disable all aruco dictionaries
|
||||||
|
for(int i=0;i<17;++i) {
|
||||||
|
_ui->MarkerDictionary->setItemData(i, 0, Qt::UserRole - 1);
|
||||||
|
}
|
||||||
|
_ui->MarkerDictionary->setItemData(21, 0, Qt::UserRole - 1);
|
||||||
|
if(_ui->MarkerDictionary->currentIndex() < 17 || _ui->MarkerDictionary->currentIndex() > 20)
|
||||||
|
{
|
||||||
|
_ui->MarkerDictionary->setCurrentIndex(20); // 36h11 by default
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else //if(_ui->MarkerStrategy->currentIndex() == 0) // OpenCV Strategy is selected
|
||||||
|
{
|
||||||
|
//if OpenCV < 3.4.2
|
||||||
|
#if !defined(RTABMAP_APRILTAG) && (CV_MAJOR_VERSION < 3 || (CV_MAJOR_VERSION == 3 && (CV_MINOR_VERSION <4 || (CV_MINOR_VERSION ==4 && CV_SUBMINOR_VERSION<2))))
|
||||||
|
// disable all apriltag dictionaries
|
||||||
|
for(int i=17;i<21;++i) {
|
||||||
|
_ui->MarkerDictionary->setItemData(i, 0, Qt::UserRole - 1);
|
||||||
|
}
|
||||||
|
if(_ui->MarkerDictionary->currentIndex() >=17 && _ui->MarkerDictionary->currentIndex() <= 20)
|
||||||
|
{
|
||||||
|
_ui->MarkerDictionary->setCurrentIndex(Parameters::defaultMarkerDictionary());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if !defined(RTABMAP_APRILTAG_WITH_ARUCO) && (CV_MAJOR_VERSION < 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION <8))
|
||||||
|
// disable aruco MPI dictionary
|
||||||
|
_ui->MarkerDictionary->setItemData(21, 0, Qt::UserRole - 1);
|
||||||
|
if(_ui->MarkerDictionary->currentIndex() == 21)
|
||||||
|
{
|
||||||
|
_ui->MarkerDictionary->setCurrentIndex(Parameters::defaultMarkerDictionary());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PreferencesDialog::updateOdometryStackedIndex(int index)
|
void PreferencesDialog::updateOdometryStackedIndex(int index)
|
||||||
{
|
{
|
||||||
if(index == 11) // FLOAM -> LOAM
|
if(index == 11) // FLOAM -> LOAM
|
||||||
@@ -6265,7 +6316,7 @@ bool PreferencesDialog::isMarkerDetection() const
|
|||||||
}
|
}
|
||||||
double PreferencesDialog::getMarkerLength() const
|
double PreferencesDialog::getMarkerLength() const
|
||||||
{
|
{
|
||||||
return _ui->ArucoMarkerLength->value();
|
return _ui->MarkerLength->value();
|
||||||
}
|
}
|
||||||
bool PreferencesDialog::isCloudMeshing() const
|
bool PreferencesDialog::isCloudMeshing() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>-526</y>
|
<y>0</y>
|
||||||
<width>684</width>
|
<width>684</width>
|
||||||
<height>5218</height>
|
<height>5218</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -15529,14 +15529,14 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QCheckBox" name="ArucoVarianceOrientationIgnored">
|
<widget class="QCheckBox" name="MarkerVarianceOrientationIgnored">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QDoubleSpinBox" name="ArucoVarianceLinear">
|
<widget class="QDoubleSpinBox" name="MarkerVarianceLinear">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -15555,7 +15555,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QDoubleSpinBox" name="ArucoMarkerLength">
|
<widget class="QDoubleSpinBox" name="MarkerLength">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> m</string>
|
<string> m</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -15587,7 +15587,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0">
|
<item row="10" column="0">
|
||||||
<widget class="QDoubleSpinBox" name="ArucoMarkerRangeMax">
|
<widget class="QDoubleSpinBox" name="MarkerRangeMax">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> m</string>
|
<string> m</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -15648,7 +15648,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="13" column="0">
|
<item row="13" column="0">
|
||||||
<widget class="QDoubleSpinBox" name="ArucoPriorsVarianceAngular">
|
<widget class="QDoubleSpinBox" name="MarkerPriorsVarianceAngular">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -15818,7 +15818,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0">
|
<item row="11" column="0">
|
||||||
<widget class="QLineEdit" name="ArucoMarkerPriors">
|
<widget class="QLineEdit" name="MarkerPriors">
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -15854,7 +15854,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QDoubleSpinBox" name="ArucoMarkerRangeMin">
|
<widget class="QDoubleSpinBox" name="MarkerRangeMin">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> m</string>
|
<string> m</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -15915,7 +15915,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QDoubleSpinBox" name="ArucoMaxDepthError">
|
<widget class="QDoubleSpinBox" name="MarkerMaxDepthError">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> m</string>
|
<string> m</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -15941,7 +15941,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="0">
|
<item row="12" column="0">
|
||||||
<widget class="QDoubleSpinBox" name="ArucoPriorsVarianceLinear">
|
<widget class="QDoubleSpinBox" name="MarkerPriorsVarianceLinear">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -15962,7 +15962,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLabel" name="label_space2_24">
|
<widget class="QLabel" name="label_space2_24">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Detector implementation. Note that both aruco and apriltag dictionaries can be used with either strategy.</string>
|
<string>Detector implementation. Note that both aruco and apriltag dictionaries may be used with either strategy. Scroll down to see specific parameters for the strategy used.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -15973,7 +15973,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QDoubleSpinBox" name="ArucoVarianceAngular">
|
<widget class="QDoubleSpinBox" name="MarkerVarianceAngular">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -15995,7 +15995,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLineEdit" name="ArucoMarkerLengths">
|
<widget class="QLineEdit" name="MarkerLengths">
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -16019,7 +16019,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stackedWidget_markerStrategy">
|
<widget class="QStackedWidget" name="stackedWidget_markerStrategy">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page_104">
|
<widget class="QWidget" name="page_104">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_189">
|
<layout class="QVBoxLayout" name="verticalLayout_189">
|
||||||
@@ -16043,7 +16043,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QComboBox" name="ArucoCornerRefinementMethod">
|
<widget class="QComboBox" name="OpenCVCornerRefinementMethod">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>None</string>
|
<string>None</string>
|
||||||
@@ -16071,6 +16071,12 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -16230,12 +16236,15 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QSpinBox" name="apriltag_quad_decimate">
|
<widget class="QDoubleSpinBox" name="apriltag_quad_decimate">
|
||||||
<property name="minimum">
|
<property name="decimals">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>2</number>
|
<double>2.000000000000000</double>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user