From 3b263469cf4267967e67c32e9562964e1e0bda3e Mon Sep 17 00:00:00 2001
From: Rainer Kartmann <rainer.kartmann@kit.edu>
Date: Tue, 7 Jun 2022 17:03:01 +0200
Subject: [PATCH] Move file and update usage

---
 VirtualRobot/CMakeLists.txt                              | 2 ++
 .../{examples => Nodes}/HemisphereJoint/Expressions.cpp  | 9 +++++++++
 .../{examples => Nodes}/HemisphereJoint/Expressions.h    | 9 +++++++++
 VirtualRobot/examples/HemisphereJoint/CMakeLists.txt     | 2 --
 VirtualRobot/examples/HemisphereJoint/main.cpp           | 5 ++---
 5 files changed, 22 insertions(+), 5 deletions(-)
 rename VirtualRobot/{examples => Nodes}/HemisphereJoint/Expressions.cpp (99%)
 rename VirtualRobot/{examples => Nodes}/HemisphereJoint/Expressions.h (99%)

diff --git a/VirtualRobot/CMakeLists.txt b/VirtualRobot/CMakeLists.txt
index dc0f6c16b..b1f94f6eb 100644
--- a/VirtualRobot/CMakeLists.txt
+++ b/VirtualRobot/CMakeLists.txt
@@ -335,6 +335,7 @@ SET(SOURCES
     Nodes/RobotNodeRevolute.cpp
     Nodes/RobotNodeRevoluteFactory.cpp
     Nodes/Sensor.cpp
+    Nodes/HemisphereJoint/Expressions.cpp
 
     TimeOptimalTrajectory/Path.cpp
     TimeOptimalTrajectory/TimeOptimalTrajectory.cpp
@@ -576,6 +577,7 @@ SET(INCLUDES
     Nodes/RobotNodeRevoluteFactory.h
     Nodes/Sensor.h
     Nodes/SensorFactory.h
+    Nodes/HemisphereJoint/Expressions.h
 
     TimeOptimalTrajectory/Path.h
     TimeOptimalTrajectory/TimeOptimalTrajectory.h
diff --git a/VirtualRobot/examples/HemisphereJoint/Expressions.cpp b/VirtualRobot/Nodes/HemisphereJoint/Expressions.cpp
similarity index 99%
rename from VirtualRobot/examples/HemisphereJoint/Expressions.cpp
rename to VirtualRobot/Nodes/HemisphereJoint/Expressions.cpp
index 21e1652fe..12d078dfb 100644
--- a/VirtualRobot/examples/HemisphereJoint/Expressions.cpp
+++ b/VirtualRobot/Nodes/HemisphereJoint/Expressions.cpp
@@ -1,8 +1,15 @@
+/*
+ * This file was generated automatically on 2022-06-07 17:00.
+ */
+
 #include "Expressions.h"
 
 #include <cmath>
 
 
+namespace VirtualRobot::hemisphere
+{
+
 void Expressions::compute(double a1, double a2, double lever, double theta0)
 {
     this->a1 = a1;
@@ -235,3 +242,5 @@ void Expressions::compute(double a1, double a2, double lever, double theta0)
     jrz2 = _lever_pow_2;
 }
 
+}
+
diff --git a/VirtualRobot/examples/HemisphereJoint/Expressions.h b/VirtualRobot/Nodes/HemisphereJoint/Expressions.h
similarity index 99%
rename from VirtualRobot/examples/HemisphereJoint/Expressions.h
rename to VirtualRobot/Nodes/HemisphereJoint/Expressions.h
index 549537b83..c0f820ed4 100644
--- a/VirtualRobot/examples/HemisphereJoint/Expressions.h
+++ b/VirtualRobot/Nodes/HemisphereJoint/Expressions.h
@@ -1,6 +1,13 @@
+/*
+ * This file was generated automatically on 2022-06-07 17:00.
+ */
+
 #pragma once
 
 
+namespace VirtualRobot::hemisphere
+{
+
 class Expressions
 {
 public:
@@ -241,3 +248,5 @@ public:
 
 };
 
+}
+
diff --git a/VirtualRobot/examples/HemisphereJoint/CMakeLists.txt b/VirtualRobot/examples/HemisphereJoint/CMakeLists.txt
index ee16965bc..8ec94312f 100644
--- a/VirtualRobot/examples/HemisphereJoint/CMakeLists.txt
+++ b/VirtualRobot/examples/HemisphereJoint/CMakeLists.txt
@@ -5,10 +5,8 @@ find_package(Boost ${Simox_BOOST_VERSION} EXACT COMPONENTS system REQUIRED)
 if (Boost_FOUND)
     set(SOURCES
         main.cpp
-        Expressions.cpp
     )
     set(HEADERS
-        Expressions.h
     )
 
     set(LIBS
diff --git a/VirtualRobot/examples/HemisphereJoint/main.cpp b/VirtualRobot/examples/HemisphereJoint/main.cpp
index 7b2d614fd..fc371c634 100644
--- a/VirtualRobot/examples/HemisphereJoint/main.cpp
+++ b/VirtualRobot/examples/HemisphereJoint/main.cpp
@@ -1,5 +1,3 @@
-#include "Expressions.h"
-
 #include <chrono>
 #include <iostream>
 
@@ -8,6 +6,7 @@
 #include <SimoxUtility/math/statistics/measures.h>
 
 #include <VirtualRobot/RuntimeEnvironment.h>
+#include <VirtualRobot/Nodes/HemisphereJoint/Expressions.h>
 
 
 using VirtualRobot::RuntimeEnvironment;
@@ -61,7 +60,7 @@ int main(int argc, char* argv[])
         {
             const time_point start = std::chrono::system_clock::now();
 
-            Expressions expr;
+            VirtualRobot::hemisphere::Expressions expr;
             expr.compute(a1, a2, lever, theta0);
 
             Eigen::Vector3d pos {expr.ex, expr.ey, expr.ez};
-- 
GitLab