def laser_listener(): rospy.init_node('laser_listener', anonymous=True) rospy.Subscriber("/scan", LaserScan,callback) rospy.spin()