From 084a11fddd8991ff91a7fdd3aa9cc7601eb0c568 Mon Sep 17 00:00:00 2001
From: Fabian Reister <fabian.reister@kit.edu>
Date: Thu, 8 Jul 2021 16:11:43 +0200
Subject: [PATCH] update

---
 .../Navigation/libraries/server/Navigator.cpp | 30 ++++++++++++++++++-
 .../Navigation/libraries/server/Navigator.h   | 23 ++------------
 2 files changed, 31 insertions(+), 22 deletions(-)

diff --git a/source/Navigation/libraries/server/Navigator.cpp b/source/Navigation/libraries/server/Navigator.cpp
index b2908d81..749ad8f3 100644
--- a/source/Navigation/libraries/server/Navigator.cpp
+++ b/source/Navigation/libraries/server/Navigator.cpp
@@ -8,7 +8,35 @@
 
 namespace armarx::nav::server
 {
-    Navigator::Navigator(const server::NavigationStack& navigationStack, const core::Scene& scene, ExecutorInterface& executor) :
+
+    // Stack result
+    core::TrajectoryPtr StackResult::trajectory() const
+    {
+        if (localTrajectory)
+        {
+            return localTrajectory;
+        }
+
+        ARMARX_CHECK_NOT_NULL(globalTrajectory);
+        return globalTrajectory;
+    }
+
+    core::Twist StackResult::velocity() const
+    {
+        if (safeVelocity.has_value())
+        {
+            return safeVelocity.value();
+        }
+
+        ARMARX_CHECK(controlVelocity.has_value());
+        return *controlVelocity;
+    }
+
+    // Navigator
+
+    Navigator::Navigator(const server::NavigationStack& navigationStack,
+                         const core::Scene& scene,
+                         ExecutorInterface& executor) :
         stack(navigationStack), scene(scene), executor{executor}
     {
         setTag("Navigator");
diff --git a/source/Navigation/libraries/server/Navigator.h b/source/Navigation/libraries/server/Navigator.h
index 783d1acc..848daae3 100644
--- a/source/Navigation/libraries/server/Navigator.h
+++ b/source/Navigation/libraries/server/Navigator.h
@@ -43,27 +43,8 @@ namespace armarx::nav::server
         std::optional<core::Twist> controlVelocity;
         std::optional<core::Twist> safeVelocity;
 
-        core::TrajectoryPtr trajectory() const
-        {
-            if (localTrajectory)
-            {
-                return localTrajectory;
-            }
-
-            ARMARX_CHECK_NOT_NULL(globalTrajectory);
-            return globalTrajectory;
-        }
-
-        core::Twist velocity() const
-        {
-            if (safeVelocity.has_value())
-            {
-                return safeVelocity.value();
-            }
-
-            ARMARX_CHECK(controlVelocity.has_value());
-            return *controlVelocity;
-        }
+        core::TrajectoryPtr trajectory() const;
+        core::Twist velocity() const;
     };
 
     class Navigator : public armarx::Logging
-- 
GitLab