def talker(): pub = rospy.Publisher('burlap_state', burlap_state, queue_size=10) rospy.init_node('talker', anonymous=True) rate = rospy.Rate(10) # 10hz while not rospy.is_shutdown(): s = burlap_state() s.objects = [] pub.publish(s) rate.sleep()
def publishState(self): if not self.verifyStateReady(): return obArray = [self.agent] obArray += self.blocks s = burlap_state() s.objects = obArray self.pub.publish(s)
def talker(): pub = rospy.Publisher('burlap_state', burlap_state, queue_size=10) rospy.init_node('talker', anonymous=True) rate = rospy.Rate(10) # 10hz while not rospy.is_shutdown(): xv = burlap_value() xv.attribute = 'x' xv.value = '3' yv = burlap_value() yv.attribute = 'y' yv.value = '5' agent = burlap_object() agent.name = 'turtlebot' agent.object_class = 'agent' agent.values = [xv, yv] s = burlap_state() s.objects = [agent] pub.publish(s) rate.sleep()
def talker(): pub = rospy.Publisher("burlap_state", burlap_state, queue_size=10) rospy.init_node("talker", anonymous=True) rate = rospy.Rate(10) # 10hz while not rospy.is_shutdown(): xv = burlap_value() xv.attribute = "x" xv.value = "3" yv = burlap_value() yv.attribute = "y" yv.value = "5" agent = burlap_object() agent.name = "turtlebot" agent.object_class = "agent" agent.values = [xv, yv] s = burlap_state() s.objects = [agent] pub.publish(s) rate.sleep()
def publishState(self): if self.agent != None: s = burlap_state() s.objects = [self.agent] self.pub.publish(s)