Ask Your Question
0

Error when building package of calibration_publisher while installing Autoware

asked 2019-08-31 22:29:18 -0500

park gravatar image

updated 2019-09-01 06:15:02 -0500

gvdhoorn gravatar image

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

edit retag flag offensive close merge delete

Comments

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.

park gravatar imagepark ( 2019-09-01 05:19:15 -0500 )edit

Can you please provide information about your system? ROS version? Did you install OpenCV from source? (if so what version?).

amc-nu gravatar imageamc-nu ( 2019-09-02 01:14:59 -0500 )edit

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

park gravatar imagepark ( 2019-09-02 01:29:03 -0500 )edit

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).

amc-nu gravatar imageamc-nu ( 2019-09-02 02:48:27 -0500 )edit

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

park gravatar imagepark ( 2019-09-02 03:04:31 -0500 )edit

The error is caused by the codes in calibration_publisher.cpp;

fs["CameraExtrinsicMat"] >> CameraExtrinsicMat;
fs["CameraMat"] >> CameraMat;
fs["DistCoeff"] >> DistCoeff;
fs["ImageSize"] >> ImageSize;
fs["DistModel"] >> DistModel;
park gravatar imagepark ( 2019-09-02 03:09:05 -0500 )edit

Please use apt versions of OpenCV. The easiest way is to use rosdep to install the correct ones.

amc-nu gravatar imageamc-nu ( 2019-09-02 03:21:02 -0500 )edit

Yes I have also tried and it doesn't seem to be a problem of the OpenCV installation.

Now, I comment the following line:

fs["DistModel"] >> DistModel;

and passed the build, very strange.

park gravatar imagepark ( 2019-09-02 03:55:37 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2019-09-02 04:20:03 -0500

park gravatar image

updated 2019-09-02 04:21:24 -0500

I add a definition in the file of calibration_publisher.cpp:

static cv::Mat CameraExtrinsicMat;
static cv::Mat CameraMat;
static cv::Mat DistCoeff;
static cv::Size ImageSize;
static std::string DistModel
static cv::String DistModel_cv;

then modify the corresponding code to:

fs["DistModel"] >> DistModel_cv;
DistModel = DistModel_cv.operator std::string();

that is to convert cv::String to std::string, and the error is finally solved. I will test the demo next step.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-08-31 22:29:18 -0500

Seen: 34 times

Last updated: Sep 02