Robotics StackExchange | Archived questions

Invoking "make -j8 -l8" failed

this issue is old for me, I can't fix it my question here before Invoking "make -j8 -l8" failed

my experience is a zero in ccp and not good in ROS

.......
 /usr/local/include/opencv4/opencv2/features2d.hpp:1214:1: error: expected ‘(’ before ‘UnderlyingType’
/usr/local/include/opencv4/opencv2/features2d.hpp:1214:1: error: ‘UnderlyingType’ was not declared in this scope
/usr/local/include/opencv4/opencv2/features2d.hpp:1214:1: error: expected type-specifier before ‘UnderlyingType’
 CV_ENUM_FLAGS(DrawMatchesFlags)
 ^
/usr/local/include/opencv4/opencv2/features2d.hpp:1214:1: error: expected ‘>’ before ‘UnderlyingType’
/usr/local/include/opencv4/opencv2/features2d.hpp:1214:1: error: expected ‘(’ before ‘UnderlyingType’
/usr/local/include/opencv4/opencv2/features2d.hpp:1214:1: error: expected ‘)’ before ‘;’ token
 CV_ENUM_FLAGS(DrawMatchesFlags)
 ^
/usr/local/include/opencv4/opencv2/features2d.hpp:1214:1: error: expected ‘)’ before ‘;’ token
In file included from /usr/local/include/opencv4/opencv2/calib3d.hpp:48:0,
                 from /usr/local/include/opencv4/opencv2/calib3d/calib3d.hpp:48,
                 from /opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:7,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:40:
/usr/local/include/opencv4/opencv2/features2d.hpp: At global scope:
/usr/local/include/opencv4/opencv2/features2d.hpp:1232:92: error: ‘DrawMatchesFlags’ is not a class or namespace
                                const Scalar& color=Scalar::all(-1), DrawMatchesFlags flags=DrawMatchesFlags::DEFAULT );
                                                                                            ^
/usr/local/include/opencv4/opencv2/features2d.hpp:1260:111: error: ‘DrawMatchesFlags’ is not a class or namespace
                              const std::vector<char>& matchesMask=std::vector<char>(), DrawMatchesFlags flags=DrawMatchesFlags::DEFAULT );
                                                                                                               ^
/usr/local/include/opencv4/opencv2/features2d.hpp:1267:139: error: ‘DrawMatchesFlags’ is not a class or namespace
                              const std::vector<std::vector<char> >& matchesMask=std::vector<std::vector<char> >(), DrawMatchesFlags flags=DrawMatchesFlags::DEFAULT );
                                                                                                                                           ^
/usr/local/include/opencv4/opencv2/features2d.hpp:1278:101: error: invalid use of incomplete type ‘struct cv::Ptr<cv::Feature2D>’
                                          const Ptr<FeatureDetector>& fdetector=Ptr<FeatureDetector>() );
                                                                                                     ^
In file included from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81:0,
                 from /usr/local/include/opencv4/opencv2/core/base.hpp:58,
                 from /usr/local/include/opencv4/opencv2/core.hpp:54,
                 from /usr/local/include/opencv4/opencv2/core/core.hpp:48,
                 from /opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:5,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:40:
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:66:8: error: declaration of ‘struct cv::Ptr<cv::Feature2D>’
 struct Ptr : public std::shared_ptr<T>
        ^
In file included from /usr/local/include/opencv4/opencv2/calib3d.hpp:48:0,
                 from /usr/local/include/opencv4/opencv2/calib3d/calib3d.hpp:48,
                 from /opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:7,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:40:
/usr/local/include/opencv4/opencv2/features2d.hpp:1441:30: error: field ‘dextractor’ has incomplete type
     Ptr<DescriptorExtractor> dextractor;
                              ^
/usr/local/include/opencv4/opencv2/features2d.hpp:1442:28: error: field ‘dmatcher’ has incomplete type
     Ptr<DescriptorMatcher> dmatcher;
                            ^
In file included from /usr/local/include/opencv4/opencv2/calib3d/calib3d.hpp:48:0,
                 from /opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:7,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:40:
/usr/local/include/opencv4/opencv2/calib3d.hpp:1057:106: error: invalid use of incomplete type ‘struct cv::Ptr<cv::SimpleBlobDetector>’
                                    const Ptr<FeatureDetector> &blobDetector = SimpleBlobDetector::create());
                                                                                                          ^
