playing ROS '.bag' files

25 ビュー (過去 30 日間)
Kyle Stanhouse
Kyle Stanhouse 2016 年 8 月 3 日
編集済み: Majid Golkhatab 2021 年 7 月 24 日
Is there a Matlab ROS library function similar to 'rosbag play'? I have some bag files that I'd like to 'play' with the objective of using the tf's to transform lidar scans etc. ... after reading the tutorials it seems that my only option seems to be to loop through the bag files and publish each message in sequence?

回答 (1 件)

Alexander
Alexander 2017 年 8 月 15 日
I don't believe there is a rosbag play or record function like ROS has. You could parse out topics with the following and then loop as you mention, but it's much easier to plot the parsed messages as a time series for instance. As an example to graph odometry as an XY plot-
rosbag(filename);
bagselect = select(bag, 'Topic', '/odom');
ts = timeseries(bagselect, 'Pose.Pose.Position.X', 'Pose.Pose.Position.Y');
plot(ts.Data(:,1), ts.Data(:,2));
A ROS style play and record would be a fantastic time saving addition to future Robotics System Toolbox versions.
  1 件のコメント
Majid Golkhatab
Majid Golkhatab 2021 年 7 月 24 日
編集済み: Majid Golkhatab 2021 年 7 月 24 日
rosbag(filename);
This code Must change to:
bag = rosbag(filename);

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeROS Bag File Logging and Analysis についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by