intel / ros2_grasp_library

https://intel.github.io/ros2_grasp_library
Apache License 2.0
177 stars 43 forks source link

handeye_target_detection use case #62

Open portgasray opened 4 years ago

portgasray commented 4 years ago

colcon build error:

ros2_ws/src/ros2_grasp_library/grasp_utils/handeye_target_detection/src/pose_estimator.cpp In member function ‘void PoseEstimator::imageCB_CHARUCO(const ConstSharedPtr&)’:
/home/lab001/ros2_ws/src/ros2_grasp_library/grasp_utils/handeye_target_detection/src/pose_estimator.cpp:353:19: error: ‘struct cv::aruco::DetectorParameters’ has no member named ‘cornerRefinementMethod’; did you mean ‘cornerRefinementWinSize’?
       params_ptr->cornerRefinementMethod = cv::aruco::CORNER_REFINE_SUBPIX;
                   ^~~~~~~~~~~~~~~~~~~~~~
                   cornerRefinementWinSize
/home/lab001/ros2_ws/src/ros2_grasp_library/grasp_utils/handeye_target_detection/src/pose_estimator.cpp:353:55: error: ‘CORNER_REFINE_SUBPIX’ is not a member of ‘cv::aruco’
       params_ptr->cornerRefinementMethod = cv::aruco::CORNER_REFINE_SUBPIX;
                                                       ^~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/pose_estimation.dir/src/pose_estimator.cpp.o] Error 1

error

cause by opencv, I am not sure.

portgasray commented 4 years ago

I tried to uninstall OpenCV, my former version is 4.1.2. I really put my foot in my mouth, I deleted all the relevant opencv files by a script from the internet, and this manner took me almost 3 hours to recover the environment, it's a profound lesson l learned. fortunately, I solved this problem by re-install opencv 3.4.2 (same as the document OPEN_SOURCE_CODE_README, recommend to use it!)

RoboticsYY commented 4 years ago

Yes, the aruco marker only works with OpenCV 3.x. Your OpenCV 4.x is installed from OpenVINO install. Next time you can change your CMakeLists.txt to find_package(OpenCV 3.4 REQUIRED) to avoid manually removing all the OpenCV binaries. Or use install commands in rdk to install all the connected components, regarding the recent pains in the installation process.

Good reminding to add support to OpenCV 4.x. Thanks for reporting the issue.