Integrated to UI

This commit is contained in:
matlabbe
2024-08-18 21:04:08 -07:00
parent 0de0fe3ec6
commit 7253450251
16 changed files with 606 additions and 47 deletions

View File

@@ -43,6 +43,8 @@ struct PointXYZIT {
};
class RTABMAP_CORE_EXPORT LidarVLP16 :public Lidar, public pcl::VLPGrabber {
public:
static bool available();
public:
LidarVLP16(
const std::string& pcapFile,

View File

@@ -474,7 +474,7 @@ LidarOuster::LidarOuster(
pcapFile_(pcapFile),
jsonFile_(jsonFile)
{
UASSERT(!pcapFile.empty() && !jsonFile.empty());
UASSERT(!pcapFile.empty());
UDEBUG("Using PCAP file \"%s\" and JSON file \"%s\"", pcapFile.c_str(), jsonFile.c_str());
}
LidarOuster::~LidarOuster()
@@ -525,7 +525,7 @@ bool LidarOuster::init(const std::string &, const std::string &)
(ouster::sensor::timestamp_mode)timestampMode_);
if(!clientHandle) {
UERROR("Failed to connect to sensor!");
UERROR("Failed to connect to sensor! Verify that the Ouster can be reached on the network at this address \"%s\".", sensorHostname_.c_str());
return false;
}
@@ -540,6 +540,11 @@ bool LidarOuster::init(const std::string &, const std::string &)
}
else if(!pcapFile_.empty())
{
if(jsonFile_.empty())
{
UERROR("A JSON path should be provided when a PCAP path is used.");
return false;
}
UDEBUG("");
auto pcapHandle = ouster::sensor_utils::replay_initialize(pcapFile_);
if(!pcapHandle) {

View File

@@ -124,6 +124,15 @@ LidarVLP16::~LidarVLP16()
UDEBUG("Stopped lidar!");
}
bool LidarVLP16::available()
{
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
return true;
#else
return false;
#endif
}
void LidarVLP16::setOrganized(bool enable)
{
organized_ = true;

View File

@@ -1,3 +1,5 @@
# Kept for backward compatibility, see also lidar3d_icp_indoor.ini or lidar3d_icp_outdoor.ini
# Could be used with LiDARs like Velodyne, RoboSense, Ouster
[Camera]

View File

@@ -0,0 +1,46 @@
# Could be used with LiDARs like Velodyne, RoboSense, Ouster
[Camera]
Scan\downsampleStep = 1
Scan\fromDepth = false
Scan\normalsK = 0
Scan\normalsRadius = 0
Scan\normalsUp = false
Scan\rangeMax = 0
Scan\rangeMin = 0
Scan\voxelSize = 0
[Gui]
General\showClouds0 = false
General\showClouds1 = false
[Core]
# Would be 0.01 for odom and 0.2 for mapping:
Icp\CorrespondenceRatio = 0.1
Icp\Epsilon = 0.001
Icp\FiltersEnabled = 2
Icp\Iterations = 10
Icp\OutlierRatio = 0.7
# ~10x the voxel size:
Icp\MaxCorrespondenceDistance = 1
Icp\MaxTranslation = 2
# Uncomment if lidar can see ground most of the time (on a car or wheeled robot):
#Icp\PointToPlaneGroundNormalsUp = 0.8
Icp\PointToPlaneK = 20
Icp\PointToPlaneMinComplexity = 0
# Make sure PM is used:
Icp\Strategy = 1
Icp\VoxelSize = 0.1
Mem\NotLinkedNodesKept = false
Mem\STMSize = 30
Odom\Deskewing = true
Odom\GuessSmoothingDelay = 0.3
Odom\ScanKeyFrameThr = 0.6
OdomF2M\ScanMaxSize = 15000
# Match voxel size:
OdomF2M\ScanSubtractRadius = 0.1
RGBD\AngularUpdate = 0.05
RGBD\LinearUpdate = 0.05
RGBD\ProximityMaxGraphDepth = 0
RGBD\ProximityPathMaxNeighbors = 1
Reg\Strategy = 1

View File

@@ -0,0 +1,46 @@
# Could be used with LiDARs like Velodyne, RoboSense, Ouster
[Camera]
Scan\downsampleStep = 1
Scan\fromDepth = false
Scan\normalsK = 0
Scan\normalsRadius = 0
Scan\normalsUp = false
Scan\rangeMax = 0
Scan\rangeMin = 0
Scan\voxelSize = 0
[Gui]
General\showClouds0 = false
General\showClouds1 = false
[Core]
# Would be 0.01 for odom and 0.2 for mapping:
Icp\CorrespondenceRatio = 0.1
Icp\Epsilon = 0.001
Icp\FiltersEnabled = 2
Icp\Iterations = 10
Icp\OutlierRatio = 0.7
# ~10x the voxel size:
Icp\MaxCorrespondenceDistance = 5
Icp\MaxTranslation = 5
# Uncomment if lidar can see ground most of the time (on a car or wheeled robot):
#Icp\PointToPlaneGroundNormalsUp = 0.8
Icp\PointToPlaneK = 20
Icp\PointToPlaneMinComplexity = 0
# Make sure PM is used:
Icp\Strategy = 1
Icp\VoxelSize = 0.5
Mem\NotLinkedNodesKept = false
Mem\STMSize = 30
Odom\Deskewing = true
Odom\GuessSmoothingDelay = 0.3
Odom\ScanKeyFrameThr = 0.6
OdomF2M\ScanMaxSize = 15000
# Match voxel size:
OdomF2M\ScanSubtractRadius = 0.5
RGBD\AngularUpdate = 0.05
RGBD\LinearUpdate = 0.05
RGBD\ProximityMaxGraphDepth = 0
RGBD\ProximityPathMaxNeighbors = 1
Reg\Strategy = 1

View File

@@ -194,6 +194,7 @@ protected Q_SLOTS:
void selectDepthAIOAKDPro();
void selectXvisioSeerSense();
void selectVLP16();
void selectOuster();
void dumpTheMemory();
void dumpThePrediction();
void sendGoal();

View File

@@ -121,6 +121,7 @@ public:
kSrcLidar = 400,
kSrcLidarVLP16 = 400,
kSrcLidarOuster = 401,
};
public:
@@ -403,6 +404,8 @@ private Q_SLOTS:
void selectSourceRealsense2JsonPath();
void selectSourceDepthaiBlobPath();
void selectVlp16PcapPath();
void selectOusterPcapPath();
void selectOusterJsonPath();
void updateSourceGrpVisibility();
void testOdometry();
void testCamera();

View File

@@ -181,6 +181,8 @@ add_definitions(${PCL_DEFINITIONS})
SET(RESOURCES
${PROJECT_SOURCE_DIR}/data/presets/camera_tof_icp.ini
${PROJECT_SOURCE_DIR}/data/presets/lidar3d_icp.ini
${PROJECT_SOURCE_DIR}/data/presets/lidar3d_icp_indoor.ini
${PROJECT_SOURCE_DIR}/data/presets/lidar3d_icp_outdoor.ini
)
foreach(arg ${RESOURCES})

View File

@@ -46,5 +46,7 @@
<file>images/astra.png</file>
<file>images/oakdpro.png</file>
<file>images/seer_sense_DS80.png</file>
<file>images/ouster.png</file>
<file>images/vlp16.png</file>
</qresource>
</RCC>

View File

@@ -32,6 +32,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "rtabmap/core/CameraRGB.h"
#include "rtabmap/core/CameraStereo.h"
#include "rtabmap/core/Lidar.h"
#include "rtabmap/core/lidar/LidarVLP16.h"
#include "rtabmap/core/lidar/LidarOuster.h"
#include "rtabmap/core/IMUThread.h"
#include "rtabmap/core/DBReader.h"
#include "rtabmap/core/Parameters.h"
@@ -471,6 +473,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
connect(_ui->actionDepthAI_oakdpro, SIGNAL(triggered()), this, SLOT(selectDepthAIOAKDPro()));
connect(_ui->actionXvisio_SeerSense, SIGNAL(triggered()), this, SLOT(selectXvisioSeerSense()));
connect(_ui->actionVelodyne_VLP_16, SIGNAL(triggered()), this, SLOT(selectVLP16()));
connect(_ui->actionOuster_SDK, SIGNAL(triggered()), this, SLOT(selectOuster()));
_ui->actionFreenect->setEnabled(CameraFreenect::available());
_ui->actionOpenNI_PCL->setEnabled(CameraOpenni::available());
_ui->actionOpenNI_PCL_ASUS->setEnabled(CameraOpenni::available());
@@ -499,6 +502,8 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
_ui->actionDepthAI_oakdlite->setEnabled(CameraDepthAI::available());
_ui->actionDepthAI_oakdpro->setEnabled(CameraDepthAI::available());
_ui->actionXvisio_SeerSense->setEnabled(CameraSeerSense::available());
_ui->actionVelodyne_VLP_16->setEnabled(LidarVLP16::available());
_ui->actionOuster_SDK->setEnabled(LidarOuster::available());
this->updateSelectSourceMenu();
connect(_ui->actionPreferences, SIGNAL(triggered()), this, SLOT(openPreferences()));
@@ -5305,6 +5310,7 @@ void MainWindow::updateSelectSourceMenu()
_ui->actionDepthAI_oakdpro->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoDepthAI);
_ui->actionXvisio_SeerSense->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcSeerSense);
_ui->actionVelodyne_VLP_16->setChecked(_preferencesDialog->getLidarSourceDriver() == PreferencesDialog::kSrcLidarVLP16);
_ui->actionOuster_SDK->setChecked(_preferencesDialog->getLidarSourceDriver() == PreferencesDialog::kSrcLidarOuster);
}
void MainWindow::changeImgRateSetting()
@@ -7248,6 +7254,11 @@ void MainWindow::selectVLP16()
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcLidarVLP16);
}
void MainWindow::selectOuster()
{
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcLidarOuster);
}
void MainWindow::dumpTheMemory()
{
this->post(new RtabmapEventCmd(RtabmapEventCmd::kCmdDumpMemory));

View File

@@ -27,10 +27,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <pcl/pcl_config.h>
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
// Should be first on windows to avoid "WinSock.h has already been included" error
#include "rtabmap/core/lidar/LidarVLP16.h"
#endif
#include "rtabmap/core/lidar/LidarOuster.h"
#include "rtabmap/gui/PreferencesDialog.h"
#include "rtabmap/gui/DatabaseViewer.h"
@@ -93,6 +92,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Presets
#include "camera_tof_icp_ini.h"
#include "lidar3d_icp_ini.h"
#include "lidar3d_icp_indoor_ini.h"
#include "lidar3d_icp_outdoor_ini.h"
#include <opencv2/opencv_modules.hpp>
#include <rtabmap/core/SensorCaptureThread.h>
@@ -430,6 +431,16 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
_ui->openni2_exposure->setEnabled(CameraOpenNI2::exposureGainAvailable());
_ui->openni2_gain->setEnabled(CameraOpenNI2::exposureGainAvailable());
//LiDARs
if (!LidarVLP16::available())
{
_ui->comboBox_lidar_src->setItemData(kSrcLidarVLP16 - kSrcLidar, 0, Qt::UserRole - 1);
}
if (!LidarOuster::available())
{
_ui->comboBox_lidar_src->setItemData(kSrcLidarOuster - kSrcLidar, 0, Qt::UserRole - 1);
}
#if PCL_VERSION_COMPARE(<, 1, 7, 2)
_ui->checkBox_showFrustums->setEnabled(false);
_ui->checkBox_showFrustums->setChecked(false);
@@ -480,6 +491,8 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
connect(_ui->pushButton_resetConfig, SIGNAL(clicked()), this, SLOT(resetConfig()));
connect(_ui->pushButton_presets_camera_tof_icp, SIGNAL(clicked()), this, SLOT(loadPreset()));
connect(_ui->pushButton_presets_lidar_3d_icp, SIGNAL(clicked()), this, SLOT(loadPreset()));
connect(_ui->pushButton_presets_lidar_3d_icp_indoor, SIGNAL(clicked()), this, SLOT(loadPreset()));
connect(_ui->pushButton_presets_lidar_3d_icp_outdoor, SIGNAL(clicked()), this, SLOT(loadPreset()));
connect(_ui->radioButton_basic, SIGNAL(toggled(bool)), this, SLOT(setupTreeView()));
connect(_ui->pushButton_testOdometry, SIGNAL(clicked()), this, SLOT(testOdometry()));
connect(_ui->pushButton_test_camera, SIGNAL(clicked()), this, SLOT(testCamera()));
@@ -917,6 +930,13 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
connect(_ui->checkBox_vlp16_organized, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->checkBox_vlp16_hostTime, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->checkBox_vlp16_stamp_last, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->lineEdit_ouster_ip_hostname, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->comboBox_ouster_lidar_mode, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->comboBox_ouster_timestamp, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->toolButton_ouster_pcap_path, SIGNAL(clicked()), this, SLOT(selectOusterPcapPath()));
connect(_ui->toolButton_ouster_json_path, SIGNAL(clicked()), this, SLOT(selectOusterJsonPath()));
connect(_ui->lineEdit_ouster_pcap_path, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->lineEdit_ouster_json_path, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
//Rtabmap basic
connect(_ui->general_doubleSpinBox_timeThr, SIGNAL(valueChanged(double)), _ui->general_doubleSpinBox_timeThr_2, SLOT(setValue(double)));
@@ -2286,6 +2306,13 @@ void PreferencesDialog::resetSettings(QGroupBox * groupBox)
_ui->checkBox_vlp16_organized->setChecked(false);
_ui->checkBox_vlp16_hostTime->setChecked(true);
_ui->checkBox_vlp16_stamp_last->setChecked(true);
_ui->lineEdit_ouster_ip_hostname->clear();
_ui->comboBox_ouster_lidar_mode->setCurrentIndex(0);
_ui->comboBox_ouster_timestamp->setCurrentIndex(0);
_ui->lineEdit_ouster_pcap_path->clear();
_ui->lineEdit_ouster_json_path->clear();
_ui->checkBox_ouster_reflectivity->setChecked(true);
_ui->checkBox_ouster_imu->setChecked(false);
_ui->groupBox_depthFromScan->setChecked(false);
_ui->groupBox_depthFromScan_fillHoles->setChecked(true);
@@ -2850,6 +2877,16 @@ void PreferencesDialog::readCameraSettings(const QString & filePath)
_ui->checkBox_vlp16_stamp_last->setChecked(settings.value("stampLast", _ui->checkBox_vlp16_stamp_last->isChecked()).toBool());
settings.endGroup(); // VLP16
settings.beginGroup("Ouster");
_ui->lineEdit_ouster_ip_hostname->setText(settings.value("ip",_ui->lineEdit_ouster_ip_hostname->text()).toString());
_ui->comboBox_ouster_lidar_mode->setCurrentIndex(settings.value("lidarMode", _ui->comboBox_ouster_lidar_mode->currentIndex()).toInt());
_ui->comboBox_ouster_timestamp->setCurrentIndex(settings.value("timestamp", _ui->comboBox_ouster_timestamp->currentIndex()).toInt());
_ui->lineEdit_ouster_pcap_path->setText(settings.value("pcapPath",_ui->lineEdit_ouster_pcap_path->text()).toString());
_ui->lineEdit_ouster_json_path->setText(settings.value("jsonPath",_ui->lineEdit_ouster_json_path->text()).toString());
_ui->checkBox_ouster_reflectivity->setChecked(settings.value("reflectivity",_ui->checkBox_ouster_reflectivity->isChecked()).toBool());
_ui->checkBox_ouster_imu->setChecked(settings.value("imu",_ui->checkBox_ouster_imu->isChecked()).toBool());
settings.endGroup(); // Ouster
settings.endGroup(); // Lidar
_calibrationDialog->loadSettings(settings, "CalibrationDialog");
@@ -3004,6 +3041,14 @@ void PreferencesDialog::loadPreset()
{
loadPreset(LIDAR3D_ICP_INI);
}
else if(sender() == _ui->pushButton_presets_lidar_3d_icp_indoor)
{
loadPreset(LIDAR3D_ICP_INDOOR_INI);
}
else if(sender() == _ui->pushButton_presets_lidar_3d_icp_outdoor)
{
loadPreset(LIDAR3D_ICP_OUTDOOR_INI);
}
else
{
UERROR("Unknown sender!");
@@ -3448,6 +3493,16 @@ void PreferencesDialog::writeCameraSettings(const QString & filePath) const
settings.setValue("stampLast", _ui->checkBox_vlp16_stamp_last->isChecked());
settings.endGroup(); // VLP16
settings.beginGroup("Ouster");
settings.setValue("ip",_ui->lineEdit_ouster_ip_hostname->text());
settings.setValue("lidarMode", _ui->comboBox_ouster_lidar_mode->currentIndex());
settings.setValue("timestamp", _ui->comboBox_ouster_timestamp->currentIndex());
settings.setValue("pcapPath",_ui->lineEdit_ouster_pcap_path->text());
settings.setValue("jsonPath",_ui->lineEdit_ouster_json_path->text());
settings.setValue("reflectivity",_ui->checkBox_ouster_reflectivity->isChecked());
settings.setValue("imu",_ui->checkBox_ouster_imu->isChecked());
settings.endGroup(); // Ouster
settings.endGroup(); // Lidar
_calibrationDialog->saveSettings(settings, "CalibrationDialog");
@@ -4263,7 +4318,7 @@ void PreferencesDialog::selectSourceDriver(Src src, int variant)
}
else if(src >= kSrcLidar)
{
_ui->comboBox_lidar_src->setCurrentIndex(kSrcLidarVLP16 - kSrcLidar + 1);
_ui->comboBox_lidar_src->setCurrentIndex(src - kSrcLidar + 1);
}
if(previousCameraSrc == kSrcUndef && src < kSrcDatabase &&
@@ -4277,7 +4332,7 @@ void PreferencesDialog::selectSourceDriver(Src src, int variant)
}
else if(previousLidarSrc== kSrcUndef && src >= kSrcLidar &&
QMessageBox::question(this, tr("LiDAR Source..."),
tr("Do you want to use \"LiDAR 3D ICP\" preset?"),
tr("Do you want to use \"LiDAR 3D ICP\" preset? You can open Preferences->General Settings to select indoor or outdoor presets afterwards."),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes)
{
loadPreset(LIDAR3D_ICP_INI);
@@ -4748,6 +4803,34 @@ void PreferencesDialog::selectVlp16PcapPath()
}
}
void PreferencesDialog::selectOusterPcapPath()
{
QString dir = _ui->lineEdit_ouster_pcap_path->text();
if (dir.isEmpty())
{
dir = getWorkingDirectory();
}
QString path = QFileDialog::getOpenFileName(this, tr("Select file"), dir, tr("Ouster recording (*.pcap)"));
if (!path.isEmpty())
{
_ui->lineEdit_ouster_pcap_path->setText(path);
}
}
void PreferencesDialog::selectOusterJsonPath()
{
QString dir = _ui->lineEdit_ouster_json_path->text();
if (dir.isEmpty())
{
dir = getWorkingDirectory();
}
QString path = QFileDialog::getOpenFileName(this, tr("Select file"), dir, tr("Ouster recording config (*.json)"));
if (!path.isEmpty())
{
_ui->lineEdit_ouster_json_path->setText(path);
}
}
void PreferencesDialog::setParameter(const std::string & key, const std::string & value)
{
UDEBUG("%s=%s", key.c_str(), value.c_str());
@@ -5698,6 +5781,7 @@ void PreferencesDialog::updateSourceGrpVisibility()
}
_ui->stackedWidget_lidar_src->setVisible(_ui->comboBox_lidar_src->currentIndex() > 0);
_ui->groupBox_vlp16->setVisible(_ui->comboBox_lidar_src->currentIndex()-1 == kSrcLidarVLP16-kSrcLidar);
_ui->groupBox_ouster->setVisible(_ui->comboBox_lidar_src->currentIndex()-1 == kSrcLidarOuster-kSrcLidar);
_ui->frame_lidar_sensor->setVisible(_ui->comboBox_lidar_src->currentIndex() > 0 || _ui->checkBox_source_scanFromDepth->isChecked()); // Not Lidar None or database input
_ui->pushButton_test_lidar->setEnabled(_ui->comboBox_lidar_src->currentIndex() > 0);
@@ -6987,9 +7071,8 @@ Lidar * PreferencesDialog::createLidar()
{
Lidar * lidar = 0;
Src driver = getLidarSourceDriver();
if(driver == kSrcLidarVLP16)
if(driver >= kSrcLidarVLP16 && driver <= kSrcLidarOuster)
{
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
Transform localTransform = Transform::fromString(_ui->lineEdit_lidar_local_transform->text().replace("PI_2", QString::number(3.141592/2.0)).toStdString());
if(localTransform.isNull())
{
@@ -6997,33 +7080,71 @@ Lidar * PreferencesDialog::createLidar()
_ui->lineEdit_lidar_local_transform->text().toStdString().c_str());
localTransform = Transform::getIdentity();
}
if(!_ui->lineEdit_vlp16_pcap_path->text().isEmpty())
if(driver == kSrcLidarVLP16)
{
// PCAP mode
lidar = new LidarVLP16(
_ui->lineEdit_vlp16_pcap_path->text().toStdString(),
_ui->checkBox_vlp16_organized->isChecked(),
_ui->checkBox_vlp16_stamp_last->isChecked(),
this->getGeneralInputRate(),
localTransform);
if(!_ui->lineEdit_vlp16_pcap_path->text().isEmpty())
{
// PCAP mode
lidar = new LidarVLP16(
_ui->lineEdit_vlp16_pcap_path->text().toStdString(),
_ui->checkBox_vlp16_organized->isChecked(),
_ui->checkBox_vlp16_stamp_last->isChecked(),
this->getGeneralInputRate(),
localTransform);
}
else
{
// Connect to sensor
lidar = new LidarVLP16(
boost::asio::ip::address_v4::from_string(uFormat("%ld.%ld.%ld.%ld",
(size_t)_ui->spinBox_vlp16_ip1->value(),
(size_t)_ui->spinBox_vlp16_ip2->value(),
(size_t)_ui->spinBox_vlp16_ip3->value(),
(size_t)_ui->spinBox_vlp16_ip4->value())),
_ui->spinBox_vlp16_port->value(),
_ui->checkBox_vlp16_organized->isChecked(),
_ui->checkBox_vlp16_hostTime->isChecked(),
_ui->checkBox_vlp16_stamp_last->isChecked(),
this->getGeneralInputRate(),
localTransform);
}
}
else
else // Ouster
{
// Connect to sensor
lidar = new LidarVLP16(
boost::asio::ip::address_v4::from_string(uFormat("%ld.%ld.%ld.%ld",
(size_t)_ui->spinBox_vlp16_ip1->value(),
(size_t)_ui->spinBox_vlp16_ip2->value(),
(size_t)_ui->spinBox_vlp16_ip3->value(),
(size_t)_ui->spinBox_vlp16_ip4->value())),
_ui->spinBox_vlp16_port->value(),
_ui->checkBox_vlp16_organized->isChecked(),
_ui->checkBox_vlp16_hostTime->isChecked(),
_ui->checkBox_vlp16_stamp_last->isChecked(),
this->getGeneralInputRate(),
localTransform);
if(!_ui->lineEdit_ouster_pcap_path->text().isEmpty())
{
// PCAP mode
lidar = new LidarOuster(
_ui->lineEdit_ouster_pcap_path->text().toStdString(),
_ui->lineEdit_ouster_json_path->text().toStdString(),
_ui->checkBox_ouster_reflectivity->isChecked(),
_ui->checkBox_ouster_imu->isChecked(),
this->getGeneralInputRate(),
localTransform);
}
else if(!_ui->lineEdit_ouster_ip_hostname->text().isEmpty())
{
// Connect to sensor
lidar = new LidarOuster(
_ui->lineEdit_ouster_ip_hostname->text().toStdString(),
_ui->comboBox_ouster_lidar_mode->currentIndex(),
_ui->comboBox_ouster_timestamp->currentIndex(),
"", // data destination
_ui->checkBox_ouster_reflectivity->isChecked(),
_ui->checkBox_ouster_imu->isChecked(),
this->getGeneralInputRate(),
localTransform);
}
else
{
QMessageBox::warning(this,
tr("RTAB-Map"),
tr("Ouster: An IP/hostname or PCAP path should be set..."));
return lidar; // 0
}
}
if(!lidar->init())
{
@@ -7034,12 +7155,6 @@ Lidar * PreferencesDialog::createLidar()
delete lidar;
lidar = 0;
}
#else
UWARN("Lidar cannot be used with rtabmap built with PCL < 1.8... ");
QMessageBox::warning(this,
tr("RTAB-Map"),
tr("Lidar initialization failed..."));
#endif
}
return lidar;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
guilib/src/images/vlp16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -356,7 +356,32 @@
<property name="title">
<string>LiDAR</string>
</property>
<addaction name="actionVelodyne_VLP_16"/>
<property name="icon">
<iconset resource="../GuiLib.qrc">
<normaloff>:/images/vlp16.png</normaloff>:/images/vlp16.png</iconset>
</property>
<widget class="QMenu" name="menuVelodyne">
<property name="title">
<string>Velodyne</string>
</property>
<property name="icon">
<iconset resource="../GuiLib.qrc">
<normaloff>:/images/vlp16.png</normaloff>:/images/vlp16.png</iconset>
</property>
<addaction name="actionVelodyne_VLP_16"/>
</widget>
<widget class="QMenu" name="menuOuster">
<property name="title">
<string>Ouster</string>
</property>
<property name="icon">
<iconset resource="../GuiLib.qrc">
<normaloff>:/images/ouster.png</normaloff>:/images/ouster.png</iconset>
</property>
<addaction name="actionOuster_SDK"/>
</widget>
<addaction name="menuVelodyne"/>
<addaction name="menuOuster"/>
</widget>
<addaction name="menuRGB_D_camera"/>
<addaction name="menuStereo_camera"/>
@@ -1749,6 +1774,14 @@
<string>Xvisio</string>
</property>
</action>
<action name="actionOuster_SDK">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Ouster SDK</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View File

@@ -65,7 +65,7 @@
<x>0</x>
<y>0</y>
<width>713</width>
<height>4653</height>
<height>4720</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
@@ -95,7 +95,7 @@
<enum>QFrame::Raised</enum>
</property>
<property name="currentIndex">
<number>7</number>
<number>0</number>
</property>
<widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,0">
@@ -369,10 +369,16 @@
</item>
<item>
<layout class="QGridLayout" name="gridLayout_135" columnstretch="0,1">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton_presets_camera_tof_icp">
<item row="1" column="1">
<widget class="QLabel" name="label_753">
<property name="text">
<string>TOF Camera ICP</string>
<string>e.g., Velodyne, RoboSense and Ouster LiDARs.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
@@ -395,12 +401,46 @@
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_presets_lidar_3d_icp">
<property name="text">
<string>LiDAR 3D ICP</string>
<string>LiDAR 3D ICP Legacy (5 cm voxel)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_753">
<item row="2" column="0">
<widget class="QPushButton" name="pushButton_presets_lidar_3d_icp_indoor">
<property name="text">
<string>LiDAR 3D ICP Indoor (10 cm voxel)</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="pushButton_presets_camera_tof_icp">
<property name="text">
<string>TOF Camera ICP</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_presets_lidar_3d_icp_outdoor">
<property name="text">
<string>LiDAR 3D ICP Oudoor (50 cm voxel)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_763">
<property name="text">
<string>e.g., Velodyne, RoboSense and Ouster LiDARs.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_764">
<property name="text">
<string>e.g., Velodyne, RoboSense and Ouster LiDARs.</string>
</property>
@@ -8465,6 +8505,11 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<string>VLP-16</string>
</property>
</item>
<item>
<property name="text">
<string>Ouster SDK</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1">
@@ -8761,7 +8806,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<item>
<widget class="QStackedWidget" name="stackedWidget_lidar_src">
<property name="currentIndex">
<number>1</number>
<number>2</number>
</property>
<widget class="QWidget" name="page_98">
<layout class="QVBoxLayout" name="verticalLayout_177">
@@ -9033,6 +9078,243 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
</item>
</layout>
</widget>
<widget class="QWidget" name="page_100">
<layout class="QVBoxLayout" name="verticalLayout_181">
<item>
<widget class="QGroupBox" name="groupBox_ouster">
<property name="title">
<string>Ouster SDK</string>
</property>
<layout class="QGridLayout" name="gridLayout_136" columnstretch="0,0,1">
<item row="4" column="0">
<widget class="QToolButton" name="toolButton_ouster_pcap_path">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="checkBox_ouster_reflectivity">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="label_760">
<property name="text">
<string>Path to a *.JSON config file corresponding to PCAP recording.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_758">
<property name="text">
<string>IP Address or Hostname.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_7482">
<property name="toolTip">
<string>This can speedup deskewing.</string>
</property>
<property name="text">
<string>Lidar mode.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_ouster_ip_hostname"/>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBox_ouster_timestamp">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;TIME_FROM_INTERNAL_OSC: Use the internal clock.&lt;/p&gt;&lt;p&gt;TIME_FROM_SYNC_PULSE_IN: A free running counter synced to the SYNC_PULSE_IN input counts seconds (# of pulses) and nanoseconds since sensor turn on.&lt;/p&gt;&lt;p&gt;TIME_FROM_PTP_1588: Synchronize with an external PTP master.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Default</string>
</property>
</item>
<item>
<property name="text">
<string>From Internal OSC</string>
</property>
</item>
<item>
<property name="text">
<string>From Sync Pulse In</string>
</property>
</item>
<item>
<property name="text">
<string>From PTP 1588</string>
</property>
</item>
</widget>
</item>
<item row="8" column="1">
<spacer name="verticalSpacer_32">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="2">
<widget class="QLabel" name="label_759">
<property name="text">
<string>Path to a *.PCAP file. IP is ignored if PCAP file is used. A JSON file should be provided, see below.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_755">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If the lidar is not connected to a GPS, the lidar's clock may be not in sync with the host computer's clock. By enabling this, as soon as a packet is received, it will be stamped with host time &amp;quot;now&amp;quot;. Note that it affects only the final scan timsestamp, not the individual relative timestamp for each point. It is recommended to enable this if you combine it with other sensors above and it is not connected to a GPS.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Timestamp mode.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_ouster_lidar_mode">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;MODE_512x10: 10 scans of 512 columns per second&lt;/p&gt;&lt;p&gt;MODE_512x20: 20 scans of 512 columns per second&lt;/p&gt;&lt;p&gt;MODE_1024x10: 10 scans of 1024 columns per second&lt;/p&gt;&lt;p&gt;MODE_1024x20: 20 scans of 1024 columns per second&lt;/p&gt;&lt;p&gt;MODE_2048x10: 10 scans of 2048 columns per second&lt;/p&gt;&lt;p&gt;MODE_4096x5: 5 scans of 4096 columns per second. Only available on select sensors&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Default</string>
</property>
</item>
<item>
<property name="text">
<string>512x10</string>
</property>
</item>
<item>
<property name="text">
<string>512x20</string>
</property>
</item>
<item>
<property name="text">
<string>1024x10</string>
</property>
</item>
<item>
<property name="text">
<string>1024x20</string>
</property>
</item>
<item>
<property name="text">
<string>2048x10</string>
</property>
</item>
<item>
<property name="text">
<string>4096x5</string>
</property>
</item>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEdit_ouster_json_path">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="label_761">
<property name="text">
<string>Use Reflectivity instead of Signal for intensity channel.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_ouster_pcap_path">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QToolButton" name="toolButton_ouster_json_path">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="checkBox_ouster_imu">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="label_762">
<property name="text">
<string>Publish IMU.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>