Go to the documentation of this file.00001
00002
00003 import rospy
00004
00005 class NoDefault:
00006 pass
00007
00008 def get_interface_parameter(interface, name, default = NoDefault):
00009 try:
00010 return rospy.get_param("~interfaces/%s/%s"%(interface, name))
00011 except KeyError:
00012 pass
00013
00014 try:
00015 return rospy.get_param("~default/%s"%name)
00016 except KeyError:
00017 pass
00018
00019 if default is not NoDefault:
00020 return default
00021
00022 raise KeyError("Could not find parameter %s for interface %s."%(interface, parameter))
00023
00024 def get_parameter(name, default = NoDefault):
00025 try:
00026 return rospy.get_param("~%s"%name)
00027 except:
00028 if default is not NoDefault:
00029 return default
00030
00031 raise KeyError("Could not find parameter %s."%name)