Created
February 12, 2017 18:39
-
-
Save SantoshBanisetty/b8f0094cf7d3fcc9ee3d7f056681104f to your computer and use it in GitHub Desktop.
LIST_STRIP rospy not working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def links(): | |
global lcount, lkey | |
link = Marker() | |
link.header.frame_id = "/myframe" | |
link.type = Marker.LINE_STRIP | |
link.action = Marker.ADD | |
link.scale.x = 0.2 | |
link.scale.y = 0.2 | |
link.scale.z = 0.2 | |
link.color.a = 1.0 | |
link.color.r = 0.0 | |
link.color.g = 1.0 | |
link.color.b = 0.0 | |
link.pose.orientation.w = 1.0 | |
link.pose.position.x = p[lkey][0] | |
link.pose.position.y = p[lkey][1] | |
link.pose.position.z = p[lkey][2] | |
if(lcount > MARKERS_MAX): | |
linkArray.markers.pop(0) | |
linkArray.markers.append(link) | |
# Renumber the marker IDs | |
id = 0 | |
for ml in linkArray.markers: | |
ml.id = id | |
id += 1 | |
# Publish the MarkerArray | |
link_publisher.publish(linkArray) | |
lcount += 1 | |
lkey += 1 | |
if lkey == 3: | |
lkey = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment