YouTube-publisher-ROS2
Publish sensor_msgs/Image by "YouTube"
You don't have to use webcamera or your video to check demos.
Purpose
- Quick demo
๐ - Comparison performance
๐ค - Sharing your results
๐จ
Requirements
- ROS2 Foxy
- OpenCV4
- youtube-dl : Re-sharing of acquired videos from YouTube is prohibited.
- ffmpeg-python
Installation
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/Ar-Ray-code/YouTube-publisher-ROS2.git
pip3 install -r YouTube-publisher-ROS2/requirements.txt
cd ~/ros2_ws
colcon build --symlink-install
Demo with YOLOX-ROS
Build
# YOLOX installation
cd ~/Documents/
git clone --recursive https://github.com/Megvii-BaseDetection/YOLOX
cd ~/Documents/YOLOX
pip3 install -U pip && pip3 install -r requirements.txt
pip3 install -v -e . # or python3 setup.py develop
pip3 install cython; pip3 install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
# ROS2 Installation
cd ~/ros2_ws/src
git clone https://github.com/Ar-Ray-code/YouTube-publisher-ROS2.git
git clone https://github.com/Ar-Ray-code/YOLOX-ROS.git --recursive
pip3 install -r YouTube-publisher-ROS2/requirements.txt
cd ~/ros2_ws
colcon build --symlink-install
Run
ros2 launch youtube_publisher youtube_publisher_yolox.launch.py
Parameter
Look the launch.py file !
youtube = launch_ros.actions.Node(
package='youtube_publisher', executable='youtube_pub',
parameters=[
{'topic_name': '/image_raw'},
{'cache_path': youtube_publisher_share_dir + '/cache'},
{'video_url' : 'https://youtu.be/CFLOiR2EbKM'},
{'using_youtube_dl' : True},
{'clear_cache_force' : False},
{'width' : 854},
{'height' : 480},
{'speed' : 1.0},
{'imshow_is_show' : True}
],
)
topic_name
: Publish topic name๏ผDefault :image_raw
๏ผcache_path
: Path of the video to be saved๏ผDefault :~/cache/youtube_publisher
๏ผvideo_url
: YouTube Video URL๏ผDefault :https://youtu.be/CFLOiR2EbKM
๏ผusing_youtube_dl
: Automatically download video from YouTube when it is not downloaded. ๏ผDefault : True๏ผ- If you run it again, it will load the cache and will not be downloaded.
- If URL is re-writtten, it will be cleared cache and re-downloaded.
clear_cache_force
: Clear cache and re-download force. ๏ผDefault : False๏ผwidth
: Width of publishing video. Not about downloaded video width.๏ผDefault : 720๏ผheight
: Height of publishing video. Not about downloaded video height.๏ผDefault : 480๏ผspeed
: Video playback speed.๏ผDefault : 1.0๏ผimshow_is_show
: Video visualization with imshow. ๏ผDefault : False๏ผ- True : show, False : Don't show
About author
- author : Ar-Ray
- ใฏใฆใชใใญใฐ