[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

[image_view] window hangs because callback can be dispatched from multiple threads #331

Closed
yoshito-okada opened this issue May 8, 2018 · 4 comments

Comments

@yoshito-okada
Copy link
Contributor

I found that the image_view nodelet (image_view/image) does not update its window and hangs in some cases. I think this is because the nodelet manager can execute a callback in multiple threads even if the callback is associated to a threaded callback queue (see https://github.com/ros/nodelet_core/blob/2f25b775fd0241fc949a5fc002e718dbd142d5d7/nodelet/src/callback_queue_manager.cpp#L206), although the callback must be called by a specific thread to successfully update the window.

The following is a launch script to reproduce the problem. I am afraid that the problem may not be reproduced in different environment because the problem depends on environment-specific threading but I hope this is helpful.

<launch>
    <node name="image_view_node" pkg="nodelet" type="nodelet" 
          args="manager image_view_node" output="screen"/>

    <node name="image_view_loader" pkg="nodelet" type="nodelet" 
          args="load image_view/image image_view_node" output="screen"/>

    <node name="image_view_loader2" pkg="nodelet" type="nodelet" 
          args="load image_view/image image_view_node" output="screen"/>

    <!-- An external node publishing sensor_msgs/Image on the "image" topic is required -->
</launch>

I think the only solution is to add a new thread updating the window and am writing a workaround. Please see if interested.
https://github.com/yoshito-okada/image_pipeline/tree/fix_image_view_nodelet

@yoshito-okada
Copy link
Contributor Author

Sorry, I put a wrong launch script in my original post. The following one would reproduce the problem.

<launch>
    <node name="image_view_node" pkg="nodelet" type="nodelet" 
          args="manager image_view_node" output="screen"/>

    <node name="image_view_loader" pkg="nodelet" type="nodelet" 
          args="load image_view/image image_view_node" output="screen">
        <remap from="image" to="image_mono"/>
    </node>

    <node name="image_proc_loader" pkg="nodelet" type="nodelet" 
          args="load image_proc/debayer image_view_node" output="screen">
        <remap from="image_raw" to="image"/>
    </node>

    <!-- An external node publishing sensor_msgs/Image on the "image" topic is required -->
</launch>

@k-okada
Copy link
Contributor
k-okada commented May 17, 2018

I think this similar to #283 and my previous fix #279 was not sufficient. I have confirmed this issue and also https://github.com/yoshito-okada/image_pipeline/tree/fix_image_view_nodelet works perfect

@yoshito-okada could you create new PullRequest using https://github.com/yoshito-okada/image_pipeline/tree/fix_image_view_nodelet , so that every one can easily find your solution?

@yoshito-okada
Copy link
Contributor Author
yoshito-okada commented May 17, 2018

I just made the PR #337 .

JWhitleyWork pushed a commit that referenced this issue Apr 10, 2019
Fix threading issue in image_view nodelet. Closes #331.
@JWhitleyWork
Copy link
Collaborator

Should be closed by merge of #337.

generush pushed a commit to generush/image_pipeline that referenced this issue May 9, 2019
…ew_nodelet

Fix threading issue in image_view nodelet. Closes ros-perception#331.
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

No branches or pull requests

3 participants