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

How to compile opencv with camera

asked 2011-03-06 18:18:24 -0500

Yongqiang Gao gravatar image

Hello, I try to compile my old projection with opencv. And about connecting camera, I try run code, and to run this node, I should open the camera stream. so I try rosrun usb_cam, which open the Logitech Quick-cam. But I have no idea about how to get this camera stream to link the my own node.

and this is my rxgraph: C:\fakepath\Screenshot.png

and also my rostopic list as belows:

/image_topic /image_topic_2 /image_topic_2/compressed /image_topic_2/compressed/parameter_descriptions /image_topic_2/compressed/parameter_updates /image_topic_2/theora /image_topic_2/theora/parameter_descriptions /image_topic_2/theora/parameter_updates /rosout /rosout_agg /usb_cam/camera_info /usb_cam/image_raw /usb_cam/image_raw/compressed /usb_cam/image_raw/compressed/parameter_descriptions /usb_cam/image_raw/compressed/parameter_updates /usb_cam/image_raw/theora /usb_cam/image_raw/theora/parameter_descriptions /usb_cam/image_raw/theora/parameter_updates

Any one can help me? and I aim to build my own opecv-projection on ROS system.

Best wishes!

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2011-03-07 15:51:07 -0500

KoenBuys gravatar image

Could you publish your rxgraph screenshot again with the show all topic marked? It seems that you need to remap the topic upon launching your node. More info here.

something like:

rosrun <your_package_name> <exec_name> image:=/usb_cam/image
edit flag offensive delete link more


As "", should I input the command as :$rosrun ros_opencv example image:=/usb_cam/image_raw? I find that it doesn't connect between the node of "usb_cam" and the node of "image_converter", more advice?
Yongqiang Gao gravatar image Yongqiang Gao  ( 2011-03-07 18:02:23 -0500 )edit
Yongqiang, in your code, you want to subscribe to a topic named "image_topic". Your usb_cam node sends an image topic named "image". Following Koen's advice, you need to tell your node to subscribe to "image" in spite of "image_topic". Do this like this: $rosrun ros_opencv example image_topic:=image
raphael favier gravatar image raphael favier  ( 2011-03-08 00:38:29 -0500 )edit
Yeah, i got it. I should edit my own subscriber, and most of image processes are in subscriber file. Thanks for raphael favier and KoenBuys.
Yongqiang Gao gravatar image Yongqiang Gao  ( 2011-03-08 11:39:18 -0500 )edit

answered 2011-03-07 11:34:42 -0500

Yongqiang Gao gravatar image

Ok, I am just learning the tf,.Thank u.

edit flag offensive delete link more

answered 2011-03-06 18:47:00 -0500

Prasad gravatar image

updated 2011-03-06 18:47:24 -0500

Hi, You can use static_transform_publisher x y z qx qy qz qw frame_id child_frame_id period_in_ms More Information: tf


edit flag offensive delete link more

Question Tools


Asked: 2011-03-06 18:18:24 -0500

Seen: 737 times

Last updated: Mar 07 '11