Giter Site home page Giter Site logo

ros2_usb_camera's Introduction

ROS2 USB Camera Node

Its based on both the image_tools cam2image demos for ROS2 as well as the libuvc and usb_cam project for ROS1.

Features

  • CameraInfo available
  • CompressedImage topic (see compressed images for republishing using image_transport)
  • Image topic
  • Select camera (running the node for each camera connected)

There might be major changes to the code as it is a WIP. This is a simple camera driver using OpenCV. With this comes less flexibility for custom camera settings etc but simple to setup and use. If you have more complex requirements I've listed some alternate packages in the Alternate packages section.

Topics

  • /camera_info - topic for camera info
  • /image_raw - topic for raw image data

Installation

Make sure to run setup.bash and local_setup.bash for all dependencies or symlink them into the repo.

Run

colcon build

Usage

ros2 run usb_camera_driver usb_camera_driver_node __ns:=/<your namespace> __params:=config.yaml

Available parameters:

  • frame_id -> transform frame_id of the camera, defaults to "camera"
  • image_width -> image width (1280 default)
  • image_height -> image height (720 default)
  • fps -> video fps (10 default)
  • camera_id -> id of camera to capture (0 - 100, 0 default)

Calibration files

To use the camera info functionality you need to load a file from the camera_calibration (https://github.com/ros-perception/image_pipeline/tree/ros2/camera_calibration) library and put it in/name it file:///Users/<youruser>/.ros/camera_info/camera.yaml

Compressed images

To get compressed images (works seamlessly with web streaming) republish the topic using image_transport which is available for ROS2.

ros2 run image_transport republish raw in:=image_raw compressed out:=image_raw_compressed

Make sure to link/install https://github.com/ros-perception/image_transport_plugins/tree/ros2 before to enable compressed image republishing using image_transport since its not included in the base package. More information here http://wiki.ros.org/image_transport, here http://wiki.ros.org/compressed_image_transport and here https://answers.ros.org/question/35183/compressed-image-to-image/

Alternate packages

Other camera packages in ROS2 now available:

References

https://github.com/ros-perception/vision_opencv/tree/ros2

ros2_usb_camera's People

Contributors

klintan avatar ipa-kut avatar agutenkunst avatar loyvanbeek avatar mariohoff avatar

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.