Ask Your Question
0

Add personal parameters at topic-subscriber callback

asked 2013-06-10 04:11:54 -0600

mateo_7_7 gravatar image

updated 2014-04-20 14:09:28 -0600

ngrennan gravatar image

Is it possible to add a personal parameter (or more than 1) at the normal subscribe function? ..(for example passing an integer that i'd like to use in the callback) how?

edit retag flag offensive close merge delete

Comments

Whats the use-case for that?

Ben_S gravatar imageBen_S ( 2013-06-10 04:17:41 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2013-06-10 04:27:24 -0600

Philip gravatar image

Hi, please see this answer for almost exactly the same use-case :-)

edit flag offensive delete link more

Comments

thanks!!! this is exactly what i need!.....but,sincerely it's not completely clear: a small explanation would be really appreciated :)

mateo_7_7 gravatar imagemateo_7_7 ( 2013-06-10 05:02:47 -0600 )edit

Glad to help! .....but,sincerely your comment is not completely clear: a small explanation of what you don't understand would be really appreciated ;-) Just have a look at boost::bind and tell us what is not clear.

Philip gravatar imagePhilip ( 2013-06-10 05:13:35 -0600 )edit

i'm not a computer scientist and so not an expert of programming stuff: i read the documentation but is not clear (at least for me). i'd like to understand what this function does and how i can use it for my purposes

mateo_7_7 gravatar imagemateo_7_7 ( 2013-06-10 05:59:58 -0600 )edit

(i have to declare n subscriber (with a for cycle for instance) that writes the data in a vector (of size n)...so i have to pass an integer to the same callback to increment the position in the vector

mateo_7_7 gravatar imagemateo_7_7 ( 2013-06-10 06:03:03 -0600 )edit

my problem is explained better here: http://answers.ros.org/question/64747/write-in-a-vector-through-the-same-ros-callback-using-boostbind-c/

mateo_7_7 gravatar imagemateo_7_7 ( 2013-06-10 22:16:55 -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

Stats

Asked: 2013-06-10 04:11:54 -0600

Seen: 6,326 times

Last updated: Jun 10 '13