ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

tf broadcasting rate

asked 2017-07-02 11:03:51 -0500

alonsheader gravatar image

updated 2017-07-02 12:11:21 -0500

gvdhoorn gravatar image


im trying to increase the rate of which tf transform is being published it seems that no matter what i do the rate stays 1 hz even if cout prints at 10 hz, when i tf_echo the transform it still appears to be published at 1 hz i didnt find in ROS ANSWER any documentation about that


#include <ros/ros.h>
#include <iostream>
#include <tf/transform_broadcaster.h>

int main(int argc, char** argv){
  ros::init(argc, argv, "tfpub");
  ros::NodeHandle n;

  ros::Rate r(10.0);

  tf::TransformBroadcaster broadcaster;

        tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0.1, 0.0, 0.2)),
        ros::Time::now(),"map", "odom"));
    std::cout<< ros::Time::now() <<std::endl;

edit retag flag offensive close merge delete


This probably won't fix the issue, but put the ros::spinOnce(); call before the r.sleep(); call. You should never have anything after a Rate.sleep() call as this messes with loop timing.

ufr3c_tjc gravatar image ufr3c_tjc  ( 2017-07-02 18:11:46 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-07-02 18:33:04 -0500

tfoote gravatar image

The rate at which tf_echo prints to the screen is a command line argument and does not reflect the underlying message rates.

If you want to determine the rate of publishing you should use tf_monitor. There's a tutorial on debugging.

edit flag offensive delete link more


Totally agree. The correct way to view the rate is actually using view_frames tool

DavidN gravatar image DavidN  ( 2017-07-02 20:59:54 -0500 )edit

thank you!

alonsheader gravatar image alonsheader  ( 2017-07-03 02:44:42 -0500 )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



Asked: 2017-07-02 11:03:51 -0500

Seen: 1,999 times

Last updated: Jul 02 '17