Ask Your Question

response of a server in python

asked 2011-07-10 09:34:14 -0500

Gauss Lee gravatar image

updated 2012-02-27 07:37:31 -0500

kwc gravatar image

Hi, everybody,

I have a simple question. If I have more than 2 responses in the srv file. How Can I use them in python code. How to use the servicenameResponse() function?



edit retag flag offensive close merge delete


Can you give an example what you mean with "more than 2 responses". A service consists of 1 request and 1 response per srv file.
dornhege gravatar image dornhege  ( 2011-07-10 12:12:21 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2011-07-10 16:25:12 -0500

fergs gravatar image

Posting your actual .srv file would help, but I think you just have a bit of terminology issues. If you have two lines in your response section of the service definition, you would have two fields in the response message. For instance, if servicename.srv is:

int8 someRequestStuff
int8 firstThingToReturn
int8 secondThingToReturn

In this case, you could:

resp = servicenameResponse()
resp.firstThingToReturn = 1
resp.secondThingToReturn = 2
return resp
edit flag offensive delete link more

answered 2012-06-03 16:00:35 -0500

malong gravatar image

i have edit this problem ,all the clod are here may it help you

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2011-07-10 09:34:14 -0500

Seen: 3,247 times

Last updated: Jun 03 '12