Skip to content
This repository was archived by the owner on Jan 11, 2019. It is now read-only.

vision_opencv: 2.0.4-0 in 'bouncy/distribution.yaml' [bloom]#260

Closed
gaoethan wants to merge 1 commit intoros2:ros2from
gaoethan:bloom-vision_opencv-1
Closed

vision_opencv: 2.0.4-0 in 'bouncy/distribution.yaml' [bloom]#260
gaoethan wants to merge 1 commit intoros2:ros2from
gaoethan:bloom-vision_opencv-1

Conversation

@gaoethan
Copy link
Copy Markdown

Increasing version of package(s) in repository vision_opencv to 2.0.4-0:

cv_bridge

* Add libopencv-dev as dependency of cv_bridge
* Replace assert_equal with assert to remove dependency to nose package
* Contributor: Ethan Gao

image_geometry

  • No changes

vision_opencv

  • No changes

@gaoethan
Copy link
Copy Markdown
Author

This is a new one after addressing the issues of #259

@mikaelarguedas
Copy link
Copy Markdown
Member

@gaoethan any progress on fixing the hanging cv_bridge tests ? (linking past discussions for cross-reference: ros-perception/vision_opencv#221, ros2/vision_opencv#13 (comment) and #257 (comment)).

Also please note that the development jobs are failing due to some test dependencies that are find_package'd outside of a BUILD_TESTING conditional https://github.com/ros-perception/vision_opencv/blob/a80ea5085bb3ababca0bd9619c7168473c9d0807/cv_bridge/CMakeLists.txt#L49

@mjcarroll
Copy link
Copy Markdown
Member

I'm also watching this, as cv_bridge is a dep for getting image_transport released.

@gaoethan
Copy link
Copy Markdown
Author

Thanks for your feedback @mikaelarguedas so... now all the test dependencies are required to be underneath BUILD_TESTING from colcon, right ?

In addition, all the build warning/nose assert_equal issue had already fixed before, the failure of conversion.py doesn't occcur with my opencv 3.4, maybe it relates to opencv3.2, I'll double check.

@mikaelarguedas
Copy link
Copy Markdown
Member

now all the test dependencies are required to be underneath BUILD_TESTING from colcon, right ?

In ROS (1 and 2), test dependencies should be find_package'd and used only in the part of the CMake code that builds/register tests. This is independent of colcon.
Test dependencies are not installed for building and installing the package, this is done to ensure that all dependencies necessary to build and use the package are properly declared.

In addition, all the build warning/nose assert_equal issue had already fixed before, the failure of conversion.py doesn't occcur with my opencv 3.4, maybe it relates to opencv3.2, I'll double check.

Yes I am referring to the hanging conversion.py test.
You should be able to reproduce thes test failures by running the commands listed here and then run colcon test --event-handlers console_direct+.
Test log below

Test log
UpdateCTestConfiguration  from :/root/vision_opencv_ws/build/cv_bridge/DartConfiguration.tcl
Parse Config file:/root/vision_opencv_ws/build/cv_bridge/DartConfiguration.tcl
   Site: e261f344e625
   Build name: Linux-c++
 Add coverage exclude regular expressions.
SetCTestConfiguration:CMakeCommand:/usr/bin/cmake
Create new tag: 20180815-0449 - Experimental
UpdateCTestConfiguration  from :/root/vision_opencv_ws/build/cv_bridge/DartConfiguration.tcl
Parse Config file:/root/vision_opencv_ws/build/cv_bridge/DartConfiguration.tcl
Test project /root/vision_opencv_ws/build/cv_bridge
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
      Start  1: copyright

1: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/copyright.xunit.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_copyright/copyright.txt" "--command" "/opt/ros/bouncy/bin/ament_copyright" "--xunit-file" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/copyright.xunit.xml"
1: Test timeout computed to be: 60
1: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
1:  - /opt/ros/bouncy/bin/ament_copyright --xunit-file /root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/copyright.xunit.xml
1: CONTRIBUTING.md: file not found
1: LICENSE: file not found
1: doc/conf.py: could not find copyright notice
1: include/cv_bridge/cv_bridge.h: could not find copyright notice
1: include/cv_bridge/rgb_colors.h: could not find copyright notice
1: python/cv_bridge/__init__.py: could not find copyright notice
1: python/cv_bridge/core.py: copyright=Willow Garage, Inc. (2011), Tal Regev. (2016), Intel Corporation. (2018), license=<unknown>
1: src/cv_bridge.cpp: could not find copyright notice
1: src/module.cpp: could not find copyright notice
1: src/module.hpp: copyright=Open Source Robotics Foundation, Inc. (2014), license=<unknown>
1: src/module_opencv2.cpp: could not find copyright notice
1: src/module_opencv3.cpp: could not find copyright notice
1: src/pycompat.hpp: copyright=Intel Corporation. (2018), license=<unknown>
1: src/rgb_colors.cpp: could not find copyright notice
1: test/conversions.py: could not find copyright notice
1: test/enumerants.py: could not find copyright notice
1: test/python_bindings.py: could not find copyright notice
1: test/test_compression.cpp: could not find copyright notice
1: test/test_endian.cpp: could not find copyright notice
1: test/test_rgb_colors.cpp: could not find copyright notice
1: test/utest.cpp: could not find copyright notice
1: test/utest2.cpp: could not find copyright notice
1: 22 errors, checked 22 files
1: -- run_test.py: return code 1
1: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/copyright.xunit.xml'
 1/11 Test  #1: copyright ........................***Failed    0.25 sec
test 2
      Start  2: cppcheck

2: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cppcheck.xunit.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_cppcheck/cppcheck.txt" "--command" "/opt/ros/bouncy/bin/ament_cppcheck" "--xunit-file" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cppcheck.xunit.xml"
2: Test timeout computed to be: 60
2: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
2:  - /opt/ros/bouncy/bin/ament_cppcheck --xunit-file /root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cppcheck.xunit.xml
2: [include/cv_bridge/rgb_colors.h:42]: (error: syntaxError) Code 'namespacecv_bridge{' is invalid C code. Use --std or --language to configure the language.
2: [include/cv_bridge/cv_bridge.h:50]: (error: syntaxError) Code 'namespacecv_bridge{' is invalid C code. Use --std or --language to configure the language.
2: 2 errors
2: -- run_test.py: return code 1
2: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cppcheck.xunit.xml'
 2/11 Test  #2: cppcheck .........................***Failed    0.35 sec
test 3
      Start  3: cpplint

3: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cpplint.xunit.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_cpplint/cpplint.txt" "--command" "/opt/ros/bouncy/bin/ament_cpplint" "--xunit-file" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cpplint.xunit.xml"
3: Test timeout computed to be: 120
3: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
3:  - /opt/ros/bouncy/bin/ament_cpplint --xunit-file /root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cpplint.xunit.xml
3: /root/vision_opencv_ws/src/vision_opencv-release/src/cv_bridge.cpp:604:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  Use C++11 raw strings or concatenation instead.  [readability/multiline_string] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/cv_bridge.cpp:604:  Use operator ! instead of not  [readability/alt_tokens] [2]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/cv_bridge.cpp:605:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  Use C++11 raw strings or concatenation instead.  [readability/multiline_string] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/cv_bridge.cpp:605:  Use operator || instead of or  [readability/alt_tokens] [2]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/cv_bridge.cpp:605:  Use operator && instead of and  [readability/alt_tokens] [2]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/cv_bridge.cpp:654:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  Use C++11 raw strings or concatenation instead.  [readability/multiline_string] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/cv_bridge.cpp:655:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  Use C++11 raw strings or concatenation instead.  [readability/multiline_string] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/module_opencv2.cpp:39:  Do not use namespace using-directives.  Use using-declarations instead.  [build/namespaces] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/module_opencv3.cpp:0:  No copyright message found.  You should have a line: "Copyright [year] <Copyright Owner>"  [legal/copyright] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/module_opencv3.cpp:80:  Do not use namespace using-directives.  Use using-declarations instead.  [build/namespaces] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/module_opencv3.cpp:290:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  Use C++11 raw strings or concatenation instead.  [readability/multiline_string] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/module_opencv3.cpp:291:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  Use C++11 raw strings or concatenation instead.  [readability/multiline_string] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/module_opencv3.cpp:291:  Use operator || instead of or  [readability/alt_tokens] [2]
3: /root/vision_opencv_ws/src/vision_opencv-release/src/pycompat.hpp:0:  No copyright message found.  You should have a line: "Copyright [year] <Copyright Owner>"  [legal/copyright] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/test/test_compression.cpp:0:  No copyright message found.  You should have a line: "Copyright [year] <Copyright Owner>"  [legal/copyright] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/test/test_endian.cpp:0:  No copyright message found.  You should have a line: "Copyright [year] <Copyright Owner>"  [legal/copyright] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/test/test_endian.cpp:8:  Do not use namespace using-directives.  Use using-declarations instead.  [build/namespaces] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/test/test_rgb_colors.cpp:0:  No copyright message found.  You should have a line: "Copyright [year] <Copyright Owner>"  [legal/copyright] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/test/utest.cpp:0:  No copyright message found.  You should have a line: "Copyright [year] <Copyright Owner>"  [legal/copyright] [5]
3: /root/vision_opencv_ws/src/vision_opencv-release/test/utest2.cpp:46:  Do not use namespace using-directives.  Use using-declarations instead.  [build/namespaces] [5]
3: Category 'build/namespaces' errors found: 4
3: Category 'legal/copyright' errors found: 6
3: Category 'readability/alt_tokens' errors found: 4
3: Category 'readability/multiline_string' errors found: 6
3: Total errors found: 20
3: Using '--root=/root/vision_opencv_ws/src/vision_opencv-release/include' argument
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/include/cv_bridge/cv_bridge.h
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/include/cv_bridge/rgb_colors.h
3: 
3: Using '--root=/root/vision_opencv_ws/src/vision_opencv-release/src' argument
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/src/cv_bridge.cpp
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/src/module.cpp
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/src/module.hpp
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/src/module_opencv2.cpp
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/src/module_opencv3.cpp
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/src/pycompat.hpp
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/src/rgb_colors.cpp
3: 
3: Using '--root=/root/vision_opencv_ws/src/vision_opencv-release/test' argument
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/test/test_compression.cpp
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/test/test_endian.cpp
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/test/test_rgb_colors.cpp
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/test/utest.cpp
3: 
3: Done processing /root/vision_opencv_ws/src/vision_opencv-release/test/utest2.cpp
3: 
3: -- run_test.py: return code 1
3: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cpplint.xunit.xml'
 3/11 Test  #3: cpplint ..........................***Failed    0.82 sec
test 4
      Start  4: flake8

4: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/flake8.xunit.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_flake8/flake8.txt" "--command" "/opt/ros/bouncy/bin/ament_flake8" "--xunit-file" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/flake8.xunit.xml"
4: Test timeout computed to be: 60
4: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
4:  - /opt/ros/bouncy/bin/ament_flake8 --xunit-file /root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/flake8.xunit.xml
4: 
4: ./python/cv_bridge/core.py:86:100: E501 line too long (102 > 99 characters)
4:         self.numpy_type_to_cvtype.update(dict((v, k) for (k, v) in self.numpy_type_to_cvtype.items()))
4:                                                                                                    ^
4: 
4: ./python/cv_bridge/core.py:173:100: E501 line too long (107 > 99 characters)
4:         img_buf = np.asarray(img_msg.data, dtype=dtype) if isinstance(img_msg.data, list) else img_msg.data
4:                                                                                                    ^
4: 
4: ./python/cv_bridge/__init__.py:1:1: F401 '.core.CvBridge' imported but unused
4: from .core import CvBridge, CvBridgeError
4: ^
4: 
4: ./python/cv_bridge/__init__.py:1:1: F401 '.core.CvBridgeError' imported but unused
4: from .core import CvBridge, CvBridgeError
4: ^
4: 
4: ./python/cv_bridge/__init__.py:6:5: F401 'cv_bridge.boost.cv_bridge_boost.cvtColorForDisplay' imported but unused
4:     from cv_bridge.boost.cv_bridge_boost import cvtColorForDisplay, getCvType
4:     ^
4: 
4: ./python/cv_bridge/__init__.py:6:5: F401 'cv_bridge.boost.cv_bridge_boost.getCvType' imported but unused
4:     from cv_bridge.boost.cv_bridge_boost import cvtColorForDisplay, getCvType
4:     ^
4: 
4: 2     E501 line too long (102 > 99 characters)
4: 4     F401 '.core.CvBridge' imported but unused
4: 
4: 7 files checked
4: 6 errors
4: 
4: 'E'-type errors: 2
4: 'F'-type errors: 4
4: 
4: Checked files:
4: 
4: * ./setup.py
4: * ./python/cv_bridge/core.py
4: * ./python/cv_bridge/__init__.py
4: * ./doc/conf.py
4: * ./test/conversions.py
4: * ./test/enumerants.py
4: * ./test/python_bindings.py
4: -- run_test.py: return code 1
4: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/flake8.xunit.xml'
 4/11 Test  #4: flake8 ...........................***Failed    0.43 sec
test 5
      Start  5: lint_cmake

5: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/lint_cmake.xunit.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_lint_cmake/lint_cmake.txt" "--command" "/opt/ros/bouncy/bin/ament_lint_cmake" "--xunit-file" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/lint_cmake.xunit.xml"
5: Test timeout computed to be: 60
5: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
5:  - /opt/ros/bouncy/bin/ament_lint_cmake --xunit-file /root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/lint_cmake.xunit.xml
5: 
5: No errors
5: -- run_test.py: return code 0
5: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/lint_cmake.xunit.xml'
 5/11 Test  #5: lint_cmake .......................   Passed    0.23 sec
test 6
      Start  6: pep257

6: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/pep257.xunit.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_pep257/pep257.txt" "--command" "/opt/ros/bouncy/bin/ament_pep257" "--xunit-file" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/pep257.xunit.xml"
6: Test timeout computed to be: 60
6: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
6:  - /opt/ros/bouncy/bin/ament_pep257 --xunit-file /root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/pep257.xunit.xml
6: checking ./doc/conf.py
6: checking ./python/cv_bridge/__init__.py
6: checking ./python/cv_bridge/core.py
6: checking ./setup.py
6: checking ./test/conversions.py
6: checking ./test/enumerants.py
6: checking ./test/python_bindings.py
6: No errors
6: -- run_test.py: return code 0
6: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/pep257.xunit.xml'
 6/11 Test  #6: pep257 ...........................   Passed    0.37 sec
test 7
      Start  7: uncrustify

7: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/uncrustify.xunit.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_uncrustify/uncrustify.txt" "--command" "/opt/ros/bouncy/bin/ament_uncrustify" "--xunit-file" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/uncrustify.xunit.xml"
7: Test timeout computed to be: 60
7: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
7:  - /opt/ros/bouncy/bin/ament_uncrustify --xunit-file /root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/uncrustify.xunit.xml
7: Code style divergence in file 'src/module.cpp':
7: 
7: --- src/module.cpp
7: +++ src/module.cpp.uncrustify
7: @@ -118 +118 @@
7: -  ));
7: +    ));
7: 
7: Code style divergence in file 'src/module_opencv3.cpp':
7: 
7: --- src/module_opencv3.cpp
7: +++ src/module_opencv3.cpp.uncrustify
7: @@ -106 +106 @@
7: -      reinterpret_cast<uchar *>(PyArray_DATA(reinterpret_cast<PyArrayObject *>(o)));
7: +        reinterpret_cast<uchar *>(PyArray_DATA(reinterpret_cast<PyArrayObject *>(o)));
7: 
7: 2 files with code style divergence
7: No code style divergence in file 'include/cv_bridge/cv_bridge.h'
7: 
7: No code style divergence in file 'include/cv_bridge/rgb_colors.h'
7: 
7: No code style divergence in file 'src/cv_bridge.cpp'
7: 
7: No code style divergence in file 'src/module.hpp'
7: 
7: No code style divergence in file 'src/module_opencv2.cpp'
7: 
7: No code style divergence in file 'src/pycompat.hpp'
7: 
7: No code style divergence in file 'src/rgb_colors.cpp'
7: 
7: No code style divergence in file 'test/test_compression.cpp'
7: 
7: No code style divergence in file 'test/test_endian.cpp'
7: 
7: No code style divergence in file 'test/test_rgb_colors.cpp'
7: 
7: No code style divergence in file 'test/utest.cpp'
7: 
7: No code style divergence in file 'test/utest2.cpp'
7: 
7: -- run_test.py: return code 1
7: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/uncrustify.xunit.xml'
 7/11 Test  #7: uncrustify .......................***Failed    0.33 sec