In file included from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81:0,
                 from /usr/local/include/opencv4/opencv2/core/base.hpp:58,
                 from /usr/local/include/opencv4/opencv2/core.hpp:54,
                 from /usr/local/include/opencv4/opencv2/core/core.hpp:48,
                 from /opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:5,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:40:
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:66:8: error: declaration of ‘struct cv::Ptr<cv::SimpleBlobDetector>’
 struct Ptr : public std::shared_ptr<T>
        ^
In file included from /usr/local/include/opencv4/opencv2/highgui.hpp:51:0,
                 from /usr/local/include/opencv4/opencv2/highgui/highgui.hpp:48,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/include/turtlebot_actions/detect_calibration_pattern.h:7,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:50:
/usr/local/include/opencv4/opencv2/videoio.hpp:786:20: error: field ‘cap’ has incomplete type
     Ptr<CvCapture> cap;
                    ^
/usr/local/include/opencv4/opencv2/videoio.hpp:787:24: error: field ‘icap’ has incomplete type
     Ptr<IVideoCapture> icap;
                        ^
/usr/local/include/opencv4/opencv2/videoio.hpp:935:24: error: field ‘writer’ has incomplete type
     Ptr<CvVideoWriter> writer;
                        ^
/usr/local/include/opencv4/opencv2/videoio.hpp:936:23: error: field ‘iwriter’ has incomplete type
     Ptr<IVideoWriter> iwriter;
                       ^
In file included from /usr/local/include/opencv4/opencv2/core.hpp:60:0,
                 from /usr/local/include/opencv4/opencv2/core/core.hpp:48,
                 from /opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:5,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:40:
/usr/local/include/opencv4/opencv2/core/persistence.hpp: In instantiation of ‘void cv::read(const cv::FileNode&, cv::Point_<_Tp>&, const cv::Point_<_Tp>&) [with _Tp = int]’:
/usr/local/include/opencv4/opencv2/core/persistence.hpp:778:34:   required from here
/usr/local/include/opencv4/opencv2/core/persistence.hpp:722:11: error: ambiguous overload for ‘operator=’ (operand types are ‘cv::Point_<int>’ and ‘const cv::Point_<int>’)
     value = temp.size() != 2 ? default_value : Point_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]));
           ^
/usr/local/include/opencv4/opencv2/core/persistence.hpp:722:11: note: candidates are:
In file included from /usr/local/include/opencv4/opencv2/core.hpp:58:0,
                 from /usr/local/include/opencv4/opencv2/core/core.hpp:48,
                 from /opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:5,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:40:
/usr/local/include/opencv4/opencv2/core/types.hpp:1184:14: note: cv::Point_<_Tp>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]
 Point_<_Tp>& Point_<_Tp>::operator = (const Point_& pt)
              ^
/usr/local/include/opencv4/opencv2/core/types.hpp:1191:14: note: cv::Point_<_Tp>& cv::Point_<_Tp>::operator=(cv::Point_<_Tp>) [with _Tp = int; cv::Point_<_Tp> = cv::Point_<int>]
 Point_<_Tp>& Point_<_Tp>::operator = (Point_&& pt) CV_NOEXCEPT
              ^
In file included from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81:0,
                 from /usr/local/include/opencv4/opencv2/core/base.hpp:58,
                 from /usr/local/include/opencv4/opencv2/core.hpp:54,
                 from /usr/local/include/opencv4/opencv2/core/core.hpp:48,
                 from /opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:5,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:40:
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp: In instantiation of ‘cv::Ptr<_Tp> cv::makePtr(const A1& ...) [with _Tp = cv::flann::KDTreeIndexParams; A1 = {}]’:
/usr/local/include/opencv4/opencv2/features2d.hpp:1155:109:   required from here
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:136:10: error: return type ‘struct cv::Ptr<cv::flann::KDTreeIndexParams>’ is incomplete
 Ptr<_Tp> makePtr(const A1&... a1)
          ^
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:138:20: error: ‘value’ is not a member of ‘cv::has_custom_delete<cv::flann::KDTreeIndexParams, void>’
     static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
                    ^
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:138:103: error: ‘static_assert’ was not declared in this scope
     static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
                                                                                                       ^
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp: In instantiation of ‘cv::Ptr<_Tp> cv::makePtr(const A1& ...) [with _Tp = cv::flann::SearchParams; A1 = {}]’:
/usr/local/include/opencv4/opencv2/features2d.hpp:1156:98:   required from here
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:136:10: error: return type ‘struct cv::Ptr<cv::flann::SearchParams>’ is incomplete
 Ptr<_Tp> makePtr(const A1&... a1)
          ^
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:138:20: error: ‘value’ is not a member of ‘cv::has_custom_delete<cv::flann::SearchParams, void>’
     static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
                    ^
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:138:103: error: ‘static_assert’ was not declared in this scope
     static_assert( !has_custom_delete<_Tp>::value, "Can't use this makePtr with custom DefaultDeleter");
                                                                                                       ^
