How to properly include other packages in catkin_ws

asked 2021-08-18 10:50:44 -0500

kyubot gravatar image

Hello all, I have been developing a ros-qt based gui package. All the source codes are available from my github.

This package require "image_transport", "cv_bridge" to display image from robot.

This package works just fine when I catkin_make with apt installed opencv with ROS-melodic.

Then I removed opencv 3.2 and cmake installed opencv to 3.4.4 for running other program. This caused me to manually install bunch of packages that previously apt installable packages like below.

~/catkin_ws/src$ tree -L 1 -d . ├── cmake_modules ├── common_msgs ├── control_msgs ├── control_toolbox ├── gazebo_ros_pkgs ├── geometry2 ├── image_common ├── image_transport_plugins ├── joint_state_publisher ├── kdl_parser ├── object_follower ├── qt_gui_core ├── realtime_tools ├── resource_retriever ├── robot_state_publisher ├── ros_control ├── rqt ├── rqt_image_view ├── rviz └── vision_opencv

After this, whenever I tried to catkin_make my package, it gives me error like this.

/usr/include/boost/predef/language/stdc.h :52: Parse error at "defined" r1mini_gui_teleop/CMakeFiles/r1mini_gui_teleop.dir/build.make:91: recipe for target 'r1mini_gui_teleop/include/r1mini_gui_teleop/moc_main_window.cxx' failed make[2]: * [r1mini_gui_teleop/include/r1mini_gui_teleop/moc_main_window.cxx] Error 1 CMakeFiles/Makefile2:27900: recipe for target 'r1mini_gui_teleop/CMakeFiles/r1mini_gui_teleop.dir/all' failed make[1]: [r1mini_gui_teleop/CMakeFiles/r1mini_gui_teleop.dir/all] Error 2 make[1]: ** Waiting for unfinished jobs....

I found this error disappear when I remove below lines of code in my qnode.hpp

include <image_transport image_transport.h="">

include <cv_bridge cv_bridge.h="">

So I tried to make install above package in catkin_ws but no luck. Is there a way to fix this error other then just go back to original opencv?

edit retag flag offensive close merge delete