test 8
      Start  8: cv_bridge-utest

8: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cv_bridge-utest.gtest.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_cmake_gtest/cv_bridge-utest.txt" "--append-env" "LD_LIBRARY_PATH=/root/vision_opencv_ws/build/cv_bridge/src" "--command" "/root/vision_opencv_ws/build/cv_bridge/test/cv_bridge-utest" "--gtest_output=xml:/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cv_bridge-utest.gtest.xml"
8: Test timeout computed to be: 60
8: -- run_test.py: extra environment variables to append:
8:  - LD_LIBRARY_PATH+=/root/vision_opencv_ws/build/cv_bridge/src
8: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
8:  - /root/vision_opencv_ws/build/cv_bridge/test/cv_bridge-utest --gtest_output=xml:/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cv_bridge-utest.gtest.xml
8: [==========] Running 9 tests from 3 test cases.
8: [----------] Global test environment set-up.
8: [----------] 7 tests from CvBridgeTest
8: [ RUN      ] CvBridgeTest.endianness
8: [       OK ] CvBridgeTest.endianness (3 ms)
8: [ RUN      ] CvBridgeTest.compression
8: [       OK ] CvBridgeTest.compression (2 ms)
8: [ RUN      ] CvBridgeTest.NonContinuous
8: [       OK ] CvBridgeTest.NonContinuous (0 ms)
8: [ RUN      ] CvBridgeTest.ChannelOrder
8: [       OK ] CvBridgeTest.ChannelOrder (0 ms)
8: [ RUN      ] CvBridgeTest.initialization
8: [       OK ] CvBridgeTest.initialization (10 ms)
8: [ RUN      ] CvBridgeTest.imageMessageStep
8: [       OK ] CvBridgeTest.imageMessageStep (0 ms)
8: [ RUN      ] CvBridgeTest.imageMessageConversion
8: [       OK ] CvBridgeTest.imageMessageConversion (2 ms)
8: [----------] 7 tests from CvBridgeTest (17 ms total)
8: 
8: [----------] 1 test from OpencvTests
8: [ RUN      ] OpencvTests.testCase_encode_decode
8: [       OK ] OpencvTests.testCase_encode_decode (471 ms)
8: [----------] 1 test from OpencvTests (471 ms total)
8: 
8: [----------] 1 test from RGBColors
8: [ RUN      ] RGBColors.testGetRGBColor
8: [       OK ] RGBColors.testGetRGBColor (0 ms)
8: [----------] 1 test from RGBColors (0 ms total)
8: 
8: [----------] Global test environment tear-down
8: [==========] 9 tests from 3 test cases ran. (488 ms total)
8: [  PASSED  ] 9 tests.
8: -- run_test.py: return code 0
8: -- run_test.py: inject classname prefix into gtest result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cv_bridge-utest.gtest.xml'
8: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/cv_bridge-utest.gtest.xml'
 8/11 Test  #8: cv_bridge-utest ..................   Passed    0.70 sec
