HBRS-SDP / ss22-ros2-perception

GNU General Public License v3.0
0 stars 3 forks source link

cv_bridge_export.h import error #13

Closed vamsikalagaturu closed 2 years ago

vamsikalagaturu commented 2 years ago

When used cv_bridge as #include "cv_bridge/cv_bridge/cv_bridge.h" in the package, it is throwing an error:

/opt/ros/rolling/include/cv_bridge/cv_bridge/cv_bridge.h:46:10: fatal error: cv_bridge/cv_bridge_export.h: No such file or directory
   46 | #include <cv_bridge/cv_bridge_export.h>

This is because, the cv_bridge_export.h is present in the path cv_bridge/cv_bridge/cv_bridge_export.h and the inlcude in cv_bridge.h is referring to cv_bridge/cv_bridge_export.h

A workaround for this issue:

Simultaneously, created the issue in ros-perception/vision_opencv: https://github.com/ros-perception/vision_opencv/issues/435

If the colcon build is not finding the local package, but searching in /opt/ros/version/ for cv_bridge:

sthoduka commented 2 years ago

replace ${CMAKE_INSTALL_PREFIX}/../cv_bridge/include with $ENV{COLCON_PREFIX_PATH}/cv_bridge/include so that you only need to build once. I guess the install directory for mir_object_recognition doesn't exist during the first build, so the CMAKE_INSTALL_PREFIX points to a non-existent directory.

vamsikalagaturu commented 2 years ago

The cv_bridge import issues are no longer occuring with the latest builds, and therefore closing the issue.