ros-perception / opencv_apps

http://wiki.ros.org/opencv_apps
64 stars 70 forks source link

Add DIS optical flow Nodelet #87

Closed fujimo-t closed 4 years ago

fujimo-t commented 5 years ago

This is Nodelet for OpenCV implementation of DIS optical flow. The nodelet can be built on only Kinetic or Melodic because DIS Flow has appeared in opencv_contrib since OpenCV 3.2.

This is based on sample of DIS Flow in OpenCV 4.0

fujimo-t commented 5 years ago

My environment is Melodic and it seems that fix is needed for other distro.

fujimo-t commented 5 years ago

Kinetic and Melodic are OK but Indigo is not.

Currently dis_flow nodelet is not built on Indigo by the CMakeLists.txt. But test and launch file of dis_flow are installed on Indigo and they cause an error of launch file check. Also nodelet_plugins.xml shouldn't include dis_flow on Indigo.

I think split branch Indigo and Kinetic or later is easiest way. But should I not split branch for only a nodelet?

k-okada commented 5 years ago

we already have similar problem on other optical flow algorithm, please look at https://github.com/ros-perception/opencv_apps/blob/indigo/CMakeLists.txt#L9-L11

fujimo-t commented 5 years ago

Same error will happen if the condition of simple flow is false. if(OpenCV_VERSION VERSION_LESS "3.0" OR TARGET opencv_optflow) But the condition is always true if we use normal ROS environment, so actually there is no problem in simple flow's case.

I will try to exclude files related to dis_flow from install files if OpenCV version is not enough.

fujimo-t commented 5 years ago

Now launch and test files of dis flow is not installed and test is not done, if dis flow is not available.

fujimo-t commented 5 years ago

Travis is failed on OPENCV_VERSION=2 ROS_DISTRO=indigo DOCKER_IMAGE=ubuntu:trusty but it seems an issue unrelated to this PR.

At https://travis-ci.org/ros-perception/opencv_apps/jobs/513244849#L4949

[ROSTEST]-----------------------------------------------------------------------
[opencv_apps.rosunit-lk_flow_test/test_hz][FAILURE]-----------------------------
average rate (0.873Hz) exceeded minimum (1.000Hz)
  File "/usr/lib/python2.7/unittest/case.py", line 331, in run
    testMethod()
  File "/opt/ros/indigo/share/rostest/nodes/hztest/hztest", line 117, in test_hz
    self._test_hz(hz, hzerror, topic, test_duration, wait_time)
  File "/opt/ros/indigo/share/rostest/nodes/hztest/hztest", line 187, in _test_hz
    (rate, self.min_rate))
  File "/usr/lib/python2.7/unittest/case.py", line 424, in assertTrue
    raise self.failureException(msg)
--------------------------------------------------------------------------------
SUMMARY
 * RESULT: FAIL
 * TESTS: 1
 * ERRORS: 0
 * FAILURES: 1
fujimo-t commented 4 years ago

Closed because I'm busy now and can't update PR.