test 9
      Start  9: enumerants.py

9: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/enumerants.py.xunit.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_cmake_pytest/enumerants.py.txt" "--command" "/usr/bin/python3" "-u" "-m" "pytest" "/root/vision_opencv_ws/src/vision_opencv-release/test/enumerants.py" "-o" "cache_dir=/root/vision_opencv_ws/build/cv_bridge/test/ament_cmake_pytest/enumerants.py/.cache" "--junit-xml=/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/enumerants.py.xunit.xml" "--junit-prefix=cv_bridge"
9: Test timeout computed to be: 60
9: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
9:  - /usr/bin/python3 -u -m pytest /root/vision_opencv_ws/src/vision_opencv-release/test/enumerants.py -o cache_dir=/root/vision_opencv_ws/build/cv_bridge/test/ament_cmake_pytest/enumerants.py/.cache --junit-xml=/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/enumerants.py.xunit.xml --junit-prefix=cv_bridge
9: ============================= test session starts ==============================
9: platform linux -- Python 3.6.5, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
9: rootdir: /root/vision_opencv_ws/src/vision_opencv-release, inifile:
9: plugins: cov-2.5.1
9: collected 2 items
9: 
9: test/enumerants.py ..                                                    [100%]
9: 
9:  generated xml file: /root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/enumerants.py.xunit.xml 
9: =========================== 2 passed in 0.93 seconds ===========================
9: -- run_test.py: return code 0
9: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/enumerants.py.xunit.xml'
 9/11 Test  #9: enumerants.py ....................   Passed    1.30 sec
