Error opening file: laser.bag - Example 10.2 -

Hello everyone,

I am encountering a strange error when working with a ROS bag record. Here are the commands and output I used:

user:~/catkin_ws/src$ rosbag record -O laser.bag laser_scan
[ INFO] [1687335860.352101640]: Subscribing to laser_scan
[ INFO] [1687335860.552138606, 3893.622000000]: Recording to ‘laser.bag’.
^C

user:~/catkin_ws/src$ rosbag info laser.bag
path: laser.bag
version: 2.0
duration: 36.8s
start: Jan 01 1970 01:04:53.64 (3893.64)

user:~$ rosbag play -l laser.bag
[ INFO] [1687335953.655513254]: Opening laser.bag
[FATAL] [1687335953.737220156]: Error opening file: laser.bag

I’m not sure why I’m getting the “Error opening file” message when trying to play the bag file. Any ideas on what might be happening?

Thank you in advance for your help.

You are trying to play the bag from a different directory.

Based on this, your laser bag would be in ~/user/catkin_ws/src (/home/user/catkin_ws/src)

But here, you are trying to play it from ~ (/home/user)


Before playing the bag, change to the directory where you recorded it

cd ~/user/catkin_ws/src
rosbag play -l laser.bag

OK i am blind…
Thank you @bayodesegun

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.