Skip to content

robocre8/opencv_ros_camera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencv_ros_camera

this is a simple ros pacakge for interfacing camera using opencv. it publishes on topics:

<camera_optical_frame_id>/image_raw
<camera_optical_frame_id>/image_raw/compressed

Installation Steps

  • install the following on the Pi or Pc

    sudo apt install libopencv-dev python3-opencv
    pip3 install opencv-python
  • create your <ros_ws> in the home dir. (replace <ros_ws> with your workspace name)

    mkdir -p ~/<ros_ws>/src
    cd ~/<ros_ws>
    colcon build
    source ~/<ros_ws>/install/setup.bash
  • cd into the src folder of your <ros_ws> and download the mobo_bot packages

    cd ~/<ros_ws>/src
    git clone https://github.com/robocre8/opencv_ros_camera.git
  • cd into the root directory of your <ros_ws> and run rosdep to install all necessary ros package dependencies

    cd ~/<ros_ws>/
    rosdep install --from-paths src --ignore-src -r -y
  • build your <ros_ws>

    cd ~/<ros_ws>/
    colcon build --symlink-install
  • don't forget to source your <ros_ws> in any new terminal

    source ~/<ros_ws>/install/setup.bash

Use the package

  • set the video port of your camera from the camera_publisher.launch.py file

    source ~/<ros_ws>/install/setup.bash
  • run the ros opencv camera publisher node

    ros2 launch opencv_ros_camera camera_publisher.launch.py

View published camera data on your PC

  • install rqt_image_view

    sudo apt-get install ros-humble-rqt-image-view
  • run to view published images (compressed or raw)

    ros2 run rqt_image_view rqt_image_view

About

this is a simple ros2 pacakge for interfacing camera using opencv.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published