Giter Club home page Giter Club logo

opencv_cam's People

Contributors

clydemcqueen avatar openvmp avatar ptrmu 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  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

opencv_cam's Issues

cannot build the opencv_cam files

Hello Guys,
I am using ubuntu 20.04 and ros2-galactic running in virtualbox. I am using logitech C615 camera for calibration etc.

I am trying to build the files as mentioned in readme, but cannot run it. I tried everything. I would appreciate your prompt solution for this.

Error is here:
**Starting >>> opencv_cam
--- stderr: opencv_cam
In file included from /root/opencv_cam_ws/src/opencv_cam/include/opencv_cam/opencv_cam_node.hpp:10,
from /root/opencv_cam_ws/src/opencv_cam/src/opencv_cam_node.cpp:1:
/root/opencv_cam_ws/src/opencv_cam/include/opencv_cam/camera_context.hpp:7:10: fatal error: ros2_shared/context_macros.hpp: No such file or directory
7 | #include "ros2_shared/context_macros.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/opencv_cam_node.dir/build.make:63: CMakeFiles/opencv_cam_node.dir/src/opencv_cam_node.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:166: CMakeFiles/opencv_cam_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:141: all] Error 2

Failed <<< opencv_cam [13.8s, exited with code 2]

Summary: 1 package finished [19.4s]
1 package failed: opencv_cam
1 package had stderr output: opencv_cam**

Play movies back at fixed rate

When publishing a movie, the playback happens as fast as a single thread can process and publish the frames. Provide an option to slow it down to the rate that the movie was recorded.

build failed

i get this message when i tried to build the package :

`Starting >>> opencv_cam
--- stderr: opencv_cam
In file included from /home/osman/cam_ws/src/opencv_cam/include/opencv_cam/opencv_cam_node.hpp:10,
from /home/osman/cam_ws/src/opencv_cam/src/opencv_cam_node.cpp:1:
/home/osman/cam_ws/src/opencv_cam/include/opencv_cam/camera_context.hpp:7:10: fatal error: ros2_shared/context_macros.hpp: No such file or directory
7 | #include "ros2_shared/context_macros.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/opencv_cam_node.dir/build.make:76: CMakeFiles/opencv_cam_node.dir/src/opencv_cam_node.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:143: CMakeFiles/opencv_cam_node.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2

Failed <<< opencv_cam [18.3s, exited with code 2]

Summary: 1 package finished [22.0s]
1 package failed: opencv_cam
1 package had stderr output: opencv_cam
`

[SHOW&TELL]Introducing ros2_v4l2_camera driver that support intra and zero-copy IPC transport.

Hi, glad to see this project that support intra process transport!

zero-copy IPC through rclcpp loaned-api is the other option to avoid copy thus reducing the tansport latency and cpu usage.

https://github.com/ZhenshengLee/ros2_v4l2_camera has implement the intra-process transport and zero-copy transport.

ros2_v4l2_camera depends on https://github.com/ZhenshengLee/ros2_shm_msgs which is a lib for a more easy way to use zero copy transport with image(opencv) and pointcloud(pcl and open3d)

Feel free to check the readme
https://github.com/ZhenshengLee/ros2_v4l2_camera/blob/outdoor/rolling/README.md
https://github.com/ZhenshengLee/ros2_shm_msgs/blob/master/README.md

For more info of zero-copy IPC
https://design.ros2.org/articles/zero_copy.html
https://github.com/ros2/demos/blob/master/demo_nodes_cpp/src/topics/talker_loaned_message.cpp

Migrate to Foxy

opencv_cam runs on Foxy (except perhaps for IPC), but there are a few deprecation warnings. Add a branch for eloquent, and migrate the default branch to Foxy.

Green screen when opening a CSI camera.

I want to run the node ros2 run opencv_cam opencv_cam_main with a csi camera in a jetson nano and it is publishing a green screen.
file = false filename = fps = 0 height = 0 index = 1 width = 0 [INFO] [1699894211.469284797] [opencv_cam]: OpenCV version 4 [ WARN:0] global /opt/opencv/modules/videoio/src/cap_gstreamer.cpp (1761) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error. [ WARN:0] global /opt/opencv/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to start pipeline [ WARN:0] global /opt/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created [ WARN:0] global /opt/opencv/modules/videoio/src/cap_v4l.cpp (1914) getProperty VIDEOIO(V4L2:/dev/video1): Unable to get camera FPS [INFO] [1699894211.937151307] [opencv_cam]: device 1 open, width 3264, height 2464, device fps -1 [ERROR] [1699894211.937501568] [camera_calibration_parsers]: Failed to detect content in .ini file [ERROR] [1699894211.937577193] [opencv_cam]: cannot get camera info, will not publish [INFO] [1699894211.960939068] [opencv_cam]: start publishing

