publish marker
Hi, I'm trying to publis a simple marker. A cilinder. I've done this code
#!/usr/bin/python import roslib; roslib.load_manifest('ellipse_marker') from visualization_msgs.msg import Marker import rospy rospy.init_node('ellipse', anonymous=True) publisher = rospy.Publisher("ellipse", Marker) count = 0 while not rospy.is_shutdown(): ellipse = Marker() ellipse.header.frame_id = "odom" ellipse.header.stamp = rospy.Time.now() ellipse.type = Marker.CYLINDER ellipse.pose.position.x = 0 ellipse.pose.position.y = 0 ellipse.pose.position.z = 0 ellipse.pose.orientation = (0,0,0,1) ellipse.scale.x = 2*count ellipse.scale.y = 2*count ellipse.scale.z = 1 ellipse.color.a = 1.0 ellipse.color.r = 1.0 ellipse.color.g = 1.0 ellipse.color.b = 1.0 count += 0.1 # Publish the MarkerArray publisher.publish(ellipse) rospy.sleep(0.01)
But, when i run this node i get the following error:
Traceback (most recent call last): File ".../ellipse_marker/src/ellipse_marker.py", line 29, in <module> publisher.publish(ellipse) File "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py", line 695, in publish self.impl.publish(data) File "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py", line 872, in publish serialize_message(b, self.seq, message) File "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/msg.py", line 151, in serialize_message msg.serialize(b) File "/opt/ros/electric/stacks/common_msgs/visualization_msgs/src/visualization_msgs/msg/_Marker.py", line 218, in serialize buff.write(_struct_3i10d4f2iB.pack(_x.id, _x.type, _x.action, _x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.scale.x, _x.scale.y, _x.scale.z, _x.color.r, _x.color.g, _x.color.b, _x.color.a, _x.lifetime.secs, _x.lifetime.nsecs, _x.frame_locked)) AttributeError: 'tuple' object has no attribute 'x'
can somebody help me?
Thanks!