【问题标题】:How can I extract the frequency (in Hz) of a topic inside a rosbag?如何提取 rosbag 中主题的频率(以 Hz 为单位)?
【发布时间】:2021-11-05 17:17:30
【问题描述】:

我有一个rosbag文件,里面记录了几个topic的消息。

有没有办法可以知道特定主题的消息发布(和记录)的频率?

当我做 rosbag info 时,我得到类似的东西

path:        the.bag
version:     2.0
duration:    60.0s
start:       Jul 01 2021 16:58:10.27 (1625158690.27)
end:         Jul 01 2021 16:59:10.27 (1625158750.27)
size:        6.1 GB
messages:    37131
compression: none [1188/1188 chunks]
types:       sensing_msgs/type1    [621fdfebbc8899ba27ee5fed4fcccaee]
             sensing_msgs/type2 [cf69c51b4a51518b0ef7e36af744fc70]
             sensor_msgs/Image       [060021388200f6f0f447d0fcd9c64743]
topics:      /mycamera/image         1187 msgs    : sensor_msgs/Image      
             /mymessage1            29944 msgs    : sensing_msgs/type1
             /mymessage2/input       6000 msgs    : sensing_msgs/type2

【问题讨论】:

    标签: ros frequency rosbag


    【解决方案1】:

    如果您知道消息发布在整个录制频率中是连续的,则为total_messages / time。否则你可以通过rosbag play <bag_file>rostopic hz <topic_name>获得频率

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-19
      • 2018-10-02
      • 1970-01-01
      • 2021-11-15
      • 2012-07-26
      • 2021-03-16
      • 1970-01-01
      • 2019-08-14
      相关资源
      最近更新 更多