ros-perception / opencv_apps

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

Modified enabling use_camera_info by rosparam #18

Closed iory closed 8 years ago

iory commented 8 years ago

Until now, we could not change use_camera_info flag by rosparam. I enable it.

iory commented 8 years ago

Please merge this.

k-okada commented 8 years ago

did you check if https://github.com/ros-perception/opencv_apps/blob/indigo/test/test-fback_flow.test#L10 is not working? if is is not working I think test should fail because https://github.com/ros-perception/opencv_apps/blob/indigo/test/test-fback_flow.test#L3 did not publish camera info, if the test passes, something wrong.

◉ Kei Okada

On Wed, Aug 10, 2016 at 7:22 PM, iory notifications@github.com wrote:

Until now, we could not change use_camera_info flag by rosparam.

I enable it.

You can view, comment on, or merge this pull request online at:

https://github.com/ros-perception/opencv_apps/pull/18 Commit Summary

  • Modified enabling use_camera_info by rosparam

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ros-perception/opencv_apps/pull/18, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeG3HaWQykhLyXbKmFxaVjGLvS4SsXjks5qeaZygaJpZM4Jg_09 .

iory commented 8 years ago

Year, I checked it. These apps's nodelet version could not correctly work. https://travis-ci.org/ros-perception/opencv_apps/jobs/151430031#L2339 https://github.com/ros-perception/opencv_apps/pull/19/files

k-okada commented 8 years ago

I see, may be nodet version does not launch dynamic reconfigure, ... https://github.com/ros-perception/opencv_apps/blob/indigo/include/opencv_apps/nodelet.h, if we can enable dynamic reconfigure fore each nodelet, I think thas' better.

◉ Kei Okada

On Thu, Aug 11, 2016 at 4:31 PM, iory notifications@github.com wrote:

Year, I checked it. These apps's nodelet version could not correctly work. https://travis-ci.org/ros-perception/opencv_apps/jobs/151430031#L2339

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ros-perception/opencv_apps/pull/18#issuecomment-239091568, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeG3ASThm-KKwsTbclRWQOvq2PRP0BEks5qes_vgaJpZM4Jg_09 .

iory commented 8 years ago

Should we initialize dynamicreconfigure server by pnh? https://github.com/iory/opencv_apps/commit/a6c3e398a5ca96b322c0f48d5a55aa87054e0cac

https://github.com/ros/dynamic_reconfigure/blob/master/include/dynamic_reconfigure/server.h#L234

k-okada commented 8 years ago

I think this is the right direction, also take look at https://github.com/ros-perception/image_pipeline/blob/indigo/stereo_image_proc/src/nodelets/disparity.cpp#L86-L87

◉ Kei Okada

On Wed, Aug 17, 2016 at 5:40 PM, iory notifications@github.com wrote:

Should we initialize dynamicreconfigure server by pnh? iory@a6c3e39 https://github.com/iory/opencv_apps/commit/a6c3e398a5ca96b322c0f48d5a55aa87054e0cac

https://github.com/ros/dynamic_reconfigure/blob/master/include/dynamic_ reconfigure/server.h#L234

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ros-perception/opencv_apps/pull/18#issuecomment-240349787, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeG3GDgLW0aia_LDjJoSIbYPZvTEIujks5qgsj7gaJpZM4Jg_09 .

iory commented 8 years ago

I applied it.

iory commented 8 years ago

Please check it

k-okada commented 8 years ago

@iory can you provide snippets of your launch files that using nodelet?

iory commented 8 years ago

OK, sample https://gist.github.com/iory/da17954998bd07169591be51cb693d38

k-okada commented 8 years ago

Could you also send me launch file that you really using in your experiments? It's ok for me the file did not run on my environment, I just wait to look at it .

2016年8月23日火曜日、iorynotifications@github.comさんは書きました:

