Questions tagged [rosbag]

Questions addressing the rosbag-package of ROS (Robot Operating System). Use it together with the ros-tag.

Being part of the (Robot Operating System), the rosbag package is a set of tools for recording from and playing back to ROS topics. It is intended to be high performance and avoids deserialization and reserialization of the messages.

The rosbag package provides a command-line tool for working with bags as well as code APIs for reading/writing bags in C++ and Python.

48 questions
5
votes
6 answers

Importing Rosbag in Python 3

I'm trying to read rosbag files from Python 3. I installed ROS2 (Eloquent Elusor), which should support Python 3. When I run import rosbag bag = rosbag.Bag('test.bag') from Python 2.7, it works. When I try the same in Python 3, I…
Lovro
  • 712
  • 1
  • 10
  • 20
4
votes
1 answer

How to read data from rosbag2 in ros2

I am writing a program to read data from rosbag directly without playing it in ros2. Sample code snippet is below. The intention of the code is that it checks for a ros2 topic and fetches only message in that topic. I am not able to fetch the data…
confidential
  • 61
  • 1
  • 3
3
votes
1 answer

The effect of use_sim_time in ROS

I am trying to understand what effects does setting use_sim_time to true does specially when recording and playing a rosbag, but unfortunately the info is few and hard to understand. I know already how to set it to true, so that is no problem.how to…
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
2
votes
2 answers

How can I extract the frequency (in Hz) of a topic inside a rosbag?

I have a rosbag file, which has recorded messages of several topics. Is there a way I can know the frequency at which the messages of a particular topic were published (and recorded)? when I do rosbag info I get something like path: …
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
2
votes
1 answer

Timestamps taken by rosbag play (and rqt_bag) and by rosbag.Bag's read_messages() differ

There is something very strange happening with some rosbags I have. These rosbags contain messages of type sensor_msgs/Image among other topics. So I do: First scenario On one terminal I run rostopic echo /the_image/header because I am not…
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
2
votes
1 answer

Why is ROSBag record only recording ten events per second from any sensor?

The example ROSBags provided as part of Cartographer's tutorials (https://google-cartographer-ros.readthedocs.io/en/latest/demos.html) have a message frequency of about 1507 messages per second for LiDAR messages, and 250 messages per second from an…
Michael Kossin
  • 342
  • 3
  • 14
2
votes
0 answers

does rosbag play guarantee data during its playback?

I am currently working on developing ROS nodes. One node is for parsing raw lidar data which is gained from .bag file and publish to a topic, and the other node subscribes the parsed data from the first node and publish a bunch of the parsed point…
2
votes
1 answer

Is there a simple way to find the total number of frames recorded in a bag file?

I am trying to process frames in a.bag file with realsense. Is there any way to extract all the frames from this bag file without dropping most of the frames. I could not find an answer online. Here is my code to read the bag file which is based on…
Waleed
  • 39
  • 3
2
votes
2 answers

Saving PointCloud from Rosbag

I have to extract images and PCDs from a rosbag file. I'm using Python 2 and rosbag library to iterate through messages: import rosbag from cv_bridge import CvBridge bag = rosbag.Bag('test.bag') bridge = CvBridge() for topic, msg, t in…
Lovro
  • 712
  • 1
  • 10
  • 20
1
vote
0 answers

How can I use node API like spawn to run rosbag?

I want to use Node or Rust in Electron or Tauri to execute some command commands,like $ rosbag info xxxx and in Node I call rosbag with spawn function and the result is right, but when I build app, I get error const command = spawn('rosbag',…
beanBag
  • 11
  • 3
1
vote
1 answer

How to read custom message type using ros2bag

So I have this code which works great for reading messages out of predefined topics and printing it to screen. The rosbags come with a rosbag_name.db3 (sqlite) database and metadata.yaml file from rosbags.rosbag2 import Reader as ROS2Reader import…
haxonek
  • 174
  • 1
  • 2
  • 17
1
vote
0 answers

Ubuntu 18.04 LTS, ROS, Failed to load Python extention for LZ4 support. LZ4 compression will not be avilable

I'v been writing a code to extract images from bag file I don't get any error messages but this Failed to load Python extension for LZ4 support. LZ4 compression will not be available I use conda environment and my python version is 3.6.13 ros-roslib…
1
vote
1 answer

Generate a PointCloud object in Open3D from RealSense data

I'm trying to convert data captured from an Intel RealSense device into an Open3D PointCloud object that I then need to process. For the moment I only have the rosbag sample files to work with, but I think a similar procedure should be used with the…
michezio
  • 21
  • 4
1
vote
1 answer

Launching all threads at exactly the same time in C++

I have Rosbag file which contains messages on various topics, each topic has its own frequency. This data has been captured from a hardware device streaming data, and data from all topics would "reach" at the same time to be used for different…
Atharva Dubey
  • 832
  • 1
  • 8
  • 25
1
vote
0 answers

Vectorized way to loop through a ROS bag file messages

Is there a vectorized way (similar to Numpy, Pandas) to loop through bag file messages and perform computation on it ? This is currently what I do: import rosbag bag=rosbag.Bag('bag_file_name.bag') for topic,message,timestamp in…
rigidlab
  • 98
  • 4
1
2 3 4