CopterExpress / clover

ROS-based framework and RPi image to control PX4-powered drones 🍀
https://clover.coex.tech
MIT License
415 stars 265 forks source link

AttributeError: module 'cv2.aruco' has no attribute 'DetectorParameters_create' #495

Closed yousef337 closed 1 year ago

yousef337 commented 1 year ago

I have been following the documentation at https://github.com/CopterExpress/clover/blob/master/docs/en/simulation_native.md for running the simulation in ROS Noetic and have faced the following error AttributeError: module 'cv2.aruco' has no attribute 'DetectorParameters_create'.

I am trying to build and run the simulation in an Apptainer writable container based in ROS Noetic (Ubuntu)

okalachev commented 1 year ago

This is actually strange since the simulation itself doesn't run any Python code that uses OpenCV.

Maybe you're trying to run some OpenCV example using wrong Python version or something like that?

yousef337 commented 1 year ago

It does import opencv in clover/aruco_pose/cfg/Detector.cfg, the error occurs on the 7th line of that file. The error appears during catkin_make, before running any python scripts

okalachev commented 1 year ago

OpenCV and python3-opencv should be installed during the rosdep install step, since aruco_pose package depends on cv_bridge.

If you somehow don't have these packages installed, then please try to install them and repeat.

yousef337 commented 1 year ago

opencv is installed, the problem is not opencv is not there, but aruco_pose called a function in opencv that doesn't exist

okalachev commented 1 year ago

OK, I guess you have another opencv-python version with changed API. I tried to fix this script for this version, please, pull the repo and try to build again.