Interaction of the walker module and main control

This commit is contained in:
Pavel Lutskov
2019-01-17 17:30:43 +01:00
parent fe09cce493
commit 171d3c49ff
6 changed files with 91 additions and 33 deletions

View File

@@ -2,19 +2,27 @@
import os
from time import sleep
from naoqi import ALProxy
import rospy
import tf
from naoqi import ALProxy
FW = -0.30
from teleoperation.srv import InformController
FW = -0.32
BK = -0.55
LT = -0.55
RT = 0.0
def _inform_controller(what):
inform_controller = rospy.ServiceProxy('inform_controller',
InformController)
return inform_controller('walker', what).permission
if __name__ == '__main__':
rospy.init_node('walker')
rospy.wait_for_service('inform_controller')
ll = tf.TransformListener()
mp = ALProxy('ALMotion', os.environ['NAO_IP'], 9559)
mp.wakeUp()
@@ -28,18 +36,22 @@ if __name__ == '__main__':
rospy.Time(0))
except Exception as e:
mp.stopMove()
# inform_controller('walker', 'stop')
_inform_controller('stop')
continue
print trans
print trans, rot
# continue
if BK < trans[2] < FW and LT < trans[0] < RT:
if (
BK < trans[2] < FW and
LT < trans[0] < RT
# CW < trans[1] < CC
):
mp.move(0, 0, 0)
# inform_controller('walker', 'stop')
_inform_controller('stop')
continue
permission = True
# permission = inform_controller('walker', 'move')
permission = _inform_controller('move')
if not permission:
mp.stopMove()
continue