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 streaming over websocket #97

Merged
merged 5 commits into from
Apr 7, 2021
Merged

Image streaming over websocket #97

merged 5 commits into from
Apr 7, 2021

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Feb 20, 2021

depends on gazebosim/gz-common#139

🎉 New feature

Summary

Adds support for streaming images from an ign topic.

Added keyword image for requesting data from an image topic. The websocket server plugin will subscribe to the topic in the request and republish the image data over to the client.

A better solution maybe to use a proper streaming server like HTTP Live Streaming (HLS) protocol in the future.

Test it

Launch ign gazebo camera sensor example world:

ign gazebo -v 4 -r src/ign-gazebo/examples/worlds/camera_sensor.sdf

Launch ign websocket server example launch file

ign launch -v 4 src/ign-launch/examples/websocket.ign

See the image stream using this demo image_stream_websocket_client.html file

ign_image_streamer

Note the red and blue channels are reversed in the image stream, which may be fixed by gazebosim/gz-common#162

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
@github-actions github-actions bot added the 🔮 dome Ignition Dome label Feb 20, 2021
@chapulina chapulina added the needs upstream release Blocked by a release of an upstream library label Feb 22, 2021
@nkoenig
Copy link
Contributor

nkoenig commented Feb 26, 2021

Would it be more efficient to base64 encode the image on the server side rather than on the client side? This could also be captured as a future improvement.

Signed-off-by: Nate Koenig <nate@openrobotics.org>
@nkoenig nkoenig mentioned this pull request Apr 6, 2021
7 tasks
@nkoenig nkoenig removed the needs upstream release Blocked by a release of an upstream library label Apr 6, 2021
@codecov
Copy link

codecov bot commented Apr 7, 2021

Codecov Report

Merging #97 (3461c90) into ign-launch3 (77f736a) will not change coverage.
The diff coverage is n/a.

❗ Current head 3461c90 differs from pull request most recent head 8dbdb23. Consider uploading reports for the commit 8dbdb23 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##           ign-launch3      #97   +/-   ##
============================================
  Coverage        30.24%   30.24%           
============================================
  Files                3        3           
  Lines              734      734           
============================================
  Hits               222      222           
  Misses             512      512           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77f736a...8dbdb23. Read the comment docs.

@nkoenig nkoenig merged commit 3296a3e into ign-launch3 Apr 7, 2021
@nkoenig nkoenig deleted the ws_image_streaming branch April 7, 2021 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔮 dome Ignition Dome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants