mlaiacker / rosbag2video

converts image sequence in ros bag files to video files
GNU General Public License v2.0
313 stars 111 forks source link

dependencies not found #17

Closed mhudnell closed 1 month ago

mhudnell commented 4 years ago

Running $ sudo apt install python3-roslib python3-sensor-msgs python3-opencv outputs:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-roslib
E: Unable to locate package python3-sensor-msgs

I'm relatively new to ubuntu, do I need to add to apt source list to install these? How do I do that?

cardboardcode commented 3 years ago

@mhudnell

Solution

To resolve this issue, run the following installation commands:

sudo apt-get update
sudo apt-get install python3-roslib python3-sensor-msgs

If it is still unable to locate the packages, please state what Ubuntu OS version you are currently using. You can find that out by running the command below:

lsb_release -a
mlaiacker commented 3 years ago

Thanks for the help with the issues!

bensort commented 3 years ago

I have the same problem with this bro,and my output is lsb_release -a: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial

can you help me?thank you!

cardboardcode commented 3 years ago

hi @bensort,

Please go to Software & Updates in your Ubuntu Operating System and ensure the following configurations have been set, like so: Screenshot from 2021-05-27 17-03-32

Once done, open a terminal and run the following commands:

sudo apt-get update
sudo apt-get install python3-roslib python3-sensor-msgs

If this still does not work, it could be because these packages are no longer available specifically to Ubuntu 16.04. Our script has only been verified to be able to run on Ubuntu 20.04.

bensort commented 3 years ago

hi @bensort,

Please go to Software & Updates in your Ubuntu Operating System and ensure the following configurations have been set, like so: Screenshot from 2021-05-27 17-03-32

Once done, open a terminal and run the following commands:

sudo apt-get update
sudo apt-get install python3-roslib python3-sensor-msgs

If this still does not work, it could be because these packages are no longer available specifically to Ubuntu 16.04. Our script has only been verified to be able to run on Ubuntu 20.04.

hi @cardboardcode : I tried it again,and does not installed these dependece,the script can run normally,but it does not seems like to support JPEG encode. Terminal output like this:

############# COMPRESSED IMAGE ###################### ('video/axis_unit1_cam2', ' with datatype:', 'sensor_msgs/CompressedImage') () ('unsupported jpeg format:', 'jpeg', '.', 'video/axis_unit1_cam3') ('unsupported jpeg format:', 'jpeg', '.', 'video/axis_unit1_cam1') ('unsupported jpeg format:', 'jpeg', '.', 'video/axis_unit1_cam1') ('unsupported jpeg format:', 'jpeg', '.', 'video/axis_unit1_cam1') finished

bensort commented 3 years ago

hi @bensort,

Please go to Software & Updates in your Ubuntu Operating System and ensure the following configurations have been set, like so: Screenshot from 2021-05-27 17-03-32

Once done, open a terminal and run the following commands:

sudo apt-get update
sudo apt-get install python3-roslib python3-sensor-msgs

If this still does not work, it could be because these packages are no longer available specifically to Ubuntu 16.04. Our script has only been verified to be able to run on Ubuntu 20.04.

hi @cardboardcode, When I use python2 to run this script, no error is reported, but when I use python3, an error will be reported,does it Necessary to use python3? Thank you for your kind reply!

cardboardcode commented 3 years ago

Hi @bensort

Hmm... That's weird. The script specifies python3, as shown by the shebang defined in the header of the script. Not sure why it is able to use python2...

Is the error produced when using python3 the one below?

############# COMPRESSED IMAGE ######################
('video/axis_unit1_cam2', ' with datatype:', 'sensor_msgs/CompressedImage')
()
('unsupported jpeg format:', 'jpeg', '.', 'video/axis_unit1_cam3')
('unsupported jpeg format:', 'jpeg', '.', 'video/axis_unit1_cam1')
('unsupported jpeg format:', 'jpeg', '.', 'video/axis_unit1_cam1')
('unsupported jpeg format:', 'jpeg', '.', 'video/axis_unit1_cam1')

For now, as long as it works properly in python2, you can just continue using python2.

bensort commented 3 years ago

importerror produced when i using python3,like this below: Traceback (most recent call last): File "/home/qin/download/rosbag2video-master/rosbag2video.py", line 13, in <module> import roslib ImportError: No module named 'roslib'

wangzizhe commented 3 years ago

@cardboardcode @bensort @mhudnell

Hi, everyone, I have the same problem. The solution above doesn't work. Is there any update to this issue? Did you find the a solution?

No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.5 LTS Release: 18.04 Codename: bionic

bensort commented 3 years ago

Zizhe Wang @.***>于2021年7月5日 周一22:46写道:

@cardboardcode https://github.com/cardboardcode @bensort https://github.com/bensort @mhudnell https://github.com/mhudnell

Hi, everyone, I have the same problem. The solution above doesn't work. Is there any update to this issue? Did you find the a solution?

No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.5 LTS Release: 18.04 Codename: bionic

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mlaiacker/rosbag2video/issues/17#issuecomment-874167488, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALYLH7WTZQR7MUS6RCCPMCLTWHAWFANCNFSM4RPDQRSQ .

!/usr/bin/env python3

import roslib

roslib.load_manifest('rosbag')

import rospy import rosbag import sys, getopt import os from sensor_msgs.msg import CompressedImage from sensor_msgs.msg import Image

ros_path = '/opt/ros/kinetic/lib/python2.7/dist-packages' if ros_path in sys.path: sys.path.remove(ros_path)

import cv2 import numpy as np import subprocess

sys.path.append('/opt/ros/kinetic/lib/python2.7/dist-packages')

MJPEG_VIDEO = 1 RAWIMAGE_VIDEO = 2 VIDEO_CONVERTER_TO_USE = "ffmpeg" # or use "avconv" I made the above modification and the error disappeared

cardboardcode commented 1 month ago

Closing. Will make a PR in the future to dockerize and resolve all environment dependency issues.