# Reducing the publishing rate of a topic from RosLaunch

Hi there,

I have a custom-built robot which I am trying to control with move_it. I have written the urdf and generated the srdf using the move_it setup assistant. All the topics from my URDF are being broadcast on tf links at 30Hz based on a sensor_msgs/JointState node I wrote. I am trying to link the base of my robot to the vicon /world coodinate frame (I am using the vicon_bridge package ). For some reason, I find that the frames being broadcast by vicon are crazily high (to the order of 200 - 400Hz) and as a result, move_it is not updating the tf transforms because of errors such as the following:

ERROR] [1477965797.682768512]: Transform error: Lookup would require extrapolation into the future. Requested time 1477965797.631547473 but the latest data is at time 1477965797.626859796, when looking up transform from frame [headnball_link] to frame [world] 

My tf view_frames is given by the attachment in the link http://tinypic.com/r/23uwtmo/9 . Is there a way to specify the publish limit to a nodefrom within a roslaunch file?

edit retag close merge delete

Sort by » oldest newest most voted

You can use throttle from the topictools. This is a node that subscribes to a topic and republishes at a defined rate. You can use remap to make your vicon node to publish e.g. at /tf_superfast and let the throttle subscribe to this and republish on /tf.

more

Thank you. Exactly what I needed.

( 2016-11-01 11:02:11 -0500 )edit

It sounds like your actual issue in how you're doing your TF or time synchronization between the vicon system and ROS. 200-400hz is definitely doable by ROS, I have some applications running at 2kHz

more

You can pass args to nodes from a roslaunch file, even while specifying the same arg as when roslaunching it. You can then read in the args from the node and use that to set the ROS topic publisher frequency.

more

My prblem is not so much as not knowing that I could do what you have suggested. I am actually doing that. The thing is that vicon publishes at a rate that is too fast. Limiting the rate within my note via ros::Rate sleep command doesn't seem to be helping.

( 2016-10-31 23:33:28 -0500 )edit

Commonly, you can set the publish_frequency of robot_state_publisher:

  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="true" output="screen" >
<param name="publish_frequency" value="10" />
</node>

more