Ask Your Question

Revision history [back]

Did you do an echo on your published topic to see if something is actually published?

I think you should declare your publisher once at the beginning of your program. I had experienced some problems before when there wasn't enough time between publisher declaration and publishing and nothing was actually published. So in your initializer function define this publisher

def __init__(self):
        self.pub = rospy.Publisher(frame, Marker, queue_size = 100)

and then in your function

self.pub.publish(marker)

if it still doesn't work, try

def __init__(self):
        self.pub = rospy.Publisher(frame, Marker, queue_size = 100)
        rospy.sleep(1)