From 4aeda24f8cff34c9d84aa70399f1db99bce09a77 Mon Sep 17 00:00:00 2001 From: Felip Marti Date: Sat, 28 Apr 2018 15:19:40 +1000 Subject: [PATCH] [nao_apps] Exit if no proxy connection established: nao_alife.py nao_behaviors.py nao_leds.py --- nao_apps/nodes/nao_alife.py | 2 ++ nao_apps/nodes/nao_behaviors.py | 2 ++ nao_apps/nodes/nao_leds.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/nao_apps/nodes/nao_alife.py b/nao_apps/nodes/nao_alife.py index bbab534..434997b 100755 --- a/nao_apps/nodes/nao_alife.py +++ b/nao_apps/nodes/nao_alife.py @@ -53,6 +53,8 @@ def __init__( self ): #Proxy to interface with LEDs self.proxy = self.get_proxy( "ALAutonomousLife" ) + if self.proxy is None: + exit(1) # Register ROS services self.disabled_srv = rospy.Service("~disabled", Empty, self.disabled ) diff --git a/nao_apps/nodes/nao_behaviors.py b/nao_apps/nodes/nao_behaviors.py index 1b2c01a..d3b3adc 100755 --- a/nao_apps/nodes/nao_behaviors.py +++ b/nao_apps/nodes/nao_behaviors.py @@ -60,6 +60,8 @@ def __init__( self ): #Proxy for listingBehaviors and stopping them self.behaviorProxy = self.get_proxy( "ALBehaviorManager" ) + if self.behaviorProxy is None: + exit(1) # Register ROS services self.getInstalledBehaviorsService = rospy.Service( diff --git a/nao_apps/nodes/nao_leds.py b/nao_apps/nodes/nao_leds.py index 2214383..8e7ac59 100755 --- a/nao_apps/nodes/nao_leds.py +++ b/nao_apps/nodes/nao_leds.py @@ -58,6 +58,8 @@ def __init__( self ): #Proxy to interface with LEDs self.proxy = self.get_proxy( "ALLeds" ) + if self.proxy is None: + exit(1) #Seed python's random number generator random.seed( rospy.Time.now().to_nsec() )