基於ROS節點實現USB camera在web顯示

上一篇文章中我們實現了ros節點讀取usb camera數據,然後通過topic形式發佈數據,接下來我們需要在web中實現usb camera數據的顯示,步驟如下:

1、安裝依賴庫async-web-server

sudo apt-get install ros-kinetic-async-web-server-cpp

2、下載ros工程倉庫

git clone https://github.com/RobotWebTools/web_video_server

3、編譯並運行

mkdir src
mv web_video_server src/
cd …/
catkin build
roscore
#關於usb_cam節點不清楚地方,可以自己查看此篇文章:https://blog.csdn.net/pengrui18/article/details/88958487
roslaunch usb_cam usb_cam-test.launch
#啓動web video server服務器
rosrun web_video_server web_video_server

4、在web中顯示效果

打開瀏覽器輸入如下地址:
http://localhost:8080/stream?topic=/usb_cam/image_raw
此處/usb_cam/image_raw表示usb camera的rostopic節點原始數據
效果圖如下:
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章