Conversation
… on the version found in CMakelists.txt
|
Why is the CI failing, it should continue working with the old versions right? |
|
Not sure, Re-running the build. |
|
Found the issue, it is failing because travis build is happening for ubuntu < 20.04 with opencv 3.2.0 and this branch is particularly for opencv 4.x and ubuntu 20.04. We have to setup build for this configuration. |
vik748
left a comment
There was a problem hiding this comment.
Looks like the Open CV version check ifdef is flipped. Also there are more opecv calls that need version checks:
Relevant line from travis build log:
80%] Building CXX object spinnaker_sdk_camera_driver/CMakeFiles/acquilib.dir/src/camera.cpp.o
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp: In member function ‘void acquisition::Capture::save_mat_frames(int)’:
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:835:50: error: ‘imwrite’ was not declared in this scope
imwrite(dump_img_.c_str(), frames_[i]);
^
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:850:47: error: ‘imwrite’ was not declared in this scope
imwrite(filename.str(), frames_[i]);
^
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp: In member function ‘void acquisition::Capture::run_soft_trig()’:
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:1001:42: error: ‘CV_WINDOW_NORMAL’ was not declared in this scope
if (LIVE_)namedWindow("Acquisition", CV_WINDOW_NORMAL | CV_WINDOW_KEEPRATIO);
^
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:1001:61: error: ‘CV_WINDOW_KEEPRATIO’ was not declared in this scope
if (LIVE_)namedWindow("Acquisition", CV_WINDOW_NORMAL | CV_WINDOW_KEEPRATIO);
^
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:1001:80: error: ‘namedWindow’ was not declared in this scope
if (LIVE_)namedWindow("Acquisition", CV_WINDOW_NORMAL | CV_WINDOW_KEEPRATIO);
^
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:1044:48: error: ‘imshow’ was not declared in this scope
imshow("Acquisition", grid_);
^
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:1046:56: error: ‘imshow’ was not declared in this scope
imshow("Acquisition", frames_[CAM_]);
^
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:1049:56: error: ‘displayOverlay’ was not declared in this scope
displayOverlay("Acquisition", title);
^
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:1053:34: error: ‘cvWaitKey’ was not declared in this scope
int key = cvWaitKey(1);
^
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:1081:41: error: ‘cvDestroyAllWindows’ was not declared in this scope
cvDestroyAllWindows();
^
/ros_ws/src/spinnaker_sdk_camera_driver/src/capture.cpp:1114:41: error: ‘cvDestroyAllWindows’ was not declared in this scope
cvDestroyAllWindows();
^
|
One thought, all these ifdefs make it really hard to read the code. How about we reaname all the calls to the new open cv functions. Then in one place do a OpenCV version check and then assign function aliases to the old opencv functions if needed. This way there should only be 1 if def. Aliases: https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/ |
…r non-void function. (#152) * Debug error on older versions * Add aliases * Add aliases 2 * Add aliases 3 * Add aliases 4 * Add alises 5 * Add aliases 7 * Add aliases 8 * ADD aliases 9
|
@PushyamiKaveti @mithundiddi this should fix the issue building. Please try it out once. |
@mithundiddi @jpsnir Please review and merge. OpenCV update for ubuntu 20.04