Error when building package of calibration_publisher while installing Autoware
In autoware 1.12.0, I build the packages as the tutorial from source, and I came across the errors by calibration_publisher as follows:
--- stderr: calibration_publisher
CMakeFiles/calibration_publisher.dir/src/calibration_publisher.cpp.o: In function `main':
calibration_publisher.cpp:(.text.startup+0x9b4): undefined reference to `cv::read(cv::FileNode const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [devel/lib/calibration_publisher/calibration_publisher] Error 1
make[1]: *** [CMakeFiles/calibration_publisher.dir/all] Error 2
make: *** [all] Error 2
Failed <<< calibration_publisher [ Exited with code 2 ]
Aborted <<< ds4
Aborted <<< detected_objects_visualizer
Aborted <<< decision_maker_panel
I have tried many times to fix it, but not work
I add an empty file named "COLCON_IGNORE" in the package of calibration_publisher to avoid the bug, and finally build successfully
Ignore calibration_publisher, the demo test will fail.
Can you please provide information about your system? ROS version? Did you install OpenCV from source? (if so what version?).
Sorry, I didn't provide enough information
Hardware Platform: Jetson AGX Xavier
OS: Ubuntu 18.04, installed by the SDK Manager
ROS: melodic, installed from sources by using installROSXavier script
OpenCV: version is 3.4.3, installed from sources by using buildOpenCVXavier script in the path /usr/local, and during install ROS, 3.2.0 is also installed in the path /usr
I also notice that the error also existed in opencv's answers camera_calibration.cpp: undefined reference to cv::read
I haven’t used the Jetson Hacks’ script you mentioned. I would recommend you to try a clean install. Don’t forget to run rosdep to install the opencv version to which ros’ cv_bridge was linked.( please also have in mind that Nvidia provides its own versions of OpenCV. In the case you selected that when you set up your AGX).
Yes, I have tried the version of OpenCV provided by Nvidia, but it also failed. Next step, I will try to build autoware 1.12.0 on a x86_64 platform for test
The error is caused by the codes in calibration_publisher.cpp;
Please use apt versions of OpenCV. The easiest way is to use rosdep to install the correct ones.
Yes I have also tried and it doesn't seem to be a problem of the OpenCV installation.
Now, I comment the following line:
and passed the build, very strange.