test 10
      Start 10: conversions.py

10: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/conversions.py.xunit.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_cmake_pytest/conversions.py.txt" "--command" "/usr/bin/python3" "-u" "-m" "pytest" "/root/vision_opencv_ws/src/vision_opencv-release/test/conversions.py" "-o" "cache_dir=/root/vision_opencv_ws/build/cv_bridge/test/ament_cmake_pytest/conversions.py/.cache" "--junit-xml=/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/conversions.py.xunit.xml" "--junit-prefix=cv_bridge"
10: Test timeout computed to be: 600
10: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
10:  - /usr/bin/python3 -u -m pytest /root/vision_opencv_ws/src/vision_opencv-release/test/conversions.py -o cache_dir=/root/vision_opencv_ws/build/cv_bridge/test/ament_cmake_pytest/conversions.py/.cache --junit-xml=/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/conversions.py.xunit.xml --junit-prefix=cv_bridge
10: ============================= test session starts ==============================
10: platform linux -- Python 3.6.5, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
10: rootdir: /root/vision_opencv_ws/src/vision_opencv-release, inifile:
10: plugins: cov-2.5.1
10: collected 4 items
10: 
10: test/conversions.py .F..                                                 [100%]
10: 
10:  generated xml file: /root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/conversions.py.xunit.xml 
10: =================================== FAILURES ===================================
10: ______________ TestConversions.test_encode_decode_cv2_compressed _______________
10: 
10: self = <conversions.TestConversions testMethod=test_encode_decode_cv2_compressed>
10: 
10:     def test_encode_decode_cv2_compressed(self):
10:         import numpy as np
10:         # from:
10:         # http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#Mat
10:         # imread(const string& filename, int flags)
10:         formats = ['jpg', 'jpeg', 'jpe', 'png', 'bmp', 'dib', 'ppm', 'pgm', 'pbm',
10:                    'jp2', 'sr', 'ras', 'tif', 'tiff']  # this formats rviz is not support
10:     
10:         cvb_en = CvBridge()
10:         cvb_de = CvBridge()
10:     
10:         for w in range(100, 800, 100):
10:             for h in range(100, 800, 100):
10:                 for f in formats:
10:                     for channels in ([], 1, 3):
10:                         if channels == []:
10:                             original = np.uint8(np.random.randint(0, 255, size=(h, w)))
10:                         else:
10:                             original = np.uint8(np.random.randint(0, 255, size=(h, w, channels)))
10: >                       compress_rosmsg = cvb_en.cv2_to_compressed_imgmsg(original, f)
10: 
10: test/conversions.py:65: 
10: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10: 
10: self = <cv_bridge.core.CvBridge object at 0x7f954a800fd0>
10: cvim = array([[ 24, 203, 149, ...,  57, 105, 250],
10:        [180,  58,  20, ..., 223, 202,  31],
10:        [245,  92, 105, ..., 19..., 135,  45,   8],
10:        [155,  67, 191, ..., 154, 221, 101],
10:        [ 17, 146, 214, ..., 228, 227, 125]], dtype=uint8)
10: dst_format = 'jp2'
10: 
10:     def cv2_to_compressed_imgmsg(self, cvim, dst_format='jpg'):
10:         """
10:             Convert an OpenCV :cpp:type:`cv::Mat` type to a ROS sensor_msgs::CompressedImage message.
10:     
10:             :param cvim:      An OpenCV :cpp:type:`cv::Mat`
10:             :param dst_format:  The format of the image data, one of the following strings:
10:     
10:             http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html
10:             http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#Mat
10:             * imread(const string& filename, int flags)
10:                * bmp, dib
10:                * jpeg, jpg, jpe
10:                * jp2
10:                * png
10:                * pbm, pgm, ppm
10:                * sr, ras
10:                * tiff, tif
10:     
10:             :rtype:           A sensor_msgs.msg.CompressedImage message
10:             :raises CvBridgeError: when the ``cvim`` has a type that is incompatible with ``format``
10:     
10:     
10:             This function returns a sensor_msgs::Image message on success,
10:             or raises :exc:`cv_bridge.CvBridgeError` on failure.
10:             """
10:         import cv2
10:         import numpy as np
10:         if not isinstance(cvim, (np.ndarray, np.generic)):
10:             raise TypeError('Your input type is not a numpy array')
10:         cmprs_img_msg = sensor_msgs.msg.CompressedImage()
10:         cmprs_img_msg.format = dst_format
10:         ext_format = '.' + dst_format
10:         try:
10: >           cmprs_img_msg.data = np.array(cv2.imencode(ext_format, cvim)[1]).tostring()
10: E           cv2.error: /build/opencv-zcaJjh/opencv-3.2.0+dfsg/modules/imgcodecs/src/loadsave.cpp:682: error: (-2) could not find encoder for the specified extension in function imencode
10: 
10: ../../install/cv_bridge/lib/python3.6/site-packages/cv_bridge/core.py:230: error
10: ----------------------------- Captured stderr call -----------------------------
10: OpenCV Error: Unspecified error (could not find encoder for the specified extension) in imencode, file /build/opencv-zcaJjh/opencv-3.2.0+dfsg/modules/imgcodecs/src/loadsave.cpp, line 682
10: ===================== 1 failed, 3 passed in 150.81 seconds =====================
10: -- run_test.py: return code 1
10: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/conversions.py.xunit.xml'
10/11 Test #10: conversions.py ...................***Failed  151.13 sec
test 11
      Start 11: python_bindings.py

