ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to change publishing rate of a node to a topic? [closed]

asked 2014-12-16 03:55:40 -0600

Aarif gravatar image

updated 2014-12-23 11:37:24 -0600

hello,here are the publishing rate on the following topics:--

/odom--->Caverage rate: 5.002   min: 0.193s max: 0.210s std dev: 0.00788s window: 39
/scan--->Caverage rate: 4.997   min: 0.193s max: 0.210s std dev: 0.00782s window: 39
/tf----->Caverage rate: 40.086  min: 0.000s max: 0.112s std dev: 0.04128s window: 250

How can i increase the publishing rate on /odom and /scan topics?

I have a P3AT robot in spawned in the simulated environment (USARSim).

////////////////////////////////////////////////Question Update 1///////////////////////////////////////

hi @gvdhoorn, i have an amcl node which subscribingis to /tf from rossim at a higher rate and also publishing the /tf, to others node, i am in a problem because both nodes rossim and amcl are doing both things publishing and subscribing together, now my concern is that i suppose i remapped it like <remap from="tf" to="tf_throttle"/> then it could also change publishing topic along with its subscribing topic, please take a look on this rqt_graph which is creating problem and confusion.

My rossim Node is publishing to /tf at the rate of 40hz, i want to rossim to publish at the rate of 5hz, i used throttle but it publishing at another topic /tf_throttle at the reduced rate, now if i remap the amcl to subscribe to /tf_throttle and because publishing to the /tf also then it might also change it publishing topic and other node like rviz and move_base won't be able to get /tf data from amcl. please take a look at my rqt_graph

Thanks a lot

////////////////////////////////////////////////Question Update 2///////////////////////////////////////

hi @gvdhoorn,

  1. Here is the scenario, suppose i have a node n and two topics t1 and t2, n is a default publisher of t1 and also subscribes to this topic 't1'.

  2. Now i want that node n should subscribe to the topic t2 instead of topic t1, but at the same time i also don't want n to change its publishing topic and it should retain its default publishing topic.

How can i do it because i suspect that remapping can change both topics (publishing and subscribing) for the node n?? please suggest.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Aarif
close date 2015-01-28 21:51:58.572583

Comments

Whatever sends this topics (probably some usarsim driver node) must adjust that.

dornhege gravatar image dornhege  ( 2014-12-16 04:14:45 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-12-16 05:31:37 -0600

gvdhoorn gravatar image

updated 2014-12-16 08:20:44 -0600

Only the source of those messages can increase the publishing rate.

If the author of the node that publishes the /odom and /scan transforms has provided a configuration interface through which you can configure the publication rate, use that.

If there is no such configuration option, you'll have to change the source of the node(s) in question.


Edit: note that decreasing message rate is possible without changing the publisher. This is known as throttling, and can be done using the topic_tools/throttle node.

edit flag offensive delete link more

Comments

1

@gvdhoorn converted this to answer as it gives instructions on how to proceed.

dornhege gravatar image dornhege  ( 2014-12-16 07:28:34 -0600 )edit

Ok. I'll update it a bit then.

gvdhoorn gravatar image gvdhoorn  ( 2014-12-16 08:17:35 -0600 )edit

hi @gvdhoorn, i have gone through your solution, throttle and drop is doing good but they are publishing on another topic at modified publishing rate, but i want to publish on the same topic, is there any trick so that i can do so.

Thanks for looking into it. :)

Aarif gravatar image Aarif  ( 2014-12-17 10:23:03 -0600 )edit
1

You want to look at remapping. It works for subscribers as well.

Note btw that topic_tools nodes cannot increase the publication rate of their input.

gvdhoorn gravatar image gvdhoorn  ( 2014-12-18 01:53:07 -0600 )edit

hi @gvdhoorn, i have update my question and described it more please take a look on that..

Aarif gravatar image Aarif  ( 2014-12-19 12:02:43 -0600 )edit

hi @gvdhoorn, please take a look on this too, here is what i am doing because of that i am getting this publishing rate problem.

Aarif gravatar image Aarif  ( 2014-12-19 12:04:11 -0600 )edit

If I understand you correctly, you could probably have amcl publish on /tf_amcl (using remapping), then (again using remapping) have the throttle node subscribe to /tf_amcl and publish on /tf.

gvdhoorn gravatar image gvdhoorn  ( 2014-12-22 01:52:11 -0600 )edit

hi @gvdhoorn, i am really very sorry for inconvenience, i have updated my question again and make it more precise, please take a look on that.

Thank you.

Aarif gravatar image Aarif  ( 2014-12-23 11:38:58 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-12-16 03:55:40 -0600

Seen: 3,526 times

Last updated: Dec 23 '14