Kinetic enforces openCV3 throughout the system
Hello everyone,
I just installed ROS Kinetic on an Ubuntu 16.04 and I ran onto this problem.
Usually, I add
source /opt/ros/kinetic/setup.bash
source ~/catkin_ws/devel/setup.bash
onto my .bashrc file to have access to all ROS related commands on each new console.
However, today, I tried to launch a completely unrelated software (the MAVProxy GCS along with the ardupilot simulator) which kept crashing.
The reason was that setup.bash
enforced the PYTHONPATH
to look at the OpenCV3.1.0 installation, provided by Kinetic, but MAVProxy was using the (otherwise installed) OpenCV 2.4.9. It goes without saying, there isn't backwards compatibility.
Even though I managed to run MAVProxy properly by commenting out setup.bash
from by .bashrc, so that OpenCV 2.4.9 takes over, I don't think this is proper behaviour.
Any thoughts or workarounds?
Thanks, George
I am having a similar problem with catkin refusing to use my CUDA enabled version of OpenCV. Seeing as my CMakeLists.txt file compiles code fine without catkin_make, but uses the bundled ROS OpenCV with catkin_make, I assume that catkin is using a variable somewhere.
One workaround I am thinking of is writing my own CMake file to find open CV, and using that in my CMakesLists.txt
@daniel_dsouza Perhaps you could tell catkin which version you need, as is described here:http://wiki.ros.org/opencv3, with
find_package(OpenCV 2)
The problem is that my code uses OpenCV 3.1.0, which same version bundled by ROS.
A bit pedantic maybe, but enforces is not correct: you chose to add the two
source
lines to your.bashrc
, so allbash
environments are updated so you can work with ROS.setup.bash
only did what you asked, but by adding it to your.bashrc
, it will do that in all yourbash
sessions.Technically, this is correct. But I believe anyone who works with ROS regularly sources the
setup.bash
on their.bashrc
. Having that script override the system's OpenCV version seems forcing. Is this even required torosrun
ROS Python scripts using OpenCV3?I'd say I work regularly with ROS, and I don't have that line in my
.bashrc
. In fact, I'd say that anyone who has more than a single workspace will not have those lines.As to whether it is required: yes. ROS python libs are not in standard locations, so
PYTHONPATH
needs to be updated.Afaict, there are three possible 'solutions': ROS should be installed in standard locations (ie: not under
/opt
), OpenCV should not use thecv2
module name for OpenCV3 (avoid clash), or you need to make sure yourPYTHONPATH
does not contain the 'wrong' entries.