AaronMR / Learning_ROS_for_Robotics_Programming_2nd_edition

Code and examples for Learning ROS for Robotics Programming - 2nd Edition
448 stars 306 forks source link

Build fails because of missed dependencies (OpenCV non-free, ...) #14

Closed wegunterjr-Dematic closed 8 years ago

wegunterjr-Dematic commented 8 years ago

I am getting the following error, but not sure why. I do have opencv installed, but how to make sure it can find it: /home/default/dev/catkin_ws/src/ros_book/chapter5_tutorials/src/homography.cpp:16:39: fatal error: opencv2/nonfree/nonfree.hpp: No such file or directory

include <opencv2/nonfree/nonfree.hpp>

efernandez commented 8 years ago

You need opencv nonfree for the features (e.g. SURF, SIFT, ...)

Check if you have it installed with: dpkg -l | grep libopencv-nonfree

Install it with: sudo apt-get install libopencv-nonfree-dev libopencv-nonfree2.4

Note that the 2.4 version might be different in your Linux distro.

Anyway, if you run rosdep install --from-paths src -iy in the workspace, this dependency should get installed automatically. How you done that?

wegunterjr-Dematic commented 8 years ago

i did do the rosdep install --from-paths src -iy

wegunterjr-Dematic commented 8 years ago

Just tried again to make sure: it isn't finding the libopencv-nonfree-dev libopencv-nonfree2.4 and, am getting this error when i run the rosdep install: rosdep install --from-paths src -iy WARNING: Package "ompl" does not follow the version conventions. It should not contain leading zeros (unless the number is 0

wegunterjr-Dematic commented 8 years ago

it is because I need to add the repo: sudo add-apt-repository --yes ppa:xqms/opencv-nonfree

wegunterjr-Dematic commented 8 years ago

okay..did that and getting some new fail: `[ 27%] Building CXX object ros_book/chapter3_tutorials/CMakeFiles/example6.dir/src/example6.cpp.o /home/wegunterjr/dev/catkin_ws/src/ros_book/chapter9_tutorials/src/sendGoals.cpp:2:43: fatal error: move_base_msgs/MoveBaseAction.h: No such file or directory

include <move_base_msgs/MoveBaseAction.h>

                                       ^

compilation terminated. Linking CXX executable /home/wegunterjr/dev/catkin_ws/devel/lib/chapter3_tutorials/example3 Linking CXX executable /home/wegunterjr/dev/catkin_ws/devel/lib/chapter3_tutorials/example2 [ 27%] Built target example3 Scanning dependencies of target example7 [ 27%] Built target example2 [ 28%] Scanning dependencies of target example8 Building CXX object ros_book/chapter3_tutorials/CMakeFiles/example7.dir/src/example7.cpp.o [ 30%] Building CXX object ros_book/chapter3_tutorials/CMakeFiles/example8.dir/src/example8.cpp.o make[2]: [ros_book/chapter9_tutorials/CMakeFiles/sendGoals.dir/src/sendGoals.cpp.o] Error 1 make[1]: [ros_book/chapter9_tutorials/CMakeFiles/sendGoals.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... Linking CXX executable /home/wegunterjr/dev/catkin_ws/devel/lib/chapter3_tutorials/example6 Linking CXX executable /home/wegunterjr/dev/catkin_ws/devel/lib/chapter3_tutorials/example8 [ 30%] Built target example6 [ 30%] Built target example8 Linking CXX executable /home/wegunterjr/dev/catkin_ws/devel/lib/chapter3_tutorials/example7 [ 30%] Built target example7 make: [all] Error 2 Invoking "make -j4" failed wegunterjr@ros-VB:~/dev/catkin_ws$`

efernandez commented 8 years ago

The ompl "error" is just a warning; unless their maintainer fix it, you'll keep seeing the warning, but that's harmless.

Good catch with the missed repo. I'll update the chapter readme with that.

Regarding your latest error, you're still missing dependencies. Can you run this again:

cd ~/dev/catkin_ws
rosdep install --from-paths src -iy

Please attach the output.

I assume you have a src folder in your workspace with all the packages. Could you provide the output of ls ~/dev/catkin_ws/src.

BTW, the error output you've attached looks like it wasn't copy & paste'd properly. I would say you either have a ros-indigo-move-base-msgs dependency not installed, or we have a bug on the chapter that depends on it. Which version of Linux (Ubuntu) and ROS are you using?

wegunterjr-Dematic commented 8 years ago

Here is the output from rosdep install --from-paths src -iy `WARNING: Package "ompl" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).

All required rosdeps installed successfully`

wegunterjr-Dematic commented 8 years ago

Here is the output of ls ~/dev/catkin_ws/src CMakeLists.txt ros_book

wegunterjr-Dematic commented 8 years ago

Also, I am using Indigo on Ubuntu 14.04 * /rosdistro: indigo * /rosversion: 1.11.13

wegunterjr-Dematic commented 8 years ago

okay, I just tried installing ros-indigo-move-base-msgs and then did the make again, and it worked. Ie, completed without errors.

efernandez commented 8 years ago

@wegunterjr-Dematic Thanks, the chapter9 has a few missed dependencies... I'll fix them asap.

Build dependencies missed

Run dependencies missed

efernandez commented 8 years ago

All missed dependencies added in #16 to hydro-devel and cherry-pick'd into indigo-devel and jade-devel.