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

rosbag: error: Cannot find rosbag/play executable

asked 2022-02-21 17:43:45 -0500

Marcelino Almeida gravatar image

updated 2022-02-21 17:49:24 -0500

I am running ROS Noetic on Ubuntu 20.04.3 LTS.

I cannot run rosbag play or rosbag record. It was working perfectly last week, but it ceased to work this week. I have tried reinstalling using apt install ros-noetic-rosbag, but that didn't help. The weird thing is rosbag check and rosbag info work pretty well:

rosbag check flight_2022_02_21_23_02_03.bag
Bag file does not need any migrations.

I have suppressed the topic names from rosbag info so this thread isn't too long, but this is the header in it:

rosbag info flight_2022_02_21_23_02_03.bag
path:         flight_2022_02_21_23_02_03.bag
version:      2.0
duration:     1:15s (75s)
start:        Feb 21 2022 17:02:40.34 (1645484560.34)
end:          Feb 21 2022 17:03:56.02 (1645484636.02)
size:         9.9 MB
messages:     90332
compression:  bz2 [101/101 chunks; 10.04%]
uncompressed: 82.3 MB @   1.1 MB/s
compressed:    8.3 MB @ 111.8 KB/s (10.04%)

The following happens when I try rosbag record or rosbag play:

Record:

rosbag record -a -O example.bag
Usage: rosbag record TOPIC1 [TOPIC2 TOPIC3 ...]

rosbag: error: Cannot find rosbag/record executable

Play:

rosbag play flight_2022_02_21_23_02_03.bag
Usage: rosbag play BAGFILE1 [BAGFILE2 BAGFILE3 ...]

rosbag: error: Cannot find rosbag/play executable

I know that the problem isn't with the bag, as a coworker was able to play that same bag. I also tried other bags that I could play before, but I can't play any bags whatsoever now. I have noticed that the error was once observed by one user, but there was no solution anywhere that I could find (that user was supposed to open a question in this forum, but I wasn't able to find one).

Here is what I get from the following commands:

Find rosbag:

find /opt/ros/noetic/lib/rosbag
/opt/ros/noetic/lib/rosbag
/opt/ros/noetic/lib/rosbag/record
/opt/ros/noetic/lib/rosbag/fixbag_batch.py
/opt/ros/noetic/lib/rosbag/bagsort.py
/opt/ros/noetic/lib/rosbag/encrypt
/opt/ros/noetic/lib/rosbag/fastrebag.py
/opt/ros/noetic/lib/rosbag/play
/opt/ros/noetic/lib/rosbag/fix_moved_messages.py
/opt/ros/noetic/lib/rosbag/topic_renamer.py
/opt/ros/noetic/lib/rosbag/savemsg.py
/opt/ros/noetic/lib/rosbag/makerule.py
/opt/ros/noetic/lib/rosbag/fix_msg_defs.py
/opt/ros/noetic/lib/rosbag/fix_md5sums.py
/opt/ros/noetic/lib/rosbag/fixbag.py
/opt/ros/noetic/lib/rosbag/bag2png.py

Rospack find:

rospack find rosbag
/home/marcelino/catkin_ws/src/ros_comm/tools/rosbag

Any ideas in how I can fix this without having to format my laptop? =)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-21 17:53:08 -0500

Marcelino Almeida gravatar image

I was just able to find the solution, and I hope this will help others in the future. The issue is that I had ros_comm in my catkin workspace, but rosbag wasn't built. I just went to my catkin workspace, ran catkin build rosbag, then I was back in business

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-02-21 17:43:45 -0500

Seen: 523 times

Last updated: Feb 21 '22