mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 10:00:23 +08:00
Fixed ZED driver timestamp. Re-ordered build include dirs to keep opencv in front. Fixed build with OpenCV 4.7.0.
This commit is contained in:
@@ -820,10 +820,6 @@ ADD_CUSTOM_COMMAND(
|
|||||||
|
|
||||||
add_definitions(${PCL_DEFINITIONS})
|
add_definitions(${PCL_DEFINITIONS})
|
||||||
|
|
||||||
|
|
||||||
# Make sure the compiler can find include files from our library.
|
|
||||||
INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
|
|
||||||
|
|
||||||
# Add binary that is built from the source file "main.cpp".
|
# Add binary that is built from the source file "main.cpp".
|
||||||
# The extension is automatically found.
|
# The extension is automatically found.
|
||||||
ADD_LIBRARY(rtabmap_core ${SRC_FILES} ${RESOURCES_HEADERS})
|
ADD_LIBRARY(rtabmap_core ${SRC_FILES} ${RESOURCES_HEADERS})
|
||||||
@@ -833,7 +829,7 @@ generate_export_header(rtabmap_core
|
|||||||
DEPRECATED_MACRO_NAME RTABMAP_DEPRECATED)
|
DEPRECATED_MACRO_NAME RTABMAP_DEPRECATED)
|
||||||
|
|
||||||
target_include_directories(rtabmap_core PUBLIC
|
target_include_directories(rtabmap_core PUBLIC
|
||||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include;${CMAKE_CURRENT_BINARY_DIR}/include;${PUBLIC_INCLUDE_DIRS}>"
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include;${CMAKE_CURRENT_BINARY_DIR}/include;${PUBLIC_INCLUDE_DIRS};${INCLUDE_DIRS}>"
|
||||||
"$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR};${PUBLIC_INCLUDE_DIRS}>")
|
"$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR};${PUBLIC_INCLUDE_DIRS}>")
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(rtabmap_core
|
TARGET_LINK_LIBRARIES(rtabmap_core
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ private:
|
|||||||
sl::ERROR_CODE res = zed_->getSensorsData(sensordata, sl::TIME_REFERENCE::CURRENT);
|
sl::ERROR_CODE res = zed_->getSensorsData(sensordata, sl::TIME_REFERENCE::CURRENT);
|
||||||
if(res == sl::ERROR_CODE::SUCCESS && sensordata.imu.is_available)
|
if(res == sl::ERROR_CODE::SUCCESS && sensordata.imu.is_available)
|
||||||
{
|
{
|
||||||
camera_->postInterIMUPublic(zedIMUtoIMU(sensordata, imuLocalTransform_), double(sensordata.imu.timestamp)/10e9);
|
camera_->postInterIMUPublic(zedIMUtoIMU(sensordata, imuLocalTransform_), double(sensordata.imu.timestamp.getNanoseconds())/10e8);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -715,7 +715,7 @@ SensorData CameraStereoZed::captureImage(SensorCaptureInfo * info)
|
|||||||
{
|
{
|
||||||
sl::SensorsData imudatatmp;
|
sl::SensorsData imudatatmp;
|
||||||
res = zed_->getSensorsData(imudatatmp, sl::TIME_REFERENCE::IMAGE);
|
res = zed_->getSensorsData(imudatatmp, sl::TIME_REFERENCE::IMAGE);
|
||||||
imuReceived = res == sl::ERROR_CODE::SUCCESS && imudatatmp.imu.is_available && imudatatmp.imu.timestamp.data_ns != 0;
|
imuReceived = res == sl::ERROR_CODE::SUCCESS && imudatatmp.imu.is_available && imudatatmp.imu.timestamp.getNanoseconds() != 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(src_ == CameraVideo::kUsbDevice && (res!=sl::ERROR_CODE::SUCCESS || !imuReceived) && timer.elapsed() < 2.0);
|
while(src_ == CameraVideo::kUsbDevice && (res!=sl::ERROR_CODE::SUCCESS || !imuReceived) && timer.elapsed() < 2.0);
|
||||||
@@ -749,8 +749,9 @@ SensorData CameraStereoZed::captureImage(SensorCaptureInfo * info)
|
|||||||
#if ZED_SDK_MAJOR_VERSION < 3
|
#if ZED_SDK_MAJOR_VERSION < 3
|
||||||
data = SensorData(left, depth, stereoModel_.left(), this->getNextSeqID(), UTimer::now());
|
data = SensorData(left, depth, stereoModel_.left(), this->getNextSeqID(), UTimer::now());
|
||||||
#else
|
#else
|
||||||
data = SensorData(left, depth, stereoModel_.left(), this->getNextSeqID(), double(timestamp)/10e9);
|
data = SensorData(left, depth, stereoModel_.left(), this->getNextSeqID(), double(timestamp.getNanoseconds())/10e8);
|
||||||
#endif
|
#endif
|
||||||
|
UWARN("data stamp = %f", data.stamp());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -766,7 +767,7 @@ SensorData CameraStereoZed::captureImage(SensorCaptureInfo * info)
|
|||||||
#if ZED_SDK_MAJOR_VERSION < 3
|
#if ZED_SDK_MAJOR_VERSION < 3
|
||||||
data = SensorData(left, right, stereoModel_, this->getNextSeqID(), UTimer::now());
|
data = SensorData(left, right, stereoModel_, this->getNextSeqID(), UTimer::now());
|
||||||
#else
|
#else
|
||||||
data = SensorData(left, right, stereoModel_, this->getNextSeqID(), double(timestamp)/10e9);
|
data = SensorData(left, right, stereoModel_, this->getNextSeqID(), double(timestamp.getNanoseconds())/10e8);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,8 +161,10 @@ CalibrationDialog::CalibrationDialog(bool stereo, const QString & savingDirector
|
|||||||
#ifndef HAVE_CHARUCO
|
#ifndef HAVE_CHARUCO
|
||||||
ui_->comboBox_board_type->setItemData(1, 0, Qt::UserRole - 1);
|
ui_->comboBox_board_type->setItemData(1, 0, Qt::UserRole - 1);
|
||||||
ui_->comboBox_board_type->setItemData(2, 0, Qt::UserRole - 1);
|
ui_->comboBox_board_type->setItemData(2, 0, Qt::UserRole - 1);
|
||||||
#elif CV_MAJOR_VERSION < 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION < 7)
|
#elif CV_MAJOR_VERSION < 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION < 6)
|
||||||
ui_->comboBox_board_type->setItemData(2, 0, Qt::UserRole - 1);
|
ui_->comboBox_board_type->setItemData(2, 0, Qt::UserRole - 1);
|
||||||
|
#elif CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION < 8
|
||||||
|
ui_->comboBox_board_type->setItemData(1, 0, Qt::UserRole - 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1289,7 +1291,9 @@ void CalibrationDialog::restart()
|
|||||||
ui_->doubleSpinBox_squareSize->value(),
|
ui_->doubleSpinBox_squareSize->value(),
|
||||||
ui_->doubleSpinBox_markerLength->value(),
|
ui_->doubleSpinBox_markerLength->value(),
|
||||||
*markerDictionary_));
|
*markerDictionary_));
|
||||||
|
#if CV_MAJOR_VERSION > 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION >= 8)
|
||||||
charucoBoard_->setLegacyPattern(ui_->comboBox_board_type->currentIndex()==1);
|
charucoBoard_->setLegacyPattern(ui_->comboBox_board_type->currentIndex()==1);
|
||||||
|
#endif
|
||||||
arucoDetector_.reset(new cv::aruco::ArucoDetector(*markerDictionary_, *arucoDetectorParams_));
|
arucoDetector_.reset(new cv::aruco::ArucoDetector(*markerDictionary_, *arucoDetectorParams_));
|
||||||
charucoDetector_.reset(new cv::aruco::CharucoDetector(*charucoBoard_, cv::aruco::CharucoParameters(), *arucoDetectorParams_));
|
charucoDetector_.reset(new cv::aruco::CharucoDetector(*charucoBoard_, cv::aruco::CharucoParameters(), *arucoDetectorParams_));
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user