Comments (6)
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.
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.
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.
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.
- I opened the first terminal, and then ran
roscore
. - I opened the second terminal, and ran
workon detectron2_ros
. Then, I ransource devel/setup.bash
in the root directory of the catkin workspace (doing this first and then runningworkon detectron2_ros
gave me the same result). Runningroslaunch detectron2_ros detectron2_ros.launch
gave me thecv2
error.
Any thoughts on what I'm missing?
from detectron2_ros.
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.
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)
- Can you please answer this ??
- Gettting ERROR: Cannot load message class for [detectron2_ros/Result]. Are your messages built? HOT 3
- Differentiating b/w .py and no extension HOT 2
- Can't catkin_make HOT 2
- compile and use issues HOT 3
- Model file not found HOT 5
- No packages to be built.
- result of panoramic segmentation to ros msg HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from detectron2_ros.