On Fri, Apr 27, 2012 at 5:24 AM, email@example.com <firstname.lastname@example.org> wrote: > Hi all,
> it is a simple question but I see that there is no topic on it. I have a topic
> on which a publisher is publishing data (string) with a queue of 10 messages.
> On the other side, I want to subscribe it through a subscriber (with queue 5).
> Is there a way to get all messages (or at least the first 5) published on this
> topic? I tried with a callback function of the subscriber taking a vector with
> no results.
> I succeed to do it saving a vector and using the push_back function whenever
> the callback is invoked. I don't like so much this solution since if other
> methods invokes the spinOnce then the same data are saved on the vector....is
> there a smarter way?
> Thanks a lot for any answer,
This is a good question for answers.ros.org, please ask it there.