From d5db819c1608c90e1737382181b7b5a1c6da80a4 Mon Sep 17 00:00:00 2001
From: Rainer Kartmann <rainer.kartmann@kit.edu>
Date: Tue, 17 Aug 2021 18:12:55 +0200
Subject: [PATCH] Add libraries locations and graphs

---
 source/armarx/navigation/graph/CMakeLists.txt | 30 +++++++++++++
 source/armarx/navigation/graph/aron/Graph.xml | 21 +++++++++
 source/armarx/navigation/graph/constants.cpp  | 11 +++++
 source/armarx/navigation/graph/constants.h    | 30 +++++++++++++
 .../armarx/navigation/location/CMakeLists.txt | 29 ++++++++++++
 .../navigation/location/aron/Location.xml     | 44 +++++++++++++++++++
 .../armarx/navigation/location/constants.cpp  | 11 +++++
 source/armarx/navigation/location/constants.h | 30 +++++++++++++
 8 files changed, 206 insertions(+)
 create mode 100644 source/armarx/navigation/graph/CMakeLists.txt
 create mode 100644 source/armarx/navigation/graph/aron/Graph.xml
 create mode 100644 source/armarx/navigation/graph/constants.cpp
 create mode 100644 source/armarx/navigation/graph/constants.h
 create mode 100644 source/armarx/navigation/location/CMakeLists.txt
 create mode 100644 source/armarx/navigation/location/aron/Location.xml
 create mode 100644 source/armarx/navigation/location/constants.cpp
 create mode 100644 source/armarx/navigation/location/constants.h