In file included from /usr/local/include/opencv4/opencv2/core.hpp:58:0,
                 from /usr/local/include/opencv4/opencv2/core/core.hpp:48,
                 from /opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:5,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:40:
/usr/local/include/opencv4/opencv2/core/types.hpp: In instantiation of ‘static _OI std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m(_II, _II, _OI) [with _II = const cv::KeyPoint*; _OI = cv::KeyPoint*]’:
/usr/include/c++/4.8/bits/stl_algobase.h:390:70:   required from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const cv::KeyPoint*; _OI = cv::KeyPoint*]’
/usr/include/c++/4.8/bits/stl_algobase.h:428:38:   required from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = __gnu_cxx::__normal_iterator<const cv::KeyPoint*, std::vector<cv::KeyPoint> >; _OI = __gnu_cxx::__normal_iterator<cv::KeyPoint*, std::vector<cv::KeyPoint> >]’
/usr/include/c++/4.8/bits/stl_algobase.h:460:17:   required from ‘_OI std::copy(_II, _II, _OI) [with _II = __gnu_cxx::__normal_iterator<const cv::KeyPoint*, std::vector<cv::KeyPoint> >; _OI = __gnu_cxx::__normal_iterator<cv::KeyPoint*, std::vector<cv::KeyPoint> >]’
/usr/include/c++/4.8/bits/vector.tcc:199:63:   required from ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = cv::KeyPoint; _Alloc = std::allocator<cv::KeyPoint>]’
/usr/local/include/opencv4/opencv2/core/persistence.hpp:1180:13:   required from here
/usr/local/include/opencv4/opencv2/core/types.hpp:711:27: error: ambiguous overload for ‘operator=’ (operand types are ‘cv::Point2f {aka cv::Point_<float>}’ and ‘const Point2f {aka const cv::Point_<float>}’)
 class CV_EXPORTS_W_SIMPLE KeyPoint
                           ^
/usr/local/include/opencv4/opencv2/core/types.hpp:711:27: note: candidates are:
In file included from /usr/local/include/opencv4/opencv2/core.hpp:58:0,
                 from /usr/local/include/opencv4/opencv2/core/core.hpp:48,
                 from /opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:5,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:40:
/usr/local/include/opencv4/opencv2/core/types.hpp:170:13: note: cv::Point_<_Tp>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = float]
     Point_& operator = (const Point_& pt);
             ^
/usr/local/include/opencv4/opencv2/core/types.hpp:171:13: note: cv::Point_<_Tp>& cv::Point_<_Tp>::operator=(cv::Point_<_Tp>) [with _Tp = float; cv::Point_<_Tp> = cv::Point_<float>]
     Point_& operator = (Point_&& pt) CV_NOEXCEPT;
             ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/string:40,
                 from /opt/ros/indigo/include/ros/platform.h:55,
                 from /opt/ros/indigo/include/ros/time.h:53,
                 from /opt/ros/indigo/include/ros/ros.h:38,
                 from /home/redhwan/turtlebot/src/turtlebot_apps/turtlebot_actions/src/find_fiducial_pose.cpp:37:
/usr/include/c++/4.8/bits/stl_algobase.h:335:18: note: synthesized method ‘cv::KeyPoint& cv::KeyPoint::operator=(const cv::KeyPoint&)’ first required here 
        *__result = *__first;
                  ^
make[2]: *** [turtlebot_apps/turtlebot_actions/CMakeFiles/find_fiducial_pose.dir/src/find_fiducial_pose.cpp.o] Error 1
make[1]: *** [turtlebot_apps/turtlebot_actions/CMakeFiles/find_fiducial_pose.dir/all] Error 2
make: *** [all] Error 2

    Invoking "make -j8 -l8" failed

seems which issue in this code findfiducialpose.ccp

