more stable implementation of speech stuff

This commit is contained in:
Pavel Lutskov
2019-02-02 13:38:35 +01:00
parent 3217b7f841
commit 655c5418fd
7 changed files with 77 additions and 279 deletions

View File

@@ -21,8 +21,8 @@ VMIN = 0.3
VMAX = 1.0
def thirdway(a, b):
return a + (b - a) / 3
def n_way(a, b, n=3):
return a + (b - a) / n
def global_init():
@@ -32,12 +32,12 @@ def global_init():
x = json.load(f)
cx, cy, cz = x['cr']
FW = thirdway(cx, x['fw']), x['fw']
BK = thirdway(cx, x['bk']), x['bk']
LT = thirdway(cy, x['lt']), x['lt']
RT = thirdway(cy, x['rt']), x['rt']
LR = thirdway(cz, x['lr']), x['lr']
RR = thirdway(cz, x['rr']), x['rr']
FW = n_way(cx, x['fw']), x['fw']
BK = n_way(cx, x['bk']), x['bk']
LT = n_way(cy, x['lt']), x['lt']
RT = n_way(cy, x['rt']), x['rt']
LR = n_way(cz, x['lr'], 2), x['lr']
RR = n_way(cz, x['rr'], 2), x['rr']
_inform_controller = inform_controller_factory('walker')
@@ -96,7 +96,8 @@ if __name__ == '__main__':
if not any(movement):
rospy.logdebug('WALKER: STOP')
_inform_controller('stop')
mp.move(0, 0, 0)
# mp.move(0, 0, 0)
mp.stopMove()
continue
permission = _inform_controller('move')