Implemented fall recovery

This commit is contained in:
Pavel Lutskov
2019-01-24 11:48:08 +01:00
parent 2a63147556
commit 4e8ac07a6b
5 changed files with 40 additions and 28 deletions

View File

@@ -7,6 +7,19 @@ from teleoperation.srv import InformController, InformControllerResponse
STATE = 'idle' # Also walk, imitate and fallen
def inform_controller_factory(who):
def inform_controller(what):
try:
inform_controller = rospy.ServiceProxy('inform_controller',
InformController)
perm = inform_controller(who, what).permission
except rospy.service.ServiceException:
rospy.signal_shutdown('Controller is dead')
perm = False
return perm
return inform_controller
def handle_request(r):
module = r.module
message = r.message
@@ -41,4 +54,3 @@ if __name__ == '__main__':
rospy.init_node('controller')
ic = rospy.Service('inform_controller', InformController, handle_request)
rospy.spin()
# initialize stuff