#include <ros/ros.h>
#include <actionlib/server/simple_action_server.h>
#include <image_transport/image_transport.h>
#include <image_geometry/pinhole_camera_model.h>
#include <tf/transform_listener.h>
#include <opencv2/core/core.hpp>
#include <cv_bridge/cv_bridge.h>
#include <Eigen/Dense>
#include <Eigen/Geometry>
#include <Eigen/StdVector>
#include <tf/tf.h>
#include <tf/transform_broadcaster.h>
#include "turtlebot_actions/FindFiducialAction.h"
#include "turtlebot_actions/detect_calibration_pattern.h"

class FindFiducialAction
{
public:

  FindFiducialAction(std::string name) :
    as_(nh_, name, true),
    action_name_(name),
    it_(nh_)
  {
    //register the goal and feeback callbacks                                   
    as_.registerGoalCallback(boost::bind(&FindFiducialAction::goalCB, this));
    as_.registerPreemptCallback(boost::bind(&FindFiducialAction::preemptCB, this));

  }

  ~FindFiducialAction(void)
  {
  }

  void goalCB()
  {
    ROS_INFO("%s: Received new goal", action_name_.c_str());

    typedef boost::shared_ptr<const turtlebot_actions::FindFiducialGoal> GoalPtr;
    GoalPtr goal = as_.acceptNewGoal();

    cv::Size grid_size(goal->pattern_width,goal->pattern_height);
    detector_.setPattern(grid_size, goal->pattern_size, Pattern(goal->pattern_type));

    ros::Duration(1.0).sleep();
    //subscribe to the image topic of interest
    std::string image_topic = goal->camera_name + "/image_rect_mono";
    sub_ = it_.subscribeCamera(image_topic, 1, &FindFiducialAction::detectCB, this);

    pub_timer_ = nh_.createTimer(tf_listener_.getCacheLength() - ros::Duration(1.0), boost::bind(&FindFiducialAction::timeoutCB, this, _1),true);
  }

  void timeoutCB(const ros::TimerEvent& e)
  {
    if(sub_.getNumPublishers() == 0)
      ROS_INFO("%s: Aborted, there are no publishers on goal topic.", action_name_.c_str());    
    else
      ROS_INFO("%s: Aborted, there are publishers on goal topic, but detection took too long.", action_name_.c_str());    

    sub_.shutdown();
    as_.setAborted();
  }

  void preemptCB()
  {
    ROS_INFO("%s: Preempted", action_name_.c_str());
    // set the action state to preempted                                        
    pub_timer_.stop();
    as_.setPreempted();
    sub_.shutdown();
  }

  void detectCB(const sensor_msgs::ImageConstPtr& image_msg, const sensor_msgs::CameraInfoConstPtr& info_msg)
  {
    // make sure that the action is active                            
    if (!as_.isActive())
      return;

    ROS_INFO("%s: Received image, performing detection", action_name_.c_str());
    // Convert image message

    try
    {
      img_bridge_ = cv_bridge::toCvCopy(image_msg, "mono8");
    }
    catch (cv_bridge::Exception& ex)
    {
      ROS_ERROR("[calibrate] Failed to convert image");
      return;
    }


    ROS_INFO("%s: created cv::Mat", action_name_.c_str());
    cam_model_.fromCameraInfo(info_msg);
    detector_.setCameraMatrices(cam_model_.intrinsicMatrix(), cam_model_.distortionCoeffs());

    Eigen::Vector3f translation;
    Eigen::Quaternionf orientation;

    if (detector_.detectPattern(img_bridge_->image, translation, orientation))
    {
      ROS_INFO("detected fiducial");
      tf::Transform fiducial_transform;
      fiducial_transform.setOrigin( tf::Vector3(translation.x(), translation.y(), translation.z()) );
      fiducial_transform.setRotation( tf::Quaternion(orientation.x(), orientation.y(), orientation.z(), orientation.w()) );

      tf::StampedTransform fiducial_transform_stamped(fiducial_transform, image_msg->header.stamp, cam_model_.tfFrame(), "fiducial_frame");
      tf_broadcaster_.sendTransform(fiducial_transform_stamped);

      tf::Pose fiducial_pose;
      fiducial_pose.setRotation(tf::Quaternion(0, 0, 0, 1.0));
      fiducial_pose = fiducial_transform * fiducial_pose;
      tf::Stamped<tf::Pose> fiducial_pose_stamped(fiducial_pose, image_msg->header.stamp, cam_model_.tfFrame());

      tf::poseStampedTFToMsg(fiducial_pose_stamped, result_.pose);
      as_.setSucceeded(result_);
      pub_timer_.stop();
      sub_.shutdown();
    }

  }

protected:

