Ask Your Question
0

Is there a way to record a single message?

asked 2021-07-28 10:32:29 -0500

Kansai gravatar image

I know that if I have a node that publishes messages (in particular Image messages) I can record these messages with rosbag record into a rosbag.

My question is, if I have a single ros message (in my case an Image) can I somehow record this single message? (in a file perhaps?)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2021-07-28 15:12:53 -0500

Mike Scheutzow gravatar image

The command rosbag record -h will output a description of the optional arguments. Take a look at the one called --limit.

edit flag offensive delete link more
0

answered 2021-07-28 10:46:08 -0500

Ranjit Kathiriya gravatar image

updated 2021-07-29 05:44:48 -0500

Hello Kansai,

I know that if I have a node that publishes messages (in particular Image messages) I can record these messages with rosbag record into a rosbag.

Yes, you can record the image message through ros bag file. You can do so by the following the command. Even the message is single I think it can record it.

rosbag record -o subset <Topic-Name-Image>

And if you want to record multiple topic then you can

rosbag record -o subset <topic-name-image 1=""> <topic-name-image 2="">

The -O argument tells rosbag record to log to a file named subset.bag.

Play back recording with:

rosbag play <bagfile-name>

You can check your recording in Rviz just by subscribing to your recording node.

For exporting single image here is a good document http://wiki.ros.org/rosbag/Tutorials/...

edit flag offensive delete link more

Comments

1

That was an interesting tutorial. I didn't know that existed and I actually programmed the extraction of images from bags myself. Thanks

Kansai gravatar image Kansai  ( 2021-07-29 05:31:58 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-07-28 10:32:29 -0500

Seen: 59 times

Last updated: Jul 29