feat: updated tick count and changed inversion of neck movement
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user