Code Monkey home page Code Monkey logo

ros2_ipcamera's Introduction

ROS2 IP Camera Component ====

ROS2 component that publishes raw images taken from an IP camera.

Note: to cross-compile for ARM architecture see the related article.

Installation: ----

git clone https://github.com/surfertas/ros2_ipcamera.git
colcon build --symlink-install
. install/setup.bash

Docker:

git clone https://github.com/surfertas/ros2_ipcamera.git
cd ros2_ipcamera
sudo docker build -t ros2_ipcamera/latest .

Usage: ----

  1. Update rtsp_uri parameter found in /config/ipcamera.yaml with the appropriate rtsp uri to your IP camera.
  2. Set the width and height to match the resolution of the IP camera. The node does not resize the image, but only sets the capture.
  3. Generate a camera_info.yaml file and place in /config.
ros2 run ros2_ipcamera composition

# Alternatively use the launch file
ros2 launch ros2_ipcamera ipcamera.launch.py

Docker:

# Update rtsp_uri in the yaml file.
sudo docker run -it ros2_ipcamera/latest bash
vi src/ros2_ipcamera/config/ipcamera.yaml
source ./install/setup.bash
ros2 launch ros2_ipcamera ipcamera.launch.py

Topics:

/ipcamera/image_raw - topic for raw image data

/ipcamera/camera_info - topic for camera info

References: ----1. https://github.com/ros2/demos/blob/master/image_tools/src/cam2image.cpp 2. http://surfertas.github.io/ros2/2019/08/17/ros2-qos.html 3. https://github.com/klintan/ros2_usb_camera/blob/master/src/usb_camera_driver.cpp 4. https://github.com/ros-perception/image_common/wiki/ROS2-Migration 5. https://github.com/ros2/demos/tree/master/composition 6. https://github.com/christianrauch/raspicam2_node/blob/master/src/RasPiCamPublisherNode.cpp

ros2_ipcamera's People

Contributors

surfertas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ros2_ipcamera's Issues

RVIZ2 Visualisation

Hi,

im trying to use the package to get the camera stream displayed in Rviz.

Neither working for camera or image added in rviz. Also tried the suggested fixes from other issue.

using ipcamera/image_raw:
Camera Info
No Cameralnfo received on /ipcamera/
camera_info. Topic may not exist.

using ipcamera/image_raw/compressed:
Camera Info
No Cameralnfo received on /ipcamera/image_raw/
camera_info. Topic may not exist.

Echo topic /ipcamera/camera_info shows:
header :
stamp:
sec: [1690295346]
nanosec: 322122365
frame id: camera
height: 480
width: 640
distortion_model: plumb_bob
d: [0.0, 0.0,0.0, 0.0, 0.0]
k: [641.5, 0.0,320.0,0.0.641.5,240.0, 0.0, 0.0, 1.0]
г: [11.0, 0.0, 0.0,0.0,1.0,0.0, 0.0, 0.0,1.0]
P: [641.5,0.0,320.0,0.0,0.0,0.0,641.5,240.0,0.0,0.0, 0.0, 1.0,0.0]
binning_x: 0
binning_y: 0
roi:
x _offset: 0
y_offset: 0
height: 0 width: o
do_rectify: false

Echo on ipcamera/image_raw shows the normal output with image.

Maybe someone has a clue how to solve this problem.

Thanks

ubuntu 18.04
Ros2 eloquent
Jetson Nano 4GB
Hikvision IP camera

No output in rviz/rqt

We have an ArkCam Basic Plus Mini IP camera (https://en.ark-vision-systems.com/produkte/arkcambasic+mini/), which we would like to connect to Ros2_ipcamera.

We have a simple Python script using OpenCV which receives images from the camera via "rtsp: //192.168.0.76:8554/h264", showing that the camera works.
We have installed Ros2_ipcamera as described in the readme file and customized camera_info.yaml and ipcamera.yaml as shown below.

ros2 launch ros2_ipcamera ipcamera.launch.py starts without errors and ros2 topic list shows /ipcamera/camera_info and /ipcamera/image_raw.

However, we do not get any image in either rviz or rqt.
Is there anything we have overlooked?

Thanks in advance.

ipcamera.yaml:

ipcamera:
   ros__parameters:
     rtsp_uri: "rtsp: //192.168.0.76:8554/h264"
     image_topic: "image_raw"
     image_width: 1280
     image_height: 720

camera_info.yaml:

image_width: 1280
image_height: 720
"the rest is left unchanged"

Opencv error

I'm currently facing this error after running composition...

[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (713) open OpenCV | GStreamer warning: Error opening bin: empty pipeline not allowed
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ERROR:0] global ../modules/videoio/src/cap.cpp (116) open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.2.0) ../modules/videoio/src/cap_images.cpp:293: error: (-215:Assertion failed) !_filename.empty() in function 'open'


[ERROR] [1663643419.692866955] [ipcamera]: Could not open video stream
terminate called after throwing an instance of 'std::runtime_error'
  what():  Could not open video stream

Humble 22.04 compile error

I have sudo apt install libopencv-*

The build fails as below

colcon build --symlink-install
Starting >>> ros2_ipcamera
--- stderr: ros2_ipcamera
/usr/bin/ld: libipcamera_component.so: undefined reference to cv::VideoCapture::VideoCapture()' /usr/bin/ld: libipcamera_component.so: undefined reference to cv::VideoCapture::isOpened() const'
/usr/bin/ld: libipcamera_component.so: undefined reference to cv::VideoCapture::~VideoCapture()' /usr/bin/ld: libipcamera_component.so: undefined reference to cv::VideoCapture::operator>>(cv::Mat&)'
/usr/bin/ld: libipcamera_component.so: undefined reference to cv::VideoCapture::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)' /usr/bin/ld: libipcamera_component.so: undefined reference to cv::VideoCapture::set(int, double)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/composition.dir/build.make:196: composition] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/composition.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Failed <<< ros2_ipcamera [1.41s, exited with code 2]

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.