ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to stream gazebo camera into openCV

asked 2021-02-13 06:15:49 -0600 gravatar image

I have followed this tutorial to simulate IRIS quad copter in gazebo and control it using dronekit on python.

I read my webcam stream using openCV's 'cap = cv2.VideoCapture(0) '

How to make this function read the simulated camera on the iris quadcopter?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2021-02-25 22:51:49 -0600

loguna gravatar image

For me I ususlly use a "" plugin to capture Gazebo images and publish to a Ros topic.

Afterwards, obtain the Image via Ros topic and use Cv_Bridge to turn the image into OpenCV friendly.

edit flag offensive delete link more

answered 2021-02-15 13:33:43 -0600

msantos gravatar image

You shall use cv_bridge to convert the Gazebo Image topics into OpenCV freindly image frames. I am almost sure, OpcenCV by itself won't detect Gazebo Topics as a streaming source.

You can find out more here, and in this question from myself, with a sample code.

Hope you can manage to do it.

edit flag offensive delete link more

Question Tools


Asked: 2021-02-13 06:15:49 -0600

Seen: 2,360 times

Last updated: Feb 25 '21