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 Streams Now Stop When Connection Closed (ROS1) #170

Open
wants to merge 2 commits into
base: ros1
Choose a base branch
from

Conversation

QuentinTorg
Copy link

@QuentinTorg QuentinTorg commented Nov 4, 2024

Public API Changes
None

Description
I have a setup where my camera and my host computer are using different time domains (camera time is significantly ahead of computer time). I'm using the jpeg image streamer to stream to a browser. I found that when I close the image stream window in my browser, the subscription was not getting closed.

This is because the isBusy() function was comparing image header time stamp to ros::Time::now() when checking if pending footers were too old and needed to be removed. It would never clear old footers from the queue, preventing it from sending new images. Preventing sending new images meant that exceptions would never bubble up from the async_web_server library to indicate a connection issue

Forcing all time stamping to use ros::Time::now() instead of camera time fixed this issue because there was no longer a time domain mismatch. I chose to use system time instead of image header time because the restreamFrame() function also needs to make a timeout decision, but does not have an image header to compare to. It would be possible to use image header time all the way through by saving the latest image header timestamp, but it doesn't seem beneficial because there is no consumer for accurate camera timestamps from what I can tell. Maybe some of the other image streams care about this?

#171

@QuentinTorg QuentinTorg changed the title Image Streams Now Stop When Connection Closed Image Streams Now Stop When Connection Closed (ROS1) Nov 4, 2024
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.

1 participant