moveit / moveit_calibration

Hand-eye calibration tools for robot arms.
BSD 3-Clause "New" or "Revised" License
132 stars 76 forks source link

Catkin Build Failed #124

Closed ericahellscythe closed 1 year ago

ericahellscythe commented 2 years ago

Hi I was following the instructions from a moveit tutorial.

mkdir -p ~/ws_moveit/src
cd ~/ws_moveit/src

wstool init .
wstool merge -t . https://raw.githubusercontent.com/ros-planning/moveit/master/moveit.rosinstall
wstool remove  moveit_tutorials  # this is cloned in the next section
wstool update -t .

This is a section of the tutorial I followed and I also git cloned this repo. Now I'm trying to catkin build and it failed. I found another closed issue posted but there was no solution to it hence this new post. Also, it is worth noting that I am using a jetson orin which might be the reason why?

Errors     << moveit_calibration_plugins:cmake /home/arm-orin-01/nat_ws/logs/moveit_calibration_plugins/build.cmake.002.log
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find OpenCV (missing: aruco) (found version "4.5.4")
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/lib/aarch64-linux-gnu/cmake/opencv4/OpenCVConfig.cmake:354 (find_package_handle_standard_args)
  CMakeLists.txt:22 (find_package)

cd /home/arm-orin-01/nat_ws/build/moveit_calibration_plugins; catkin build --get-env moveit_calibration_plugins | catkin env -si  /usr/bin/cmake /home/arm-orin-01/nat_ws/src/moveit_calibration/moveit_calibration_plugins --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/arm-orin-01/nat_ws/devel/.private/moveit_calibration_plugins -DCMAKE_INSTALL_PREFIX=/home/arm-orin-01/nat_ws/install; cd -

............................................

Please advice thank you.

ericahellscythe commented 1 year ago

Solution:

git clone https://github.com/ros-planning/moveit_calibration.git

Afterwards, go to Moveit calibration > moveit calibration plugins > cmakelist.txt and edit the file with the changes below:

find_package(OpenCV REQUIRED imgcodecs aruco)

find_package(OpenCV 4)

You will also need to git clone opencv_contrib to your src folder. Then open the opencv_contrib folder and go into the modules folder. Copy the opencv2 folder found in aruco > include and paste it in the moveit_calibration folder inside moveit_calibration_plugins > handeye_calibration_target > include and every single sub folder inside it too just to make sure the header file can find the aruco.

junaun commented 1 year ago

opencv_contrib version must be 4.6.0 and below (doesn't work with 4.7.0) git clone https://github.com/opencv/opencv_contrib.git cd opencv_contrib git checkout 4.6.0