Coder Social home page Coder Social logo

fa-se / image_to_v4l2loopback_ros2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lucasw/image_to_v4l2loopback

0.0 0.0 1.0 59 KB

Stream ROS image topics to /dev/video using https://github.com/umlaeute/v4l2loopback

License: BSD 3-Clause "New" or "Revised" License

C++ 79.30% Python 16.53% CMake 4.17%

image_to_v4l2loopback_ros2's Introduction

image_to_v4l2loopback Build Status Coverage Status

ROS node for streaming an image topic to a video capture device. Mostly based on this:

dev

Setup a workspace:

cd ~/catkin_ws/src  # or wherever catkin_ws is
git clone https://github.com/lucasw/image_to_v4l2loopback
cd ..
catkin build image_to_v4l2loopback

video devices

Stream node needs to write to a video capture device, which varies depending on your system.

linux

Uses v4l2-loopback:

Secure boot uefi will prevent the modprobe from working, try https://askubuntu.com/questions/762254/why-do-i-get-required-key-not-available-when-install-3rd-party-kernel-modules

sudo apt install mokutil
sudo mokutil --disable-validation
sudo reboot
# don't bother this version is too old
# sudo apt-get install v4l2loopback-*

But the ubuntu v4l2loopback is old if it doesn't work, try

git clone [email protected]:umlaeute/v4l2loopback
cd v4l2loopback
make
sudo insmod v4l2loopback.ko exclusive_caps=1 video_nr=1 card_label="Fake"

See https://github.com/umlaeute/v4l2loopback for more instructions

sudo modprobe v4l2loopback video_nr=1
v4l2-ctl -D -d /dev/video1
Driver Info (not using libv4l2):
    Driver name   : v4l2 loopback
    Card type     : Dummy video device (0x0000)
    Bus info      : v4l2loopback:0
    Driver version: 0.8.0
    Capabilities  : 0x05000003
        Video Capture
        Video Output
        Read/Write
        Streaming

usage

stream

Typically just:

rosrun image_to_v4l2loopback stream _device:=/dev/video1 _width:=640 _height:=480 _fourcc:=YV12 image:=/my_camera/image

That resolution will then be locked in, need to rmmod and restart the module then set the resolution again.

where:

  • /dev/video1 target device
  • 640x480 target size
  • YV12 target pixel format
  • /my_camera/image the source sensor_msgs/Image topic re-mapped to image

For more:

rosrun image_to_v4l2loopback stream --help

cheese works, but guvcview does not.

Google hangouts says no camera found.

zoom-client works.

tests

v4l2-ctl -D -d /dev/video1
Driver Info (not using libv4l2):
    Driver name   : v4l2 loopback
    Card type     : Dummy video device (0x0000)
    Bus info      : v4l2loopback:0
    Driver version: 0.8.0
    Capabilities  : 0x05000003
        Video Capture
        Video Output
        Read/Write
        Streaming
ROS_VIRTUAL_CAM_STREAM_TEST_DEVICE=/dev/video1 catkin_make run_tests

If you want coverage:

catkin_make -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON
ROS_VIRTUAL_CAM_STREAM_TEST_DEVICE=/dev/video1 catkin_make run_tests
lcov --path . --directory . --capture --output-file coverage.info
lcov --remove coverage.info 'tests/*' '/usr/*' '/opt/*' --output-file coverage.info
lcov --list coverage.info

image_to_v4l2loopback_ros2's People

Contributors

aisch avatar fa-se avatar jgoppert avatar lucasw avatar

Forkers

robotics-88

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.