diff --git a/source/armarx/navigation/graph/CMakeLists.txt b/source/armarx/navigation/graph/CMakeLists.txt
new file mode 100644
index 00000000..ae1cf290
--- /dev/null
+++ b/source/armarx/navigation/graph/CMakeLists.txt
@@ -0,0 +1,30 @@
+set(LIB_NAME ${PROJECT_NAME}Graph)
+
+armarx_component_set_name("${LIB_NAME}")
+armarx_set_target("Library: ${LIB_NAME}")
+
+
+armarx_add_library(
+    LIBS
+        ArmarXCoreInterfaces
+        ArmarXCore
+        # ${PROJECT_NAME}Core
+    SOURCES
+        constants.cpp
+    HEADERS
+        constants.h
+)
+
+
+add_library(
+    ${PROJECT_NAME}::Graph
+    ALIAS
+    "${LIB_NAME}"
+)
+
+armarx_enable_aron_file_generation_for_target(
+    TARGET_NAME 
+        "${LIB_NAME}"
+    ARON_FILES
+        aron/Graph.xml
+)
diff --git a/source/armarx/navigation/graph/aron/Graph.xml b/source/armarx/navigation/graph/aron/Graph.xml
new file mode 100644
index 00000000..38d9fe74
--- /dev/null
+++ b/source/armarx/navigation/graph/aron/Graph.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<AronTypeDefinition>
+    <CodeIncludes>
+      <!--Include include="armarx/navigation/locations/aron/Location.aron.generated.h" /-->
+    </CodeIncludes>
+    <AronIncludes>
+      <!-- <Include include="<armarx/navigation/locations/aron/Location.xml>" /> -->
+    </AronIncludes>
+
+    <GenerateTypes>
+
+        <Object name='armarx::nav::graphs::arondto::Graph'>
+
+            <!--ObjectChild key='location'>
+                <armarx::nav::locs::arondto::Location />
+            </ObjectChild-->
+
+        </Object>
+
+    </GenerateTypes>
+</AronTypeDefinition>
diff --git a/source/armarx/navigation/graph/constants.cpp b/source/armarx/navigation/graph/constants.cpp
new file mode 100644
index 00000000..e1b0ee56
--- /dev/null
+++ b/source/armarx/navigation/graph/constants.cpp
@@ -0,0 +1,11 @@
+#include "aron_conversions.h"
+
+
+namespace armarx::nav
+{
+
+    void core::test()
+    {
+
+    }
+}
diff --git a/source/armarx/navigation/graph/constants.h b/source/armarx/navigation/graph/constants.h
new file mode 100644
index 00000000..0897a62a
--- /dev/null
+++ b/source/armarx/navigation/graph/constants.h
@@ -0,0 +1,30 @@
+/**
+ * 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/>.
+ *
+ * @author     Rainer Kartmann ( rainer dot kartmann at kit dot edu )
+ * @date       2021
+ * @copyright  http://www.gnu.org/licenses/gpl-2.0.txt
+ *             GNU General Public License
+ */
+
+#pragma once
+
+
+namespace armarx::nav::core
+{
+
+    void test();
+
+}
diff --git a/source/armarx/navigation/location/CMakeLists.txt b/source/armarx/navigation/location/CMakeLists.txt
new file mode 100644
index 00000000..a23eb4a2
--- /dev/null
+++ b/source/armarx/navigation/location/CMakeLists.txt
@@ -0,0 +1,29 @@
+set(LIB_NAME ${PROJECT_NAME}Location)
+
+armarx_component_set_name("${LIB_NAME}")
+armarx_set_target("Library: ${LIB_NAME}")
+
+
+armarx_add_library(
+    LIBS
+        ArmarXCoreInterfaces 
+        ArmarXCore
+        # ${ProjectName}Libraries
+    SOURCES
+        constants.cpp
+    HEADERS
+        constants.h
+)
+
+add_library(
+    ${PROJECT_NAME}::Location
+    ALIAS
+    ${LIB_NAME}
+)
+
+armarx_enable_aron_file_generation_for_target(
+    TARGET_NAME 
+        "${LIB_NAME}"
+    ARON_FILES
+        aron/Location.xml
+)
diff --git a/source/armarx/navigation/location/aron/Location.xml b/source/armarx/navigation/location/aron/Location.xml
new file mode 100644
index 00000000..eb3cc696
--- /dev/null
+++ b/source/armarx/navigation/location/aron/Location.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<AronTypeDefinition>
+    <CodeIncludes>
+    </CodeIncludes>
+    <AronIncludes>
+        <Include include="<RobotAPI/libraries/armem/aron/MemoryID.xml>" autoinclude="true"/>
+    </AronIncludes>
+
+    <GenerateTypes>
+
+        <!--
+        ToDo: Model regions. Ideas:
+        - Polygon (convex, non-convex)
+        -
+        -->
+
+
+        <Object name='armarx::nav::locs::arondto::ObjectRelativeLocation'>
+
+            <ObjectChild key='objectInstanceID'>
+                <armarx::armem::arondto::MemoryID />
+            </ObjectChild>
+
+            <ObjectChild key='relativeRobotPose'>
+                <Pose />
+            </ObjectChild>
+
+        </Object>
+
+
+        <Object name='armarx::nav::locs::arondto::Location'>
+
+            <ObjectChild key='globalRobotPose'>
+                <Pose />
+            </ObjectChild>
+
+            <ObjectChild key='relativeToObject'>
+                <armarx::nav::locs::arondto::ObjectRelativeLocation optional="true" />
+            </ObjectChild>
+
+        </Object>
+
+    </GenerateTypes>
+</AronTypeDefinition>
diff --git a/source/armarx/navigation/location/constants.cpp b/source/armarx/navigation/location/constants.cpp
new file mode 100644
index 00000000..d35921fd
--- /dev/null
+++ b/source/armarx/navigation/location/constants.cpp
@@ -0,0 +1,11 @@
+#include "aron_conversions.h"
+
+
+namespace armarx::nav
+{
+
+    void coree::test()
+    {
+
+    }
+}
diff --git a/source/armarx/navigation/location/constants.h b/source/armarx/navigation/location/constants.h
new file mode 100644
index 00000000..44692727
--- /dev/null
+++ b/source/armarx/navigation/location/constants.h
@@ -0,0 +1,30 @@
+/**
+ * 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/>.
+ *
+ * @author     Rainer Kartmann ( rainer dot kartmann at kit dot edu )
+ * @date       2021
+ * @copyright  http://www.gnu.org/licenses/gpl-2.0.txt
+ *             GNU General Public License
+ */
+
+#pragma once
+
+
+namespace armarx::nav::coree
+{
+
+void test();
+
+}
-- 
GitLab