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

How to get rostopic hz average for first 5 values?

asked 2018-12-08 05:16:24 -0500

Striker gravatar image

updated 2018-12-08 11:59:58 -0500

ahendrix gravatar image

Is there a way to get the average of first values and print for rostopic hz?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-12-08 12:02:03 -0500

ahendrix gravatar image

Yes; you can use the -w option to set the number of samples that rostopic hz will use when calculating the topic frequency. The full list of command-line options for rostopic hz is documented on the rostopic wiki

edit flag offensive delete link more

Comments

When i run with rostopic hz -w 5, output does not stop. How to stop the output?

Striker gravatar image Striker  ( 2018-12-10 20:15:57 -0500 )edit

You can stop the output with Ctrl-C (same as other commands and when running rostopic hz normally)

ahendrix gravatar image ahendrix  ( 2018-12-10 23:04:49 -0500 )edit

I'm tying this in python or shell. Basically, i am looking for the 5 set of values to run and stop by itself.

Striker gravatar image Striker  ( 2018-12-11 22:18:25 -0500 )edit

If you're working in Python I'd suggest subscribing to the topic yourself and then computing whatever metrics you want directly. Then you will have full control without trying to use multiple processes and command line arguments and string parsing.

tfoote gravatar image tfoote  ( 2018-12-11 22:27:23 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-12-08 05:16:24 -0500

Seen: 1,011 times

Last updated: Dec 08 '18