From ec6cee9341de12f58ec2aca84179e04b3c501cbf Mon Sep 17 00:00:00 2001
From: Fabian Reister <fabian.reister@kit.edu>
Date: Fri, 16 Apr 2021 16:05:17 +0200
Subject: [PATCH] custom pcl point type

---
 .../RobotAPI/libraries/core/pcl_point_types.h | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 source/RobotAPI/libraries/core/pcl_point_types.h

diff --git a/source/RobotAPI/libraries/core/pcl_point_types.h b/source/RobotAPI/libraries/core/pcl_point_types.h
new file mode 100644
index 000000000..e610f72fe
--- /dev/null
+++ b/source/RobotAPI/libraries/core/pcl_point_types.h
@@ -0,0 +1,63 @@
+/*
+ * This file is part of ArmarX.
+ *
+ * ArmarX is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * ArmarX is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @package    RobotAPI::Core
+ * @author     Fabian Reister ( fabian dot reister at kit dot edu )
+ * @date       2021
+ * @copyright  http://www.gnu.org/licenses/gpl-2.0.txt
+ *             GNU General Public License
+ */
+
+#pragma once
+
+#define PCL_NO_PRECOMPILE
+#include <pcl/pcl_macros.h>
+#include <pcl/point_types.h>
+#include <pcl/point_cloud.h>
+#include <pcl/io/pcd_io.h>
+// #include <pcl/memory.h>
+
+#include <Eigen/Core>
+
+namespace pcl
+{
+
+    /**
+     * @brief Point for polar coordinates
+     *
+     */
+    struct PointPolar
+    {
+        //   PCL_ADD_POINT4D;                  // preferred way of adding a XYZ+padding
+
+        //! radial distance
+        float r;
+
+        //! angle
+        float phi;
+
+        EIGEN_MAKE_ALIGNED_OPERATOR_NEW
+        // PCL_MAKE_ALIGNED_OPERATOR_NEW     // make sure our new allocators are aligned
+    } EIGEN_ALIGN16;                    // enforce SSE padding for correct memory alignment
+
+
+
+} // namespace pcl
+
+
+POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::PointPolar,
+                                  (float, r, r)
+                                  (float, phi, phi)
+                                 )
\ No newline at end of file
-- 
GitLab