mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
CameraRealSense2: Odom extrinsics against another sensor can be calibrated with having to calibrate stereo first. DBViewer: fixed local grid wrongly using global grid parameters.
This commit is contained in:
@@ -415,7 +415,7 @@ private:
|
||||
void addParameters(const QGroupBox * box);
|
||||
QList<QGroupBox*> getGroupBoxes();
|
||||
void readSettingsBegin();
|
||||
Camera * createCamera(Src driver, const QString & device, const QString & calibrationPath, bool useRawImages, bool useColor, bool odomOnly); // return camera should be deleted if not null
|
||||
Camera * createCamera(Src driver, const QString & device, const QString & calibrationPath, bool useRawImages, bool useColor, bool odomOnly, bool odomSensorExtrinsicsCalib); // return camera should be deleted if not null
|
||||
|
||||
protected:
|
||||
PANEL_FLAGS _obsoletePanels;
|
||||
|
||||
@@ -5025,6 +5025,7 @@ void DatabaseViewer::update(int value,
|
||||
if(ui_->checkBox_showMap->isChecked())
|
||||
{
|
||||
float xMin=0.0f, yMin=0.0f;
|
||||
cv::Mat map8S;
|
||||
ParametersMap parameters = ui_->parameters_toolbox->getParameters();
|
||||
parameters = Parameters::filterParameters(parameters, "GridGlobal", true);
|
||||
float gridCellSize = Parameters::defaultGridCellSize();
|
||||
@@ -5035,7 +5036,7 @@ void DatabaseViewer::update(int value,
|
||||
map8S = octomap->createProjectionMap(xMin, yMin, gridCellSize, 0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
OccupancyGrid grid(parameters);
|
||||
grid.setCellSize(gridCellSize);
|
||||
|
||||
@@ -5857,6 +5857,7 @@ Camera * PreferencesDialog::createCamera(bool useRawImages, bool useColor)
|
||||
!_ui->checkBox_stereo_rectify->isChecked()) ||
|
||||
useRawImages,
|
||||
useColor,
|
||||
false,
|
||||
false);
|
||||
}
|
||||
|
||||
@@ -5866,7 +5867,8 @@ Camera * PreferencesDialog::createCamera(
|
||||
const QString & calibrationPath,
|
||||
bool useRawImages,
|
||||
bool useColor,
|
||||
bool odomOnly)
|
||||
bool odomOnly,
|
||||
bool odomSensorExtrinsicsCalib)
|
||||
{
|
||||
if(odomOnly && !(driver == kSrcStereoRealSense2 || driver == kSrcStereoZed))
|
||||
{
|
||||
@@ -6014,7 +6016,7 @@ Camera * PreferencesDialog::createCamera(
|
||||
if(driver == kSrcStereoRealSense2)
|
||||
{
|
||||
((CameraRealSense2*)camera)->setImagesRectified(!useRawImages);
|
||||
((CameraRealSense2*)camera)->setOdomProvided(_ui->comboBox_odom_sensor->currentIndex() == 1 || odomOnly, odomOnly);
|
||||
((CameraRealSense2*)camera)->setOdomProvided(_ui->comboBox_odom_sensor->currentIndex() == 1 || odomOnly, odomOnly, odomSensorExtrinsicsCalib);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6383,7 +6385,7 @@ Camera * PreferencesDialog::createOdomSensor(Transform & extrinsics, double & ti
|
||||
timeOffset = _ui->doubleSpinBox_odom_sensor_time_offset->value()/1000.0;
|
||||
scaleFactor = (float)_ui->doubleSpinBox_odom_sensor_scale_factor->value();
|
||||
|
||||
return createCamera(driver, _ui->lineEdit_odomSourceDevice->text(), _ui->lineEdit_odom_sensor_path_calibration->text(), false, true, true);
|
||||
return createCamera(driver, _ui->lineEdit_odomSourceDevice->text(), _ui->lineEdit_odom_sensor_path_calibration->text(), false, true, true, false);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -7060,7 +7062,7 @@ void PreferencesDialog::calibrateOdomSensorExtrinsics()
|
||||
odomDriver,
|
||||
_ui->lineEdit_odomSourceDevice->text(),
|
||||
_ui->lineEdit_odom_sensor_path_calibration->text(),
|
||||
false, true, false); // Odom sensor
|
||||
false, true, false, true); // Odom sensor
|
||||
if(!camera)
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user