skip to Main Content

I used Intel RealSense Depth Camera D435i to record some videos, exported them as a .bag file and try to convert them into .mp4.

I just found a GitHub repo that has done a similar thing called rosbag2video.

However, when I installed the dependencies it required and run the script, I got an error ModuleNotFoundError: No module named 'roslib'

I did try to follow the blog which is Installing ROS2 on Ubuntu 22.04 with no error emerged.

When I run python rosbag2video.py location1.bag, it still contains the same problems.

My system info will be:

Distributor ID: Ubuntu

Description: Ubuntu 22.04.2 LTS

Release: 22.04

Codename: jammy

=================== Update ===================

I discover one possible reason from rospy/Troubleshooting.

This probably means that your PYTHONPATH is not configured. Please make sure that your PYTHONPATH includes $ROS_ROOT/core/roslib/src.

It should be done when i
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc and source ~/.bashrc according to the blog?

Since no error emerge when installing ROS2 according the blog above, the update section is for reference only.

2

Answers


  1. The ModuleNotFoundError is thrown by python interpreter. You can use pip install roslibpy to install roslib module in python. This might solve your ModuleNotFoundError.

    Login or Signup to reply.
  2. roslib is a module that contains ROS1 support packages and does not exist for ROS2. This is an error in the code on GitHub and you can fix it by simply removing line 14 of rosbag2video.py

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search