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

How to publish a message to a topic while playing rosbag? [closed]

asked 2020-01-21 01:39:53 -0500

crazyRan gravatar image

How to publish a message from a rosbag topic?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by crazyRan
close date 2020-02-19 03:16:04.784994

Comments

1

The question is unclear as

rosbag play <filename>

will playback your recorded file. if you then look at the nodes using

rosrun rqt_graph rqt_graph

will show a single rosbag node publishing all topics it recorded. Please elaborate your question.

BV_Pradeep gravatar image BV_Pradeep  ( 2020-01-21 01:51:42 -0500 )edit

It's not clear from your question what you've tried. I guass rosbag should be used for provide data. Just think it like a recorder, it remembers what happened. You could get something from it, but you couldn't send something to it. So generally, I just use rosbag as publisher.

snowman gravatar image snowman  ( 2020-01-21 09:56:05 -0500 )edit

Hi, thank you for your reply. What I want to do is that I would like to visualize a lidar data. I have two rosbag data. First, I will get the lidar data from 1st rosbag and visualize it on the 2nd rosbag. The two rosbag is running in different pc.

crazyRan gravatar image crazyRan  ( 2020-01-21 19:57:07 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-01-21 08:53:39 -0500

tryan gravatar image

It's not clear from your question what you've tried, so if this is not what you're looking for, please provide more specific information. There are two basic ways to play back topics from a rosbag file:

  1. Use rosbag play <filename> from the command line as BV_Pradeep suggested. See the wiki for more information.
  2. Use rosrun rqt_bag rqt_bag from the command line to open an interactive GUI. Open a bag file, right-click the topic you want, and check "Publish" in the menu. Then click the play button. See the wiki for more information.

The first option is more useful in general, but the second option may be good for getting started or troubleshooting certain situations.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-01-21 01:39:53 -0500

Seen: 1,023 times

Last updated: Jan 21 '20