11: Test command: /usr/bin/python3 "-u" "/opt/ros/bouncy/share/ament_cmake_test/cmake/run_test.py" "/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/python_bindings.py.xunit.xml" "--package-name" "cv_bridge" "--output-file" "/root/vision_opencv_ws/build/cv_bridge/ament_cmake_pytest/python_bindings.py.txt" "--command" "/usr/bin/python3" "-u" "-m" "pytest" "/root/vision_opencv_ws/src/vision_opencv-release/test/python_bindings.py" "-o" "cache_dir=/root/vision_opencv_ws/build/cv_bridge/test/ament_cmake_pytest/python_bindings.py/.cache" "--junit-xml=/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/python_bindings.py.xunit.xml" "--junit-prefix=cv_bridge"
11: Test timeout computed to be: 60
11: -- run_test.py: invoking following command in '/root/vision_opencv_ws/src/vision_opencv-release':
11:  - /usr/bin/python3 -u -m pytest /root/vision_opencv_ws/src/vision_opencv-release/test/python_bindings.py -o cache_dir=/root/vision_opencv_ws/build/cv_bridge/test/ament_cmake_pytest/python_bindings.py/.cache --junit-xml=/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/python_bindings.py.xunit.xml --junit-prefix=cv_bridge
11: ============================= test session starts ==============================
11: platform linux -- Python 3.6.5, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
11: rootdir: /root/vision_opencv_ws/src/vision_opencv-release, inifile:
11: plugins: cov-2.5.1
11: collected 1 item
11: 
11: test/python_bindings.py .                                                [100%]
11: 
11:  generated xml file: /root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/python_bindings.py.xunit.xml 
11: =========================== 1 passed in 0.17 seconds ===========================
11: -- run_test.py: return code 0
11: -- run_test.py: verify result file '/root/vision_opencv_ws/build/cv_bridge/test_results/cv_bridge/python_bindings.py.xunit.xml'
11/11 Test #11: python_bindings.py ...............   Passed    0.50 sec

