To install latest opencv2 from OpenCV project as an overlay, you will have to do the following:
Get rosinstall
wget --no-check-certificate http://ros.org/rosinstall -O ~/rosinstall chmod 755 ~/rosinstall
Create a file shared_overlay.rosconfig
- svn: uri: https://code.ros.org/svn/ros-pkg/stacks/vision_opencv/trunk local-name: vision_opencv - svn: uri: https://code.ros.org/svn/ros-pkg/stacks/image_transport_plugins/tags/latest local-name: image_transport_plugins - svn: uri: https://code.ros.org/svn/ros-pkg/stacks/image_pipeline/tags/latest local-name: image_pipeline - svn: uri: https://code.ros.org/svn/wg-ros-pkg/stacks/pr2_robot/tags/latest local-name: pr2_robot - svn: uri: https://code.ros.org/svn/wg-ros-pkg/stacks/web_interface/tags/latest local-name: web_interface - svn: uri: https://code.ros.org/svn/wg-ros-pkg/stacks/pr2_simulator/tags/latest local-name: pr2_simulator- Source setup.sh for default installs (setup ROS path for anything you want to use underneath the overlay)
source /opt/ros/latest/setup.sh ~/rosinstall -o ~/opencv2_overlay shared_overlay.rosconfig
- Pull in overlay packages,
~/rosinstall -o ~/opencv2_overlay shared_overlay.rosconfig
This automatically generates a new setup.sh in the overlay directory (~/opencv2_overlay) setting up all the necessary ROS environment variables.
- Source the shared overlay and cd into overlay opencv2
source ~/opencv2_overlay/setup.sh roscd opencv2
Make changes to Makefile in the opencv2 package so that it uses the latest svn trunk by commenting out the line containing SVN_REVISION as such:
INSTALL_DIR = opencv all: installed SVN_DIR = build/opencv-svn SVN_URL = https://code.ros.org/svn/opencv/trunk/opencv #SVN_REVISION = -r3028 SVN_PATCH = pythontest.patch include $(shell rospack find mk)/svn_checkout.mk ...
add your class path to the front of ROS_PACKAGE_PATH in ~/opencv2_overlay/setup.sh:
export ROS_ROOT=/opt/ros/boxturtle/ros export PATH=$ROS_ROOT/bin:$PATH export PYTHONPATH=$ROS_ROOT/core/roslib/src:$PYTHONPATH if [ ! "$ROS_MASTER_URI" ] ; then export ROS_MASTER_URI=http://localhost:11311 ; fi export ROS_PACKAGE_PATH=~/cs324/users/[your_username]:~/projects/opencv2_overlay/vision_opencv:~/projects/opencv2_overlay/image_pipeline:~/projects/opencv2_overlay/image_transport_plugins:~/projects/opencv2_overlay/pr2_robot:~/projects/opencv2_overlay/web_interface:~/projects/opencv2_overlay/pr2_simulator:/opt/ros/boxturtle/stacks source $ROS_ROOT/tools/rosbash/rosbash
- recompile all packages
source ~/opencv2_overlay/setup.sh rosmake -a