More control on how timestamps on the image message are generated

If streaming from a video camera: use get(CAP_PROP_POS_MSEC) as the time stamp of the message. (If this works).

If playing back a file: Instead of now() use some calculation based on the recorded fps and the playback fps. The original stream came from a hardware device that probably is more regular than the interrupted software loop that is generating the image messages.

Since it is a bit arbitrary in the file playback case what the timestamp is, pick stamps that end up on whole seconds where they can. In other words, if playing back at 5 fps, pick the stamp of the first messages to be the nearest whole second to now(). Every 5th frame after that will have a whole second timestamp. Obviously not very important, it might be helpful when debugging.

Deprecation warning in Galactic

/work/opencv_cam_ws/src/opencv_cam/src/opencv_cam_node.cpp: In member function ‘void opencv_cam::OpencvCamNode::loop()’:
/work/opencv_cam_ws/src/opencv_cam/src/opencv_cam_node.cpp:177:80: warning: ‘rclcpp::Duration::Duration(rcl_duration_value_t)’ is deprecated: Use Duration::from_nanoseconds instead or std::chrono_literals. For example:rclcpp::Duration::from_nanoseconds(int64_variable);rclcpp::Duration(0ns); [-Wdeprecated-declarations]
177 | next_stamp_ = next_stamp_ + rclcpp::Duration{1000000000L / publish_fps_};
| ^
In file included from /opt/ros/galactic/include/rclcpp/qos.hpp:20,
from /opt/ros/galactic/include/rclcpp/node_interfaces/node_graph_interface.hpp:31,
from /opt/ros/galactic/include/rclcpp/client.hpp:34,
from /opt/ros/galactic/include/rclcpp/callback_group.hpp:23,
from /opt/ros/galactic/include/rclcpp/any_executable.hpp:20,
from /opt/ros/galactic/include/rclcpp/memory_strategy.hpp:25,
from /opt/ros/galactic/include/rclcpp/memory_strategies.hpp:18,
from /opt/ros/galactic/include/rclcpp/executor_options.hpp:20,
from /opt/ros/galactic/include/rclcpp/executor.hpp:36,
from /opt/ros/galactic/include/rclcpp/executors/multi_threaded_executor.hpp:26,
from /opt/ros/galactic/include/rclcpp/executors.hpp:21,
from /opt/ros/galactic/include/rclcpp/rclcpp.hpp:156,
from /work/opencv_cam_ws/src/opencv_cam/include/opencv_cam/opencv_cam_node.hpp:6,
from /work/opencv_cam_ws/src/opencv_cam/src/opencv_cam_node.cpp:1:
/opt/ros/galactic/include/rclcpp/duration.hpp:46:12: note: declared here
46 | explicit Duration(rcl_duration_value_t nanoseconds);
| ^~~~~~~~

Port to Eloquent

ROS2 Eloquent is expected 11/22, betas are out now. Create a dashing branch, then port to master to Eloquent.

Playback terminates if image_raw messages are not being read fast enough

The easy and effective work-around is to specify the fps and slow the message generation down to a rate that the subscriber can keep up with.

An explanation is printed before the playback is terminated. I don't know if the node is terminated. The termination doesn't happen if there is no subscriber. (not a very useful scenario, but a clue as to what is going on at a lower level)

It would be interesting to investigate if there is an API that the publisher can use to figure out if its publish queue is filled. The publisher could then automatically wait until the queue empties a bit before publishing new frames.

Best effort publishing might solve the crash problem and could be an option. But for development/debug there will probably be cases where every frame it desired.

Stop publishing at EOF

Current: empty images are published at a high fps rate at EOF
Desired: stop publishing at EOF.

intra process communication not working

I am trying to get the intra process communication working.

I am just printing the address of published and subscribed messages in the opencv_cam_node and subscriber_node and I am getting different addresses, e.g.:

[opencv_cam]: Image message address [PUBLISH]:      0x7f5574002800
[image_subscriber]: Image message address [SUB]:    0x7f55740018e0
[opencv_cam]: Image message address [PUBLISH]:      0x7f5574002800
[image_subscriber]: Image message address [SUB]:    0x7f55740018e0
[opencv_cam]: Image message address [PUBLISH]:      0x7f5574002800
[image_subscriber]: Image message address [SUB]:    0x7f55740018e0

How do I enable the intra process communication such that the messages are shared between both nodes?

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.