45% tests passed, 6 tests failed out of 11

Label Time Summary:
copyright     =   0.25 sec*proc (1 test)
cppcheck      =   0.35 sec*proc (1 test)
cpplint       =   0.82 sec*proc (1 test)
flake8        =   0.43 sec*proc (1 test)
gtest         =   0.70 sec*proc (1 test)
lint_cmake    =   0.23 sec*proc (1 test)
linter        =   2.79 sec*proc (7 tests)
pep257        =   0.37 sec*proc (1 test)
pytest        = 152.94 sec*proc (3 tests)
uncrustify    =   0.33 sec*proc (1 test)

Total Test time (real) = 156.44 sec

The following tests FAILED:
	  1 - copyright (Failed)
	  2 - cppcheck (Failed)
	  3 - cpplint (Failed)
	  4 - flake8 (Failed)
	  7 - uncrustify (Failed)
	 10 - conversions.py (Failed)

@gaoethan
Copy link
Copy Markdown
Author

@mikaelarguedas The conversion.py failure occurs at the format "jp2" a.k.a JPEG2000 which depends on Jasper to encode/decode, as code showing in imgcodecs/src/loadsave.cpp

#ifdef HAVE_JASPER
        decoders.push_back( makePtr<Jpeg2KDecoder>() );
        encoders.push_back( makePtr<Jpeg2KEncoder>() );
