Fixed build with pcl<1.8

This commit is contained in:
matlabbe
2024-05-12 19:13:05 -07:00
parent 9505a21a7e
commit 72d7418011
5 changed files with 24 additions and 5 deletions
+7 -2
View File
@@ -41,8 +41,6 @@ SET(SRC_FILES
camera/CameraMyntEye.cpp
camera/CameraDepthAI.cpp
lidar/LidarVLP16.cpp
EpipolarGeometry.cpp
VisualWord.cpp
VWDictionary.cpp
@@ -138,6 +136,13 @@ SET(SRC_FILES
opencv/five-point.cpp
)
IF(PCL_VERSION VERSION_GREATER_EQUAL "1.8")
SET(SRC_FILES
${SRC_FILES}
lidar/LidarVLP16.cpp
)
ENDIF(PCL_VERSION VERSION_GREATER_EQUAL "1.8")
IF(OpenCV_VERSION_MAJOR EQUAL 2)
SET(SRC_FILES
${SRC_FILES}
+1 -1
View File
@@ -266,7 +266,7 @@ RUN source /root/catkin_ws/devel/setup.bash && \
RUN source /root/catkin_ws/devel/setup.bash && \
cd rtabmap_loam && \
cd build && \
~/cmake -DWITH_LOAM=ON -DWITH_FLOAM=ON -DWITH_OPENGV=OFF .. && \
~/cmake -DWITH_LOAM=ON -DWITH_FLOAM=ON -DWITH_OPENGV=OFF -DWITH_CERES=ON .. && \
make -j3 && \
rm -rf *
RUN source /root/catkin_ws/devel/setup.bash && \
+3 -1
View File
@@ -5,7 +5,9 @@ IF(TARGET rtabmap_gui)
ADD_SUBDIRECTORY( RGBDMapping )
ADD_SUBDIRECTORY( WifiMapping )
ADD_SUBDIRECTORY( NoEventsExample )
ADD_SUBDIRECTORY( LidarMapping )
IF(PCL_VERSION VERSION_GREATER_EQUAL "1.8")
ADD_SUBDIRECTORY( LidarMapping )
ENDIF()
ELSE()
MESSAGE(STATUS "RTAB-Map GUI lib is not built, the RGBDMapping and WifiMapping examples will not be built...")
ENDIF()
+10
View File
@@ -26,8 +26,11 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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/gui/PreferencesDialog.h"
#include "rtabmap/gui/DatabaseViewer.h"
@@ -6950,6 +6953,7 @@ Lidar * PreferencesDialog::createLidar()
Src driver = getLidarSourceDriver();
if(driver == kSrcLidarVLP16)
{
#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())
{
@@ -6994,6 +6998,12 @@ 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;
}
+3 -1
View File
@@ -22,7 +22,9 @@ ENDIF(OPENCV_NONFREE_FOUND)
IF(TARGET rtabmap_gui)
ADD_SUBDIRECTORY( CameraRGBD )
ADD_SUBDIRECTORY( LidarViewer )
IF(PCL_VERSION VERSION_GREATER_EQUAL "1.8")
ADD_SUBDIRECTORY( LidarViewer )
ENDIF()
ADD_SUBDIRECTORY( DatabaseViewer )
ADD_SUBDIRECTORY( EpipolarGeometry )
ADD_SUBDIRECTORY( OdometryViewer )