Implemented fall recovery
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user