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

Lucer's profile - activity

2022-10-28 15:05:45 -0500 received badge  Famous Question (source)
2022-10-28 15:05:45 -0500 received badge  Notable Question (source)
2022-10-28 15:05:45 -0500 received badge  Popular Question (source)
2017-04-08 07:37:14 -0500 received badge  Taxonomist
2016-08-08 03:15:52 -0500 asked a question The callback is updated later

class Laser:

    def __init__(self):

        self.sub = rospy.Subscriber('front_laser/scan', LaserScan, self.laser_callback)

    def laser_callback(self, scan):

        print "rango 340: " +str(scan.ranges[340])

        ... DoSOMETHING ...

if __name__ == '__main__':
    rospy.init_node('laser')
    Laser()
    rospy.spin()

When I execute the node, the print in the callback is updated later with the correct data and I don't know if it is for my code (DoSOMETHING) does many things, my computer is not very powerfull or something wrong with ros - No such check - . If I remove DoSOMETHING, the print is updated correct, but I need doing DoSOMETHING.

My computer is:

model name : Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz

cpu MHz : 800.000

cache size : 3072 KB

RAM : 6 G

I use gazebo simulator with Pioneer 3dx and hayuko laser.

Example: In Gazebo has:

robot ------(range:5)----->

in shell:

5 5 5 .....

You move the robot in gazebo:

robot ----(range:3)-->

in shell:

5 5 5 (after a few seconds) 4 4 3 3 3

Any Ideas?

Sorry for my English and thanks for your answers

2016-08-03 04:59:06 -0500 asked a question About quize_size

Hi,

Sorry but I don't understand nothing about "quize_size". Ok, it is the size of the outgoing message queue used for asynchronous publishing, but I don't understand the number, which means that number? and as you can see if the size is correct?

Sorry for my English and thanks for your answers :)

2015-08-01 13:00:06 -0500 received badge  Famous Question (source)
2015-08-01 13:00:06 -0500 received badge  Notable Question (source)
2015-07-02 08:57:11 -0500 received badge  Famous Question (source)
2015-06-24 11:30:35 -0500 received badge  Editor (source)
2015-06-24 11:28:40 -0500 answered a question I would like convert pcd to image

How? Because I write:

pub_cloud = rospy.Publisher("camera/depth_registered/points_nube", PointCloud2)
pub_cloud.publish(cloud_plane)

I get the next error:

TypeError: Invalid number of arguments, args should be ['header', 'height', 'width', 'fields', 'is_bigendian', 'point_step', 'row_step', 'data', 'is_dense'] args are(<pointcloud of="" 3444="" points="">,)

Thanks for your answer ;)

2015-05-20 11:13:24 -0500 received badge  Notable Question (source)
2015-05-01 20:08:44 -0500 received badge  Popular Question (source)
2015-04-30 18:33:35 -0500 received badge  Popular Question (source)
2015-04-05 11:39:06 -0500 asked a question I would like convert pcd to image

Hello,

My question is: As can I visualize pcd files or the result of a function cloud_plane = cloud.extract(indices, negative=False) without rgb fiel (Can I see in rviz?)

The process is as follow:

I have a topic: /camera/depth/points [sensor_msgs/PointCloud2] And I get points this way (in phyton):


    points = pc2.read_points(data,"x, y, z")
    cloud= getCloud(points)
def getCloud(points):
    points_cloud=[]
    for point in points:
    points_cloud.append([punto[0],punto[1],punto[2]])
    cloud = pcl.PointCloud(np.array(pointscloud, dtype=np.float32))
    return cloud

Without RGB field. Then exec RANSAC


    seg = cloud.make_segmenter()
    seg.set_model_type(pcl.SACMODEL_PLANE)
    seg.set_method_type(pcl.SAC_RANSAC)
    seg.set_distance_threshold(0.001)
    seg.set_distance_threshold(0.03)
    indices, model = seg.segment()
    cloud_plane = cloud.extract(indices, negative=False)
    cloud_plane.to_file("plane.pcd")

Plane.pcd is:


VERSION 0.7
FIELDS x y z
SIZE 4 4 4
TYPE F F F
COUNT 1 1 1
WIDTH 91259
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 91259
DATA ascii
-4.4817686 0.35769984 7.7747769
-4.4677291 0.35769889 7.7747564
-4.4536958 0.35769838 7.7747455
-4.4396615 0.35769784 7.7747335
-4.4256258 0.35769719 7.7747192
-4.4115911 0.35769659 7.7747064
-4.3975549 0.35769585 7.7746902

ETC.

Some answer?

Thanks !!

2015-02-08 03:35:47 -0500 received badge  Enthusiast
2015-01-27 04:03:30 -0500 asked a question Ransac, Kinect and others

Hy,

I`m writting this subscriptor:

   #!/usr/bin/env python

import rospy
import sensor_msgs.point_cloud2 as pc2
from sensor_msgs.msg import PointCloud2, PointField, Image
from roslib import message
import pcl
#listener
def listen():

    rospy.init_node('listen', anonymous=True)
    rospy.Subscriber("/camera/depth/points", PointCloud2, callback_kinect)
    rospy.spin()

def callback_kinect(data) :
    points = pc2.read_points(data,"x,y")

My question is: Can I convert the points (only x,y without RGB) to image that I can see (for example rviz or other)? and the second question: Is There any library that I can use to detect an object (with RANSAC, for example or other), like a ball (in 3D or 2D) in python?

Regards and Thanks.