Git Product home page Git Product logo

Comments (6)

DavidFernandezChaves avatar DavidFernandezChaves commented on July 19, 2024

Dear syc7446, the problem is that it does not find open cv, and this is sometimes incompatible with ROS.
I recommend you to add and compile this version in your ROS repository:
https://github.com/ros-perception/vision_opencv/tree/0bbebb73bea65eca856e732b919439853a04986b

from detectron2_ros.

syc7446 avatar syc7446 commented on July 19, 2024

Thanks for the suggestion. Actually I've already tried that according to this but I am still getting the same error. I can import cv_bridge but not cv2. Could you tell me if I'm missing something here?

Another related question is how would you source two packages (i.e. vision_opencv and detectron2_ros)? If I source vision_opencv using source install/setup.bash --extend first and then source detectron2_ros using source devel/setup.bash, I am losing the effect of sourcing vision_opencv and can't use cv in python 3 anymore. If you could give me a little bit more details on how to do, that'd be greatly appreciated. Thanks!

from detectron2_ros.

DavidFernandezChaves avatar DavidFernandezChaves commented on July 19, 2024

I tried to use that but it didn't work, but I haven't configured ROS with Python3, in my case, ROS still uses Python2 except for the cnn node.
You can see the file structure I use here: https://github.com/DavidFernandezChaves/ViMantic-Client

In the catkin directory you have to have the CV and the Detectron2_ros package. You compile that with catking_make using a console with the python2 environment. The source is only needed to the catkin directory, not the individual packages. Then, you open a console with the python3 environment as explained and run the roslaunch from there.
ROS "magically" works with python2, except for that node which uses python3.

from detectron2_ros.

syc7446 avatar syc7446 commented on July 19, 2024

I see, thanks! I think I did exactly as you explained but I'm still getting that cv2 error. It shouldn't make a difference but I'm using ros kinetic and the following is what I did after doing catkin_make in the catkin workspace which contains both Detectron2_ros and vision_opencv. As a default, I have source /opt/ros/kinetic/setup.bash in a bashrc file.

  1. I opened the first terminal, and then ran roscore.
  2. I opened the second terminal, and ran workon detectron2_ros. Then, I ran source devel/setup.bash in the root directory of the catkin workspace (doing this first and then running workon detectron2_ros gave me the same result). Running roslaunch detectron2_ros detectron2_ros.launch gave me the cv2 error.

Any thoughts on what I'm missing?

from detectron2_ros.

DavidFernandezChaves avatar DavidFernandezChaves commented on July 19, 2024

Well, in my case I have the source in the .bachrc, so I don't have to launch the source.
In your case, open the second terminal, do the source, then the work on, and finally the node. But if you say the same thing happens to you it's a problem that python is not properly finding the route to the CV.
By discarding options, have you run Detectron2 in the virtual environment without ROS?
Did you set up the dependencies just like it says here?: https://github.com/facebookresearch/detectron2/blob/master/INSTALL.md

from detectron2_ros.

syc7446 avatar syc7446 commented on July 19, 2024

Yes, Detectron2 works when entirely discarding ROS-related paths. However, I managed to get this package working on ROS. I detoured the issue by adding several sys.path.remove() and sys.path.append() in the source code directly, which I don't feel right to do.. Anyways, thanks for the help!

from detectron2_ros.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.