Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can't get zbar_ros to recognize QR code

Hello,

Beginner here -- I am trying to use zbar_ros to read a qr code using my laptop's webcam. It doesn't seem to be able to subscribe to the /image topic and /barcode_reader isn't subscribed to anything. I am using Ubuntu 14.04 and ROS indigo. Any thoughts on what I am missing?

My launch file: <launch>

<node pkg="nodelet" type="nodelet" name="zbar_manager"  args="manager"/>

<!-- Example camera launch -->
<node pkg="nodelet" type="nodelet" name="uvc_camera" args="load uvc_camera/CameraNodelet zbar_manager">
    <remap from="image_raw" to="image"/>
<param name="device" type="string" value="/dev/video0"/>
</node>

<!--<node pkg="nodelet" type="nodelet" name="barcode_reader" args="load zbar_ros/barcode_reader_nodelet zbar_manager">-->
    <!--<param name="throttle_repeated_barcodes" type="double" value="2.0"/>-->
<!--</node>-->

<node pkg="zbar_ros" type="barcode_reader_node" name="barcode_reader">
    <param name="throttle_repeated_barcodes" type="double" value="2.0"/>
</node>

</launch>

$roslaunch zbar_ros customlaunch.launch

SUMMARY   
========

PARAMETERS
 * /barcode_reader/throttle_repeated_barcodes: 2.0
 * /rosdistro: indigo
 * /rosversion: 1.11.20
 * /uvc_camera/device: /dev/video0

NODES
  /
    barcode_reader (zbar_ros/barcode_reader_node)
    uvc_camera (nodelet/nodelet)
    zbar_manager (nodelet/nodelet)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[zbar_manager-1]: started with pid [6111]
process[uvc_camera-2]: started with pid [6112]
process[barcode_reader-3]: started with pid [6113]

$ rosnode info /barcode_reader

Node [/barcode_reader]
Publications: 
 * /rosout [rosgraph_msgs/Log]
 * /barcode [std_msgs/String]

Subscriptions: None

Services: 
 * /barcode_reader/get_loggers
 * /barcode_reader/set_logger_level
 * /barcode_reader/load_nodelet
 * /barcode_reader/unload_nodelet
 * /barcode_reader/list


contacting node http://192.168.40.120:37988/ ...
Pid: 6113
Connections:
 * topic: /rosout
    * to: /rosout
    * direction: outbound
    * transport: TCPROS