I am following the standard instructions to run command and error info as following(I have deleted the middle part of the information because of the world limit):
zsq@zsq:~/package/PX4-Autopilot$ make px4_sitl_default gazebo
[0/4] Performing build step for 'sitl_gazebo-classic'
[1/67] Building CXX object CMakeFiles/gazebo_aruco_plugin.dir/src/gazebo_aruco_plugin.cpp.o
FAILED: CMakeFiles/gazebo_aruco_plugin.dir/src/gazebo_aruco_plugin.cpp.o
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_DATE_TIME_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_TEST_DYN_LINK -DBOOST_THREAD_DYN_LINK -DLIBBULLET_VERSION=2.88 -DLIBBULLET_VERSION_GT_282 -Dgazebo_aruco_plugin_EXPORTS -I/home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include -I. -I/usr/include/eigen3/eigen3 -I/usr/include/gazebo-11/gazebo/msgs -I/home/zsq/package/PX4-Autopilot/build/px4_sitl_default/mavlink -I/home/zsq/package/PX4-Autopilot/build/px4_sitl_default/mavlink/mavlink/v2.0 -I/home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/external/OpticalFlow/include -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /usr/include/gazebo-11 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/include/sdformat-9.10 -isystem /usr/include/ignition/math6 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport8 -isystem /usr/include/ignition/msgs5 -isystem /usr/include/ignition/common3 -isystem /usr/include/ignition/fuel_tools4 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/eigen3 -isystem /usr/local/include/opencv4 -isystem /opt/ros/noetic/include -isystem /usr/include/sdformat-9.10/sdf/.. -isystem /usr/include/ignition/cmake2 -isystem /usr/include/uuid -O2 -g -DNDEBUG -fPIC -Wno-deprecated-declarations -Wno-address-of-packed-member -I/usr/include/uuid -std=gnu++17 -MD -MT CMakeFiles/gazebo_aruco_plugin.dir/src/gazebo_aruco_plugin.cpp.o -MF CMakeFiles/gazebo_aruco_plugin.dir/src/gazebo_aruco_plugin.cpp.o.d -o CMakeFiles/gazebo_aruco_plugin.dir/src/gazebo_aruco_plugin.cpp.o -c /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:61:20: error: redefinition of ‘class cv::aruco::Dictionary’
61 | class CV_EXPORTS_W Dictionary {
| ^~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:29:27: note: previous definition of ‘class cv::aruco::Dictionary’
29 | class CV_EXPORTS_W_SIMPLE Dictionary {
| ^~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:142:19: error: ‘DICT_4X4_50’ conflicts with a previous declaration
142 | DICT_4X4_50 = 0,
| ^
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:100:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_4X4_50’
100 | DICT_4X4_50 = 0, ///< 4x4 bits, minimum hamming distance between any two codes = 4, 50 codes
| ^~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:143:5: error: ‘DICT_4X4_100’ conflicts with a previous declaration
143 | DICT_4X4_100,
| ^~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:101:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_4X4_100’
101 | DICT_4X4_100, ///< 4x4 bits, minimum hamming distance between any two codes = 3, 100 codes
| ^~~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:144:5: error: ‘DICT_4X4_250’ conflicts with a previous declaration
144 | DICT_4X4_250,
| ^~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:102:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_4X4_250’
102 | DICT_4X4_250, ///< 4x4 bits, minimum hamming distance between any two codes = 3, 250 codes
| ^~~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:145:5: error: ‘DICT_4X4_1000’ conflicts with a previous declaration
145 | DICT_4X4_1000,
| ^~~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:103:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_4X4_1000’
103 | DICT_4X4_1000, ///< 4x4 bits, minimum hamming distance between any two codes = 2, 1000 codes
| ^~~~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:146:5: error: ‘DICT_5X5_50’ conflicts with a previous declaration
146 | DICT_5X5_50,
| ^~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:104:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_5X5_50’
104 | DICT_5X5_50, ///< 5x5 bits, minimum hamming distance between any two codes = 8, 50 codes
| ^~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:147:5: error: ‘DICT_5X5_100’ conflicts with a previous declaration
147 | DICT_5X5_100,
| ^~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:151:5: error: ‘DICT_6X6_100’ conflicts with a previous declaration
151 | DICT_6X6_100,
| ^~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:109:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_6X6_100’
109 | DICT_6X6_100, ///< 6x6 bits, minimum hamming distance between any two codes = 12, 100 codes
| ^~~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:152:5: error: ‘DICT_6X6_250’ conflicts with a previous declaration
152 | DICT_6X6_250,
| ^~~~~~~~~~~~
...
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:116:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_ARUCO_ORIGINAL’
116 | DICT_ARUCO_ORIGINAL, ///< 6x6 bits, minimum hamming distance between any two codes = 3, 1024 codes
| ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:159:5: error: ‘DICT_APRILTAG_16h5’ conflicts with a previous declaration
159 | DICT_APRILTAG_16h5, ///< 4x4 bits, minimum hamming distance between any two codes = 5, 30 codes
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:117:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_APRILTAG_16h5’
117 | DICT_APRILTAG_16h5, ///< 4x4 bits, minimum hamming distance between any two codes = 5, 30 codes
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:160:5: error: ‘DICT_APRILTAG_25h9’ conflicts with a previous declaration
160 | DICT_APRILTAG_25h9, ///< 5x5 bits, minimum hamming distance between any two codes = 9, 35 codes
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:118:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_APRILTAG_25h9’
118 | DICT_APRILTAG_25h9, ///< 5x5 bits, minimum hamming distance between any two codes = 9, 35 codes
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:161:5: error: ‘DICT_APRILTAG_36h10’ conflicts with a previous declaration
161 | DICT_APRILTAG_36h10, ///< 6x6 bits, minimum hamming distance between any two codes = 10, 2320 codes
| ^~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:119:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_APRILTAG_36h10’
119 | DICT_APRILTAG_36h10, ///< 6x6 bits, minimum hamming distance between any two codes = 10, 2320 codes
| ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:162:5: error: ‘DICT_APRILTAG_36h11’ conflicts with a previous declaration
162 | DICT_APRILTAG_36h11 ///< 6x6 bits, minimum hamming distance between any two codes = 11, 587 codes
| ^~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:120:5: note: previous declaration ‘cv::aruco::PredefinedDictionaryType cv::aruco::DICT_APRILTAG_36h11’
120 | DICT_APRILTAG_36h11, ///< 6x6 bits, minimum hamming distance between any two codes = 11, 587 codes
| ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/opencv2/aruco.hpp:44,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco/dictionary.hpp:175:30: error: ambiguating new declaration of ‘cv::Ptr<cv::aruco::Dictionary> cv::aruco::getPredefinedDictionary(int)’
175 | CV_EXPORTS_W Ptr<Dictionary> getPredefinedDictionary(int dict);
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:7,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_dictionary.hpp:132:25: note: old declaration ‘cv::aruco::Dictionary cv::aruco::getPredefinedDictionary(int)’
132 | CV_EXPORTS_W Dictionary getPredefinedDictionary(int dict);
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco.hpp:81:6: error: multiple definition of ‘enum cv::aruco::CornerRefineMethod’
81 | enum CornerRefineMethod{
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:16:6: note: previous definition here
16 | enum CornerRefineMethod{
| ^~~~~~~~~~~~~~~~~~
In file included from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco.hpp:150:21: error: redefinition of ‘struct cv::aruco::DetectorParameters’
150 | struct CV_EXPORTS_W DetectorParameters {
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:25:28: note: previous definition of ‘struct cv::aruco::DetectorParameters’
25 | struct CV_EXPORTS_W_SIMPLE DetectorParameters {
| ^~~~~~~~~~~~~~~~~~
In file included from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco.hpp:222:114: error: ‘create’ is not a member of ‘cv::aruco::DetectorParameters’
222 | OutputArray ids, const Ptr<DetectorParameters> ¶meters = DetectorParameters::create(),
| ^~~~~~
In file included from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco.hpp:272:20: error: redefinition of ‘class cv::aruco::Board’
272 | class CV_EXPORTS_W Board {
| ^~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:8,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_board.hpp:25:27: note: previous definition of ‘class cv::aruco::Board’
25 | class CV_EXPORTS_W_SIMPLE Board {
| ^~~~~
In file included from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco.hpp:303:20: error: redefinition of ‘class cv::aruco::GridBoard’
303 | class CV_EXPORTS_W GridBoard : public Board {
| ^~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:8,
from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_board.hpp:107:27: note: previous definition of ‘class cv::aruco::GridBoard’
107 | class CV_EXPORTS_W_SIMPLE GridBoard : public Board {
| ^~~~~~~~~
In file included from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco.hpp:437:108: error: ‘create’ is not a member of ‘cv::aruco::DetectorParameters’
437 | OutputArray recoveredIdxs = noArray(), const Ptr<DetectorParameters> ¶meters = DetectorParameters::create());
| ^~~~~~
/usr/include/opencv2/aruco.hpp:458:19: error: default argument given for parameter 3 of ‘void cv::aruco::drawDetectedMarkers(cv::InputOutputArray, cv::InputArrayOfArrays, cv::InputArray, cv::Scalar)’ [-fpermissive]
458 | CV_EXPORTS_W void drawDetectedMarkers(InputOutputArray image, InputArrayOfArrays corners,
| ^~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:346:19: note: previous specification in ‘void cv::aruco::drawDetectedMarkers(cv::InputOutputArray, cv::InputArrayOfArrays, cv::InputArray, cv::Scalar)’ here
346 | CV_EXPORTS_W void drawDetectedMarkers(InputOutputArray image, InputArrayOfArrays corners,
| ^~~~~~~~~~~~~~~~~~~
In file included from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:41,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/include/opencv2/aruco.hpp:458:19: error: default argument given for parameter 4 of ‘void cv::aruco::drawDetectedMarkers(cv::InputOutputArray, cv::InputArrayOfArrays, cv::InputArray, cv::Scalar)’
458 | CV_EXPORTS_W void drawDetectedMarkers(InputOutputArray image, InputArrayOfArrays corners,
| ^~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/opencv4/opencv2/objdetect.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:80,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/include/gazebo_aruco_plugin.h:40,
from /home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:31:
/usr/local/include/opencv4/opencv2/objdetect/aruco_detector.hpp:346:19: note: previous specification in ‘void cv::aruco::drawDetectedMarkers(cv::InputOutputArray, cv::InputArrayOfArrays, cv::InputArray, cv::Scalar)’ here
346 | CV_EXPORTS_W void drawDetectedMarkers(InputOutputArray image, InputArrayOfArrays corners,
| ^~~~~~~~~~~~~~~~~~~
/home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp: In member function ‘virtual void gazebo::arucoMarkerPlugin::Load(gazebo::sensors::SensorPtr, sdf::v9::ElementPtr)’:
/home/zsq/package/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/gazebo_aruco_plugin.cpp:170:57: error: ‘create’ is not a member of ‘cv::aruco::DetectorParameters’
170 | this->detectorParams = cv::aruco::DetectorParameters::create();
| ^~~~~~
ninja: build stopped: subcommand failed.
FAILED: external/Stamp/sitl_gazebo-classic/sitl_gazebo-classic-build
cd /home/zsq/package/PX4-Autopilot/build/px4_sitl_default/build_gazebo-classic && /usr/bin/cmake --build /home/zsq/package/PX4-Autopilot/build/px4_sitl_default/build_gazebo-classic -- -j 1
ninja: build stopped: subcommand failed.
make: *** [Makefile:227: px4_sitl_default] Error 1
Looks like it’s in conflict with my OpenCV.
I have installed the dependencies correctly.
Script mavros_posix_sitl.launch
and posix_sitl.launch
can be launched, then drone has displayed in Gazebo.
What should I do to fix the problem?
Any help would be appreciated.