Ask Your Question
0

How to send a vector with Service Client Communication?

asked 2018-06-05 03:48:28 -0600

Developer gravatar image

Hi

How can I send a hole vector in once(not one by one of each entries) from client to the service ? is it possible?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-06-05 06:03:59 -0600

Yes this is possible.

You can define a variable in a service or message definition as a vector by adding empty square brackets after the type, eg:

int32[] myVectorOfInts

So in your case to send a vector of values to a service provider from the client your service definition could look something like this:

string singleVariable
int32[] vectorOfIntegers
std_msgs/ColorRGBA[] vectorOfAnotherMessage
---
int32 variableReturnedToClient

Hope this helps.

edit flag offensive delete link more

Comments

Thanks! it helped

Developer gravatar imageDeveloper ( 2018-06-05 06:39:26 -0600 )edit

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-06-05 03:48:28 -0600

Seen: 39 times

Last updated: Jun 05 '18