diff --git a/Togetic/Blender/PositionController.py b/Togetic/Blender/PositionController.py index b7c6560..3731d50 100644 --- a/Togetic/Blender/PositionController.py +++ b/Togetic/Blender/PositionController.py @@ -1,5 +1,6 @@ import mathutils import time +import math from Togetic.shm import shm from Togetic.Blender.Receiver import Receiver @@ -25,7 +26,7 @@ def run(self): self._owner.worldPosition = self._initPosition \ + mathutils.Vector((x, y, z)) ori = self._owner.orientation.to_euler() - ori.x = theta + ori.x = -theta + math.pi / 2 ori.y = -phy ori.z = psy self._owner.orientation = ori diff --git a/Togetic/Server/AbstractServer.py b/Togetic/Server/AbstractServer.py index 05c0a7e..e2a9c8e 100644 --- a/Togetic/Server/AbstractServer.py +++ b/Togetic/Server/AbstractServer.py @@ -1,5 +1,6 @@ import sys import threading +import time class AbstractServer(threading.Thread): def __init__(self): @@ -39,6 +40,7 @@ def run(self): while self._running: try: self._serve() + time.sleep(0.005) except Exception as e: # print('Server `', self, '` stopped by an exception :', e, file=sys.stderr) self.stop()