feat: updated tick count and changed inversion of neck movement

This commit is contained in:
2020-08-28 13:48:35 +02:00
parent 02fa0c3ee6
commit 4843c0cf7d
2 changed files with 3 additions and 3 deletions

View File

@@ -126,9 +126,9 @@ class WallE:
def set_eye_velocity(self, angle: float, distance: float):
if distance > 1:
distance = 1
up_down = distance * math.sin(angle)
up_down = distance * math.sin(angle) * -1
left_right = distance * math.cos(angle)
minmax_rotate = SERVO_MIN_MAX[SERVO_NECK_ROTATE]
minmax_necktop = SERVO_MIN_MAX[SERVO_NECK_TOP]
self.set_servo(SERVO_NECK_ROTATE, map_range(left_right, -1.0, 1.0, minmax_rotate.minval, minmax_rotate.maxval))
self.set_servo(SERVO_NECK_TOP, map_range(up_down, 1.0, -1.0, minmax_necktop.minval, minmax_necktop.maxval))
self.set_servo(SERVO_NECK_TOP, map_range(up_down, -1.0, 1.0, minmax_necktop.minval, minmax_necktop.maxval))

View File

@@ -7,7 +7,7 @@ from redis import Redis
from control.walle import WallE
INTERVAL_TICK = 0.0125 # 20/s
INTERVAL_TICK = 0.025 # 40/s
class EventListener(Thread):