Ask Your Question
0

rate of subscribing

asked 2014-04-16 19:59:29 -0600

ad26kr gravatar image

can i change the rate of subscribing or publishing?

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
1

answered 2014-04-27 11:36:37 -0600

topic_tools/throttle can subscribe to a topic and republish it at a different rate or bandwidth. I don't think there's a way to do it directly in a subscriber.

edit flag offensive delete link more
0

answered 2014-07-13 21:08:55 -0600

mechanicalmanb gravatar image

You can use a client/server node pair (and a queue/buffer in the server node) to avoid lag build up. For example, if you are gathering camera images in a node and publishing them slightly faster than a subscriber node can display them, lag will build up over time. Take this difference to an extreme and it is essentially how a high speed camera is used. If you implement the client/server + queue, the node collecting camera images will still gather frames faster than the display node can show them, but you can pick keyframes out of the queue to eliminate any lag up to that point.

I was unaware of the topic_tools/throttle solution. That sounds like it would accomplish what I described above, but you would need to know a priori the processing rate of the display node, right?

edit flag offensive delete link more
0

answered 2014-04-26 21:33:56 -0600

adreno gravatar image

You can use the ros::Rate to specify the frequency that you would like to loop at

edit flag offensive delete link more

Comments

I know how to use ros::Rate to control the loop of publisher , but for subscriber, how to implement it?

sxin gravatar imagesxin ( 2016-02-03 09:34:33 -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

1 follower

Stats

Asked: 2014-04-16 19:59:29 -0600

Seen: 595 times

Last updated: Jul 13 '14