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

Adjust robot_state_publisher publish frequency

asked 2019-11-05 10:59:14 -0500

Weasfas gravatar image

updated 2019-11-06 07:31:58 -0500

Hello,

I was working with my URDF model and the robot_state_publisher and I noticed that: for the fixed joints, the tf is computed at the beginning and has no associated publish rate (in the rqt tf_tree plugin it is displayed 10000), however when I look at the other joints the frequency displayed varies depending on RST.

My question is, there is a way to adjust the robot_state_publisher publish frequency to avoid the shatter showed in the following video:

TF problem

I tried to adjust the publish_frequency in the robot _state_publisher node, but with no avail, because the average rate of the joints tf is the same no matter what frequency I pass as a parameter.

Thanks.

Edit:

Testing different things I have noticed that this issue is related to the way I launch files. I mean, when only the description (with the RST and JSP) is launched, the publish frequency is not correct, while when I launch gazebo with the same set up (but with no JSP) the average publish frequency is the one I requested.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-11-08 02:30:33 -0500

Weasfas gravatar image

I just solved the issue by adjusting the rate in the joint_state_publisher node. Actually, was that node the one delaying the system publish rate.

Adding this solved the issue:

<node unless="$(arg sim)" name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
  <param name="rate" value="50" />
</node>

Thanks for the help.

edit flag offensive delete link more
2

answered 2019-11-06 02:34:34 -0500

Choco93 gravatar image

You can set the publish frequency as specified in parameters for robot_state_publisher.

edit flag offensive delete link more

Comments

Hi @Choco93,

As I said in my question, it does not matter what value I assigned to the publish_frequency in robot_state_publisher node. Besides, the default value is 50 Hz and my tfs are not being published at that rate but at 11 Hz.

Weasfas gravatar image Weasfas  ( 2019-11-06 07:25:41 -0500 )edit

Sorry I misunderstood your question. The other joints you are talking about, where are they coming from? Are you publishing them yourself?

Choco93 gravatar image Choco93  ( 2019-11-06 07:41:31 -0500 )edit

No problem.

I have the following set ups:

  1. Use Gazebo with the URDF model (Xacro + robot_state_publisher) to test several packages being implemented.

  2. When I want to deploy the final version of the packages I test them in the real vehicle and I launch all vehicle related stuff + the description (Xacro + robot_state_publisher and joint_state_publisher).

In the first setup I received the tf (looking at the tf_tree) of all static joints with 10000 Hz and all non fixed joints (wheels for instance) with 50 Hz (the default value provided by the robot_state_publisher).

However, in the second set up I have the same rate for the fixed joints but 11 Hz for the non fixed no matter what parameter value I pass to the launch of the RST node.

Weasfas gravatar image Weasfas  ( 2019-11-06 10:34:10 -0500 )edit

Are both of your setups same? Running same nodes? Any hardware difference?

Choco93 gravatar image Choco93  ( 2019-11-07 01:37:50 -0500 )edit

The only difference is that, in the real platform, all drivers for lidars, imu and GPS are launched together with the wheel odometry computed form the CAN.

Because the rest of the set up is the same, map_server, amcl etc.

Weasfas gravatar image Weasfas  ( 2019-11-07 02:55:26 -0500 )edit

I am at loss here, only thing I can think of is probably your hardware is causing delay somehow.

Choco93 gravatar image Choco93  ( 2019-11-08 01:11:08 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-11-05 10:59:14 -0500

Seen: 11,274 times

Last updated: Nov 08 '19