Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named bluerov.video #29

Open
olayasturias opened this issue Feb 9, 2018 · 5 comments
Open

ImportError: No module named bluerov.video #29

olayasturias opened this issue Feb 9, 2018 · 5 comments

Comments

@olayasturias
Copy link

When doing
roslaunch bluerov_ros_playground video.launch,
The following error appears:

Traceback (most recent call last):
File "/catkin_ws/src/bluerov_ros_playground/src/bluerov/bin/video", line 3, in
import bluerov.video as Video
ImportError: No module named bluerov.video

However, I checked that the imported modules are in its place, and they are. I'm not sure if it is a problem of mine or maybe the import is done wrong.

@patrickelectric
Copy link
Owner

patrickelectric commented Feb 9, 2018

Ty for your reply @olayasturias, I'll try to reproduce it.
EDIT: The software was developed for lunar, but the first version was compatible with catkin, I'll test again to make sure that everything is working fine with our latest update.

@patrickelectric
Copy link
Owner

@olayasturias it's working with my catkin and lunar install.
Catkin:

patrick@patrick-ub:~/ws$ find . | grep bluerov/video
./src/bluerov_ros_playground/src/bluerov/video.py
./src/bluerov_ros_playground/src/bluerov/video.pyc

Lunar:

 patrick@dell ~/ros_ws/lunar$ find . | grep bluerov/video
./build_isolated/bluerov_ros_playground/lib/bluerov/video.py
./src/bluerov_ros_playground/src/bluerov/video.py
./install_isolated/lib/python3.6/site-packages/bluerov/video.py

have you runned catkin_make --pkg bluerov_ros_playground in catkin ? or
catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --pkg bluerov_ros_playground in lunar ?
And after that, the source command ?

@olayasturias
Copy link
Author

olayasturias commented Feb 12, 2018

Hi Patrick,
I'm using ROS Kinetic and python 2.7, so that may be part of the cause.
I sourced the workspace, and it finds all the files correctly, so that's not the problem: the gazebo nodes, for example, run without any problem.
The command
./src/bluerov_ros_playground/src/bluerov/video.py
worked fine! However, it doesn't seem to be an "elegant" solution. On the other hand, I would like to publish the video in a ROS topic. Is your video node meant to do so?

@olayasturias
Copy link
Author

olayasturias commented Feb 12, 2018

Ok, I solved it!!

I modified the line in video
import bluerov.video as Video
by

sys.path.insert(0, '/home/username/catkin_ws/src/bluerov_ros_playground/src/bluerov')
import video as Video

It's not an elegant solution, but it works and allows me to execute the file using roslaunch, which is far more intuitive than the previous solution.

When running it, the opencv window is opened. I think I will do some modifications to publish the image via ROS topics.

@patrickelectric
Copy link
Owner

Good to know !
It's a bit weird, I'll try a fresh install just to make sure that everything is working properly with kinetic.

If you want to send the video (and others BlueRov2 topics), you can use the bluerov_node, check the readme here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants