can switch between autoimitation and voice mode

This commit is contained in:
Pavel Lutskov
2019-02-02 16:37:40 +01:00
parent f118be8cf2
commit 4335d39aaf
2 changed files with 74 additions and 43 deletions

View File

@@ -1,6 +1,5 @@
#! /usr/bin/env python
import os
from time import sleep
import rospy
from naoqi import ALProxy, ALBroker, ALModule
@@ -11,6 +10,7 @@ from controller import inform_controller_factory
fall_broker = None
almem = None
_inform_controller = inform_controller_factory('fall_detector')
@@ -27,12 +27,12 @@ class FallDetectorModule(ALModule):
if not _inform_controller('fallen'):
return
self.mp.rest()
sleep(2)
rospy.Rate(0.5).sleep()
self.mp.wakeUp()
pp = ALProxy('ALRobotPosture')
while not pp.goToPosture('StandInit', 1.0):
pass
sleep(1)
rospy.Rate(1).sleep()
_inform_controller('recovered')
@@ -51,6 +51,6 @@ if __name__ == "__main__":
"on_robot_fallen")
while not rospy.is_shutdown():
sleep(0.1)
rospy.Rate(10).sleep()
fall_broker.shutdown()