Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.

Any Ideas?

Sorry for my English and thanks for your answers

The callback is updated later

class Laser:

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 2.50GHz

cpu MHz : 800.000 800.000

cache size : 3072 KB KB

RAM : 6 G

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

Any Ideas?

Sorry for my English and thanks for your answers

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

The callback is updated later

class Laser:

    def __init__(self):

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

LaserScan, self.laser_callback) 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

The callback is updated later

class Laser:

    def __init__(self):

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

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

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