cpp-multiCameraServer won't build

I’ve installed the 2020.2.1 raspberry pi image. When I try to build the cpp-multiCameraServer, I get the following output…

pi@frcvision(rw):~/examples/cpp-multiCameraServer$ make install
g++ -pthread -g -Og -c -o main.o -std=c++17 -I/usr/local/frc/include -I/usr/local/frc/include/opencv -I/usr/local/frc/include main.cpp
In file included from /usr/include/c++/8/vector:69,
from main.cpp:11:
/usr/include/c++/8/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& …) [with _Args = {{anonymous}::CameraConfig}; _Tp = {anonymous}::CameraConfig; _Alloc = std::allocator<{anonymous}::CameraConfig>]’:
/usr/include/c++/8/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector<{anonymous}::CameraConfig>::iterator’ {aka ‘__gnu_cxx::__normal_iterator<{anonymous}::CameraConfig*, std::vector<{anonymous}::CameraConfig> >’} changed in GCC 7.1
vector<_Tp, _Alloc>::
^~~~~~~~~~~~~~~~~~~
/usr/include/c++/8/bits/vector.tcc: In member function ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& …) [with _Args = {{anonymous}::CameraConfig}; _Tp = {anonymous}::CameraConfig; _Alloc = std::allocator<{anonymous}::CameraConfig>]’:
/usr/include/c++/8/bits/vector.tcc:109:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<{anonymous}::CameraConfig*, std::vector<{anonymous}::CameraConfig> >’ changed in GCC 7.1
_M_realloc_insert(end(), std::forward<_Args>(__args)…);
^~~~~~~~~~~~~~~~~
g++ -pthread -g -o multiCameraServerExample main.o -L/usr/local/frc/lib -lwpilibc -lwpiHal -lcameraserver -lntcore -lcscore -lopencv_dnn -lopencv_highgui -lopencv_ml -lopencv_objdetect -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_videoio -lopencv_imgcodecs -lopencv_features2d -lopencv_video -lopencv_photo -lopencv_imgproc -lopencv_flann -lopencv_core -lwpiutil -latomic -Wl,–unresolved-symbols=ignore-in-shared-libs
cp multiCameraServerExample runCamera /home/pi/

Should this build right out of the box?
Thanks.

That looks like a successful build to me. The messages are notes, not errors. Is there a multiCameraServerExample executable file in the current directory? If so, it successfully built.

1 Like

Great. I was looking for the output in the pi folder, which threw me.

I was getting the executable in the project folder. By the way, is there any way to fix this so we don’t get warnings when building the project? Thanks for your help.

One more problem, when we try to build the code we get this error:

terminate called after throwing an instance of ‘cv::Exception’
what(): OpenCV(3.4.7) /__w/1/s/work/2020-01-19-FRCVision/stage3/rootfs/usr/src/opencv-3.4.7/modules/imgproc/src/lsd.cpp:139: error: (-213:The function/feature is not implemented) Implementation has been removed due original code license issues in function ‘LineSegmentDetectorImpl’

We are using LineSegmentDetector, which apparently has been removed from the version of OpenCV on the current FRC RasPi image. Will last year’s FRC RasPi image still work without problems if we use it this year. Our code has no problem in last year’s image.

Thanks again.

I can’t help with the OpenCV one, as it sounds like it was removed upstream. We upgraded from OpenCV 3.4.4 to 3.4.7 for the 2020 image. It’s always your option to use last year’s image, it will interoperate just fine with NetworkTables etc.

Regarding the (nuisance) warning, you can disable it by adding -Wno-psabi to CFLAGS.

Awesome, we will just use last years image which is working fine.

FYI for everyone, if you are using GRIP, the Find Lines command generates C++ code that uses LineSegmentDetector, which OpenCV no longer supports.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.