-
Notifications
You must be signed in to change notification settings - Fork 0
/
MoveForward.py
36 lines (32 loc) · 1.25 KB
/
MoveForward.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from MoveLegRear import *
from LegsControl import *
from MoveLegFront import MoveLegFront
class MoveForward:
def __init__(self, front_left, front_right, rear_left, rear_right):
self.front_left = front_left
self.rear_right = rear_right
self.front_right = front_right
self.rear_left = rear_left
self.move_front_left = MoveLegFront(front_left)
self.move_rear_right = MoveLegRear(rear_right)
self.move_front_right = MoveLegFront(front_right)
self.move_rear_left = MoveLegRear(rear_left)
self.isMoving = False
def move(self):
self.move_front_left.start()
self.move_rear_right.start()
time.sleep(h1_moving_angle * DELAY)
self.move_front_right.start()
self.move_rear_left.start()
self.isMoving = True
def stop(self):
self.move_front_left.shutdown()
self.move_rear_right.shutdown()
self.move_front_right.shutdown()
self.move_rear_left.shutdown()
self.move_front_left.join()
self.move_rear_right.join()
self.move_front_right.join()
self.move_rear_left.join()
self.isMoving = False
self = self.__init__(self.front_left, self.front_right, self.rear_left, self.rear_right)