  ros::NodeHandle nh_;
  actionlib::SimpleActionServer<turtlebot_actions::FindFiducialAction> as_;
  std::string action_name_;
  PatternDetector detector_;

  image_transport::ImageTransport it_;
  image_transport::CameraSubscriber sub_;
  cv_bridge::CvImagePtr img_bridge_;
  image_geometry::PinholeCameraModel cam_model_;

  tf::TransformListener tf_listener_;
  tf::TransformBroadcaster tf_broadcaster_;

  ros::Timer pub_timer_;

  // create messages that are used to published feedback/result                 
  turtlebot_actions::FindFiducialFeedback feedback_;
  turtlebot_actions::FindFiducialResult result_;


};


int main(int argc, char** argv)
{
  ros::init(argc, argv, "find_fiducial_pose");

  FindFiducialAction find_fiducial(ros::this_node::getName());
  ros::spin();

  return 0;
}

CMakelists.txt

# toplevel CMakeLists.txt for a catkin workspace
# catkin/cmake/toplevel.cmake

cmake_minimum_required(VERSION 2.8.3)

set(CATKIN_TOPLEVEL TRUE)

# search for catkin within the workspace
set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}")
execute_process(COMMAND ${_cmd}
  RESULT_VARIABLE _res
  OUTPUT_VARIABLE _out
  ERROR_VARIABLE _err
  OUTPUT_STRIP_TRAILING_WHITESPACE
  ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT _res EQUAL 0 AND NOT _res EQUAL 2)
  # searching fot catkin resulted in an error
  string(REPLACE ";" " " _cmd_str "${_cmd}")
  message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}")
endif()

# include catkin from workspace or via find_package()
if(_res EQUAL 0)
  set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake")
  # include all.cmake without add_subdirectory to let it operate in same scope
  include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE)
  add_subdirectory("${_out}")

else()
  # use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
  # or CMAKE_PREFIX_PATH from the environment
  if(NOT DEFINED CMAKE_PREFIX_PATH)
    if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
      string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
    endif()
  endif()

  # list of catkin workspaces
  set(catkin_search_path "")
  foreach(path ${CMAKE_PREFIX_PATH})
    if(EXISTS "${path}/.catkin")
      list(FIND catkin_search_path ${path} _index)
      if(_index EQUAL -1)
        list(APPEND catkin_search_path ${path})
      endif()
    endif()
  endforeach()

  # search for catkin in all workspaces
  set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE)
  find_package(catkin QUIET
    NO_POLICY_SCOPE
    PATHS ${catkin_search_path}
    NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  unset(CATKIN_TOPLEVEL_FIND_PACKAGE)

  if(NOT catkin_FOUND)
    message(FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.")
  endif()
endif()

catkin_workspace()

please help me or any suggestions

thank you in advance

Asked by Redhwan on 2019-04-17 07:51:36 UTC

Comments

Please add you CMakeLists.txt, it will help probably

Asked by kosmastsk on 2019-04-17 10:22:10 UTC

Thanks, I added it

Asked by Redhwan on 2019-04-17 19:19:25 UTC

That is the wrong CMakeLists.txt. You should show the one from the respective package.

On the other hand, seeing that you are working on Indigo (to be EOL'd at the end of the month) on Ubuntu 14.04, but using a (custom installed) opencv4 (/usr/local/include/opencv4, released november 2018), I highly doubt this can be fixed. opencv2.4 was the default for indigo. I'd suggest to switch to ROS melodic and use the default opencv3...

Asked by mgruhler on 2019-04-23 01:41:33 UTC

Thank you @mgruhler, I know which the indigo and Ubuntu 14.04 end of the month but I need to finish my project. you mean I can't fix it???

Asked by Redhwan on 2019-04-23 02:24:12 UTC

well, when using opencv4 (which is not even the default version of opencv for melodic, we have opencv3 >= 3.2 there), I guess you'll have a hard time. And this is very, very specific. You might be able to fix it, but with a lot of manual fiddling and compiling packages from source... I'd not recommend going that route. Sticking to the default opencv version shipped with ROS is what worked for me best. But then again I'm no expert there...

Asked by mgruhler on 2019-04-23 04:13:37 UTC

Answers