rosservice: allow dictionary as main argument, though prefer list
This commit is contained in:
parent
f82ce3bb84
commit
d8b2ec8f39
|
@ -334,6 +334,11 @@ def call_service(service_name, service_args, service_class=None):
|
|||
request = service_class._request_class()
|
||||
try:
|
||||
roslib.message.fill_message_args(request, service_args)
|
||||
except roslib.message.ROSMessageException:
|
||||
# check to see if we have a single, dictionary argument instead
|
||||
if len(service_args) == 1 and type(service_args[0]) == dict:
|
||||
try:
|
||||
roslib.message.fill_message_args(request, service_args[0])
|
||||
except roslib.message.ROSMessageException:
|
||||
raise ROSServiceException("Not enough arguments to call service.\n"+\
|
||||
"Args are: [%s]"%roslib.message.get_printable_message_args(request))
|
||||
|
|
Loading…
Reference in New Issue