Skip to content

Instantly share code, notes, and snippets.

@SantoshBanisetty
Created February 12, 2017 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SantoshBanisetty/b8f0094cf7d3fcc9ee3d7f056681104f to your computer and use it in GitHub Desktop.
Save SantoshBanisetty/b8f0094cf7d3fcc9ee3d7f056681104f to your computer and use it in GitHub Desktop.
LIST_STRIP rospy not working
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