From ed0f25a4231158f2ac0c4bbe654403d4d496a57d Mon Sep 17 00:00:00 2001
From: Martin Lambers <marlam@marlam.de>
Date: Thu, 15 Aug 2013 11:00:06 +0000
Subject: gta from-pcd, to-pcd: port to libpcl version 1.7 (1.6 still works)
---
diff --git a/gtatool/configure.ac b/gtatool/configure.ac
index 49cf817..f7aacda 100644
--- a/gtatool/configure.ac
+++ b/gtatool/configure.ac
@@ -397,12 +397,14 @@ AC_ARG_WITH([pcd],
[AS_HELP_STRING([--with-pcd], [Enable PCD import/export. Enabled by default if libpcl_io is available.])],
[if test "$withval" = "yes"; then pcd="yes"; else pcd="no "; fi], [pcd="yes"])
if test "$pcd" = "yes"; then
+ dnl The PCL team puts the PCL version number into the module name. Ouch.
PKG_CHECK_MODULES([libpcl_io], [pcl_io >= 1.6], [],
- [PKG_CHECK_MODULES([libpcl_io], [pcl_io-1.6 >= 1.6], [],
- [pcd="no "
- AC_MSG_WARN([PCL io library not found:])
- AC_MSG_WARN([$libpcl_io_PKG_ERRORS])
- AC_MSG_WARN([Disabled the from-pcd and to-pcd commands.])])])
+ [PKG_CHECK_MODULES([libpcl_io], [pcl_io-1.7 >= 1.7], [],
+ [PKG_CHECK_MODULES([libpcl_io], [pcl_io-1.6 >= 1.6], [],
+ [pcd="no "
+ AC_MSG_WARN([PCL io library not found:])
+ AC_MSG_WARN([$libpcl_io_PKG_ERRORS])
+ AC_MSG_WARN([Disabled the from-pcd and to-pcd commands.])])])])
fi
AC_DEFINE_UNQUOTED([WITH_PCD], [`if test "$pcd" = "yes"; then echo "1"; else echo "0"; fi`], [Use pcd?])
AM_CONDITIONAL([WITH_PCD], [test "$pcd" = "yes"])
diff --git a/gtatool/src/conv-pcd/from-pcd.cpp b/gtatool/src/conv-pcd/from-pcd.cpp
index a86dd99..19f2a3a 100644
--- a/gtatool/src/conv-pcd/from-pcd.cpp
+++ b/gtatool/src/conv-pcd/from-pcd.cpp
@@ -28,6 +28,11 @@
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
+#if PCL_VERSION >= PCL_VERSION_CALC(1, 7, 0)
+# define sensor_msgs pcl
+# define PointCloud2 PCLPointCloud2
+# define fromROSMsg fromPCLPointCloud2
+#endif
#include "base/msg.h"
#include "base/blb.h"
--
cgit v0.9.0.2