OK, sample https://gist.github.com/iory/da17954998bd07169591be51cb693d38

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ros-perception/opencv_apps/pull/18#issuecomment-241679480, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeG3D0q50M063lAWtq9lRUa7SlVtobNks5qir_BgaJpZM4Jg_09 .

◉ Kei Okada

iory commented 8 years ago

How about following launch file? https://gist.github.com/iory/da17954998bd07169591be51cb693d38

k-okada commented 8 years ago

1) did you test nodelet version of opencv_app program with hrp2 or xtion? 2) btw how did you test the program?

  void subscribe()
  {
    NODELET_DEBUG("Subscribing to image topic.");
    if (config_.use_camera_info)
      cam_sub_ = it_->subscribeCamera("image", 3, &CamShiftNodelet::imageCallbackWithInfo, this);
    else
      img_sub_ = it_->subscribe("image", 3, &CamShiftNodelet::imageCallback, this);
  }
k-okada commented 8 years ago

@iory sorry this is my misunderstanding,

with this PR

<launch>
  <arg name="gui" default="true" />
  <node name="play_face_bag" pkg="rosbag" type="play" args="-l $(find opencv_apps)/test/face_detector_withface_test_diamondback.bag" />

  <arg name="histogram" default="[0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]" doc="Histogram of tracked color object" />
  <arg name="vmin" default="11" doc="Min threshould of lightness."/>
  <arg name="vmax" default="231" doc="Max threshould of lightness." />
  <arg name="smin" default="61" doc="Min value of saturation." />
  <arg name="node_name" default="camshift" />
  <arg name="image" default="image_rect_color" />

  <arg name="use_nodelet" default="true" />

  <group ns="wide_stereo/left" >
    <node name="image_proc" pkg="image_proc" type="image_proc" />
    <node name="image_view" pkg="image_view" type="image_view" args="image:=image_rect_color" if="$(arg gui)" />

    <!-- camshift.cpp -->
    <group if="$(arg use_nodelet)">
    <node name="nodelet_manager" pkg="nodelet" type="nodelet" args="manager" output="screen" />
      <!-- camshift.cpp -->
      <node name="$(arg node_name)" pkg="nodelet" type="nodelet" args="load camshift/camshift nodelet_manager" output="screen" >
        <remap from="image" to="$(arg image)" />
        <param name="debug_view" value="$(arg gui)" />
        <rosparam param="histogram" subst_value="True">
          $(arg histogram)
        </rosparam>
        <param name="vmin" value="$(arg vmin)" />
        <param name="vmax" value="$(arg vmax)" />
        <param name="smin" value="$(arg smin)" />
      </node>
    </group>
    <group unless="$(arg use_nodelet)">
      <node name="$(arg node_name)" pkg="opencv_apps" type="camshift" >
        <remap from="image" to="$(arg image)" />
        <param name="debug_view" value="$(arg gui)" />
        <rosparam param="histogram" subst_value="True">
          $(arg histogram)
        </rosparam>
        <param name="vmin" value="$(arg vmin)" />
        <param name="vmax" value="$(arg vmax)" />
        <param name="smin" value="$(arg smin)" />
      </node>
    </group>

    <!-- Test Codes -->
    <node name="camshift_saver_result" pkg="image_view" type="image_saver" args="image:=camshift/image" >
      <param name="filename_format" value="$(find opencv_apps)/test/camshift_result.png"/>
    </node>
    <node name="camshift_saver_back_project" pkg="image_view" type="image_saver" args="image:=camshift/back_project" >
      <param name="filename_format" value="$(find opencv_apps)/test/camshift_back_project.png"/>
    </node>
    <param name="camshift_test/topic" value="camshift/track_box" />    <!-- opencv_apps/Point2DArrayStamped -->
    <test test-name="camshift_test" pkg="rostest" type="hztest" name="camshift_test" >
      <param name="hz" value="20" />
      <param name="hzerror" value="15" />
      <param name="test_duration" value="5.0" /> 
    </test>
  </group>
</launch>

Thanks!