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

icarold's profile - activity

2021-03-18 10:53:18 -0500 received badge  Notable Question (source)
2021-03-18 10:53:18 -0500 received badge  Famous Question (source)
2019-06-25 18:02:38 -0500 received badge  Famous Question (source)
2019-06-25 18:02:38 -0500 received badge  Notable Question (source)
2017-06-03 16:18:43 -0500 received badge  Famous Question (source)
2017-06-02 20:58:29 -0500 received badge  Popular Question (source)
2017-05-31 15:07:56 -0500 asked a question Update Odometry

Update Odometry Good afternoon friends I need to urgently update the odometry of my system. I send the information odo

2017-05-05 20:30:31 -0500 received badge  Famous Question (source)
2017-05-05 20:30:31 -0500 received badge  Notable Question (source)
2017-05-05 20:30:31 -0500 received badge  Popular Question (source)
2017-05-02 20:16:49 -0500 asked a question Problem with Odometry

Problem with Odometry Good night friends, I pass a coordinate to my robot. He can get to it, however, the data from the

2017-04-15 23:36:50 -0500 received badge  Popular Question (source)
2017-04-15 13:30:07 -0500 commented answer Listener does not update

Great, my friend!! The problem was the loop!!! Thanks alot for the help!!

2017-04-15 12:08:45 -0500 received badge  Editor (source)
2017-04-15 11:45:29 -0500 asked a question Listener does not update

Good afternoon friends

I can get an image of the camera from the gazebo: /camera/image_raw. But if you change the qr code, the listener does not update.

Can anyone help me with this?

#! /usr/bin/python

import rospy
import numpy as np
import cv2
import cv
import zbar

from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge

bridge = CvBridge()

def callback(msg):
    cv2_img = bridge.imgmsg_to_cv2(msg, "bgr8")
    scanner = zbar.ImageScanner()
    scanner.parse_config('enable')

    while not rospy.is_shutdown():
        gray = cv2.cvtColor(cv2_img, cv2.COLOR_BGR2GRAY, dstCn=0)

        frame = np.array(gray)
        width, height = frame.shape[1], frame.shape[0]

        raw = frame.tostring()

        image = zbar.Image(width, height, 'Y800', raw)
        scanner.scan(image)

        qrc = None

        for symbol in image:
            qrc = symbol.data

        if qrc != None:
            qr_str = qrc
            rospy.loginfo(qr_str)

def qr_main():
    rospy.init_node('qr_listener')

    rospy.Subscriber("/camera/image_raw", Image, callback)

    rospy.spin()

if __name__ == '__main__':
    qr_main()
2017-04-15 11:10:13 -0500 received badge  Enthusiast
2017-04-14 09:32:09 -0500 received badge  Scholar (source)
2017-04-14 09:30:58 -0500 received badge  Supporter (source)
2017-04-13 17:32:46 -0500 commented answer Problem Listener with

Thanks friends for the help!! NEngelhard, this link that you sent helped me and it worked, I managed to do !! Thank you

2017-04-13 09:33:05 -0500 commented answer Problem Listener with

If I take the read() error in the:

ret, output = data
TypeError: 'Image' object is not iterable
2017-04-13 09:32:39 -0500 commented answer Problem Listener with

I used the sensor_msgs.msg import image as suggested, but now it is giving no error data.read().

File "/home/icaro/catkin_ws/src/tcc/scripts/listener_qr.py", line 14, in callback
     Ret, output = data.read ()
AttributeError: 'Image' object has no attribute 'read'
2017-04-13 02:16:01 -0500 received badge  Notable Question (source)
2017-04-12 20:47:35 -0500 answered a question Problem Listener with

The command did not work:

from visualization_msgs.msg import Image
ImportError: cannot import name Image
2017-04-12 20:45:45 -0500 received badge  Popular Question (source)
2017-04-12 11:07:12 -0500 commented answer Problem Listener with

Many thanks, my friend !! Lack of attention to mine. I'll test here

2017-04-12 09:35:38 -0500 asked a question Problem Listener with

Good morning people

I did a listener for the camera/image_raw node republish (camera/image_test, but the following error appears: Client [/ QR_Listener_5598_1492006578702] wants topic /camera/image_test to have datatype/md5sum [std_msgs /String/992ce8a1687cec8c8bd883ec73ca41d1], but our version has [sensor_msgs/Image/060021388200f6f0f447d0fcd9c64743]. Dropping connection.

Follow the listener code:

#!/usr/bin/env python

import rospy
import cv2
import zbar

from std_msgs.msg import String
from PIL import Image

def callback(data):
    scanner = zbar.ImageScanner()
    scanner.parse_config('enable')

    while not rospy.is_shutdown():
        ret, output = data.read()

        if not ret:
            continue

        gray = cv2.cvtColor(output, cv2.COLOR_BGR2GRAY, dstCn=0)
        pil = Image.fromarray(gray)
        width, height = pil.size
        raw = pil.tobytes()
        image = zbar.Image(width, height, 'Y800', raw)
        scanner.scan(image)

        qrc = None

        for symbol in image:
            print '"%s"' % symbol.data
            qrc = symbol.data

        qrc

        cv2.imshow("#Qr Code", output)

        if qrc != None:
            rospy.loginfo(rospy.get_caller_id() + "Qr Code %s:", data.data)


def listener():
    rospy.init_node('QR_Listener', anonymous=True)

    rospy.Subscriber("/camera/image_test", String, callback)

    rospy.spin()


if __name__ == '__main__':
    try:
        listener()

    except rospy.ROSInterruptException:
        pass
2017-04-09 00:19:42 -0500 asked a question Opening the camera of the Gazebo by ROS

Good afternoon friends Sorry for my English. I am having the following problem: I am simulating an environment with a non-Gazebo simulator robot, but I need to access a camera of this simulation. I made a program that uses VideoCapture (), but it does not access a Gazebo camera. Is there a way I can work with a gazebo camera? Thanks for listening