#endif

But there is no libjasper1/libjasper-dev provideded in Ubuntu Bionic, I think this is really relevant with the OpenCV which is inherently provided by Ubuntu bionic (a.k.a libopencv-imgcodecs3.2 3.2.0+dfsg-4build2), I'm not sure its release enabling the support to JPEG2000 with Jasper or not, because it works for the same code with the OpenCV built by myself after involving the support of JPEG2000. If no support, the following code shows the error you encounters:

static bool imwrite_( const String& filename, const std::vector<Mat>& img_vec,
                      const std::vector<int>& params, bool flipv )
{
    bool isMultiImg = img_vec.size() > 1;
    std::vector<Mat> write_vec;

    ImageEncoder encoder = findEncoder( filename );
    if( !encoder )
        CV_Error( CV_StsError, "could not find a writer for the specified extension" );

@mikaelarguedas
Copy link
Copy Markdown
Member

Thanks @gaoethan for looking into it.

jasper has been removed from Ubuntu and Debian for security reasons a few years ago:
https://web.archive.org/web/20160402170040/https://release.debian.org/transitions/html/jasper-rm.html
https://bugs.launchpad.net/ubuntu/+source/jasper/+bug/1639737.

So versions of OpenCV released on Debian/Ubuntu since then have been built without jasper.
On bionic you can confirm it by looking at the cvconfig.h file:

# cat /usr/include/opencv2/cvconfig.h | grep JASPER
/* #undef HAVE_JASPER */

cv_bridge should be updated to not test that file format at all, or test it conditionally if HAVE_JASPER is defined by cvconfig.h

@gaoethan
Copy link
Copy Markdown
Author

Fix coversions.py runtime error with PR ros-perception/vision_opencv#242

@gaoethan
Copy link
Copy Markdown
Author

@mikaelarguedas I saw that there is another existing issue in the Jenkins log:

19:58:46 Traceback (most recent call last):
19:58:46   File "<string>", line 1, in <module>
19:58:46 ModuleNotFoundError: No module named 'numpy'
19:58:46 CMake Error at src/CMakeLists.txt:27 (message):
19:58:46   Could not determine the NumPy include directory, verify that NumPy was
19:58:46   installed correctly.
19:58:46 
19:58:46 
19:58:46 -- Configuring incomplete, errors occurred!
19:58:46 See also "/tmp/catkin_workspace/build/cv_bridge/CMakeFiles/CMakeOutput.log".
19:58:46 --- stderr: cv_bridge

Is it because the CI machine doesn't install python3-numpy ? but I can't reproduce it even with the previous docker steps from you,

@mikaelarguedas
Copy link
Copy Markdown
Member

@gaoethan same problem as before: dependencies needed to build your package should be listed as build dependencies. Your build process requires numpy, so it needs to be listed as such in the package.xml

@gaoethan
Copy link
Copy Markdown
Author

you can see that it has already been added as a dependency from package.xml, so you mean that it should also be necessary to add as a build dependency again like the following ?

<depend>python3-numpy</depend>

@dirk-thomas
Copy link
Copy Markdown
Member

It is declared as a test dependency and therefore only available when the tests are built. But in the CMake code you unconditionally rely on it.

Either you move the logic in CMake into a conditional block (if(BUILD_TESTING) or you have to change the dependency type from being a test-only to a "full" dependency at build and runtime. The first option would certainly be there preferred one to not inflict a dependency in the released code.

@mikaelarguedas
Copy link
Copy Markdown
Member

mikaelarguedas commented Aug 17, 2018

so you mean that it should also be necessary to add as a build dependency again like the following ?
<depend>python3-numpy</depend>

TL;DR: Yes python3-numpy should be listed as a build time and execution time dependency. So it should be:
<depend>python3-numpy</depend> in the package.xml and not <test_depend>python3-numpy</test_depend>


What I meant is that numpy use being used in many places in cv_bridge.

Build time:

The CMake code used to locate the numpy headers depends on the package python3-numpy (call here).
So the dependency python3-numpy is a dependency needed for the build step: a build_depend

Execution time:

The python code of cv_bridge uses numpy in multiple places (for example here) so the dependency is needed at execution time: an exec_depend

Testing time:

The cv_bridge tests use numpy as well (example here)

So it needs to be listed as a build_depend and exec_depend, which can be simplified with a single depend tag

@gaoethan
Copy link
Copy Markdown
Author

Thanks for your clarification and fix it within ros-perception/vision_opencv#243

@gaoethan
Copy link
Copy Markdown
Author

release with tag 2.0.5 #263 and close this one now

@gaoethan gaoethan closed this Aug 17, 2018
@gaoethan gaoethan deleted the bloom-vision_opencv-1 branch August 17, 2018 07:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants