Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified enabling use_camera_info by rosparam #18

Merged
merged 1 commit into from
Aug 23, 2016

Conversation

iory
Copy link
Contributor

@iory iory commented Aug 10, 2016

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

@iory
Copy link
Contributor Author

iory commented Aug 10, 2016

Please merge this.

@k-okada
Copy link
Contributor

k-okada commented Aug 11, 2016

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:

#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
#18, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AAeG3HaWQykhLyXbKmFxaVjGLvS4SsXjks5qeaZygaJpZM4Jg_09
.

@iory iory mentioned this pull request Aug 11, 2016
@iory
Copy link
Contributor Author

iory commented Aug 11, 2016

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
Copy link
Contributor

k-okada commented Aug 12, 2016

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
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeG3ASThm-KKwsTbclRWQOvq2PRP0BEks5qes_vgaJpZM4Jg_09
.

@iory
Copy link
Contributor Author

iory commented Aug 17, 2016

Should we initialize dynamic_reconfigure server by pnh_?
iory@a6c3e39

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

@k-okada
Copy link
Contributor

k-okada commented Aug 17, 2016

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 dynamic_reconfigure server by pnh_?
iory/opencv_apps@a6c3e39
iory@a6c3e39

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
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeG3GDgLW0aia_LDjJoSIbYPZvTEIujks5qgsj7gaJpZM4Jg_09
.

@iory
Copy link
Contributor Author

iory commented Aug 18, 2016

I applied it.

@iory
Copy link
Contributor Author

iory commented Aug 23, 2016

Please check it

@k-okada
Copy link
Contributor

k-okada commented Aug 23, 2016

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

@iory
Copy link
Contributor Author

iory commented Aug 23, 2016

@k-okada
Copy link
Contributor

k-okada commented Aug 23, 2016

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
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeG3D0q50M063lAWtq9lRUa7SlVtobNks5qir_BgaJpZM4Jg_09
.

◉ Kei Okada

@iory
Copy link
Contributor Author

iory commented Aug 23, 2016

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

@k-okada
Copy link
Contributor

k-okada commented Aug 23, 2016

  1. did you test nodelet version of opencv_app program with hrp2 or xtion?
  2. btw how did you test the program?
  • with/without this PR, we can see/wide_stereo/left/camshift/use_camera_info
  • if we change use_camera_info in dynamic reconfigure rosparam get /wide_stereo/left/camshift/use_camera_info also changes
  • if we rosparam set /wide_stereo/left/camshift/use_camera_info true or false, it did not change dynamic reconfigure gui
  • if we look at following code, it seems we have to reconnect the image topic, did you do that ? if so , how did you do that?
  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
Copy link
Contributor

k-okada commented Aug 23, 2016

@iory sorry this is my misunderstanding,

  • without this PR
    • node
      • enable to change param from dynamic reconfigure
    • node start with parm set by launch
    • nodelet
    • unable to change param from dynamic_reconfigure
    • node did not start with param set by launch

with this PR

  • node
    • enable to change param from dynamic reconfigure
    • node start with param set by launch
  • nodelet
    • enable to change param from dynamic reconfigure
    • node start with param set by launch
<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!

@k-okada k-okada merged commit 11cc7aa into ros-perception:indigo Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants