No module named 'roslib' when convert .bag to .mp4

huangapple go评论45阅读模式
英文:

No module named 'roslib' when convert .bag to .mp4

问题

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

我使用Intel RealSense深度相机D435i录制了一些视频,将它们导出为.bag文件,然后尝试将它们转换为.mp4。

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

我刚刚发现了一个GitHub仓库,其中有一个类似的项目,叫做rosbag2video。

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

然而,当我安装了它所需的依赖项并运行脚本时,我遇到了一个错误ModuleNotFoundError: No module named 'roslib'

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

我确实尝试遵循博客上的指南,即在Ubuntu 22.04上安装ROS2,并没有出现错误。

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

当我运行python rosbag2video.py location1.bag时,仍然存在相同的问题。

My system info will be:

我的系统信息如下:

Distributor ID: Ubuntu

发行商标识:Ubuntu

Description: Ubuntu 22.04.2 LTS

描述:Ubuntu 22.04.2 LTS

Release: 22.04

版本:22.04

Codename: jammy

代号:jammy

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

=================== 更新 ===================

I discover one possible reason from rospy/Troubleshooting.

我从rospy/Troubleshooting中发现了一个可能的原因。

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

这可能意味着你的PYTHONPATH没有配置正确。请确保你的PYTHONPATH包括$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?

根据博客上的指南,当我执行echo "source /opt/ros/humble/setup.bash" >> ~/.bashrcsource ~/.bashrc时,是否应该完成这个操作?

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

由于按照上述博客的指南安装ROS2时没有出现错误,更新部分仅供参考。

英文:

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.

答案1

得分: 0

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

英文:

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

答案2

得分: 0

roslib是一个包含ROS1支持包的模块,不适用于ROS2。这是GitHub上代码的错误,您只需删除rosbag2video.py的第14行即可修复。您还需要删除该文件中包含的所有其他ROS1依赖项。

英文:

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. You will also need to remove all other ROS1 dependencies included in that file as well.

huangapple
  • 本文由 发表于 2023年5月10日 14:36:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/76215516.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定