From 7fc6daa2458ebfb5f05c83846d59c5a09462fea8 Mon Sep 17 00:00:00 2001
From: hannes <hannes.tiltmann@smail.th-koeln.de>
Date: Thu, 25 Nov 2021 15:21:43 +0100
Subject: [PATCH] rebuild architecture

---
 leap_py3/README.md                             | 11 +++++++++++
 custom_py3/example.py => leap_py3/e_logging.py |  3 ++-
 leap_py3/e_rosbridge.py                        | 10 ++++++++++
 {custom_py3 => leap_py3}/leap.py               |  1 -
 4 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 leap_py3/README.md
 rename custom_py3/example.py => leap_py3/e_logging.py (70%)
 create mode 100644 leap_py3/e_rosbridge.py
 rename {custom_py3 => leap_py3}/leap.py (96%)

diff --git a/leap_py3/README.md b/leap_py3/README.md
new file mode 100644
index 0000000..33e16ec
--- /dev/null
+++ b/leap_py3/README.md
@@ -0,0 +1,11 @@
+# Leap Motion API using LeapSDK (leapd) through websocket
+
+## Requirements
+ - 64bit AMD processor
+ - LeapSDK
+ - Python3 and packages:
+    - websocker-client
+ 
+## Examples
+
+Python scripts start with `'e_'` are executable examples.
\ No newline at end of file
diff --git a/custom_py3/example.py b/leap_py3/e_logging.py
similarity index 70%
rename from custom_py3/example.py
rename to leap_py3/e_logging.py
index 493c188..51a7cd8 100644
--- a/custom_py3/example.py
+++ b/leap_py3/e_logging.py
@@ -3,4 +3,5 @@ from leap import LeapController
 l = LeapController("127.0.0.1", logging=True)
 l.run()
 
-input()
\ No newline at end of file
+# some time to read logging
+input()
diff --git a/leap_py3/e_rosbridge.py b/leap_py3/e_rosbridge.py
new file mode 100644
index 0000000..fc78326
--- /dev/null
+++ b/leap_py3/e_rosbridge.py
@@ -0,0 +1,10 @@
+from leap import LeapController
+import roslibpy
+
+h="127.0.0.1"
+p="9090"
+client = roslibpy.Ros(host=h, port=p)
+
+client.run()
+
+roslibpy.Topic(client, '/leap','')
\ No newline at end of file
diff --git a/custom_py3/leap.py b/leap_py3/leap.py
similarity index 96%
rename from custom_py3/leap.py
rename to leap_py3/leap.py
index 286a94e..69f431f 100644
--- a/custom_py3/leap.py
+++ b/leap_py3/leap.py
@@ -20,7 +20,6 @@ class LeapController:
         self.frame = json.loads(m)
 
         if self.logging: 
-            print("wow, new frame")
             for h in self.frame["hands"]:
                 print(json.dumps(h["t"], indent=3))
 
-- 
GitLab