DOCUMENT IT

This commit is contained in:
2019-02-25 21:00:42 +01:00
parent c987f7362b
commit fbb09ebf8f
9 changed files with 136 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
#! /usr/bin/env python
"""A module for graceful fall handling."""
import os
import rospy
@@ -15,6 +16,7 @@ _inform_masterloop = inform_masterloop_factory('fall_detector')
class FallDetectorModule(ALModule):
"""An ALModule responsible for fall handling."""
def __init__(self, name):
ALModule.__init__(self, name)
@@ -23,7 +25,7 @@ class FallDetectorModule(ALModule):
_inform_masterloop('falling')
def on_robot_fallen(self, *_args):
if not _inform_masterloop('fallen'):
if not _inform_masterloop('fallen'): # Seize the control
return
mp.rest()
rospy.Rate(0.5).sleep()
@@ -32,9 +34,10 @@ class FallDetectorModule(ALModule):
am.setExpressiveListeningEnabled(False)
pp = ALProxy('ALRobotPosture')
while not pp.goToPosture('StandInit', 1.0):
# Try to stand up indefinetely
pass
rospy.Rate(1).sleep()
_inform_masterloop('recovered')
_inform_masterloop('recovered') # Release the control
if __name__ == "__main__":