rosbag: error: Cannot find rosbag/play executable
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? =)