def update(self, offset, x, y, z, r, color): marker = VisualizationMarker() marker.header.frame_id = "base" marker.id = self.id + offset marker.type = 2 marker.action = 0 marker.x = x marker.y = y marker.z = z marker.yaw = 0 marker.pitch = 0 marker.roll = 0 marker.xScale = r marker.yScale = r marker.zScale = r marker.alpha = 255 marker.r = color[0] marker.g = color[1] marker.b = color[2] marker.points = [] vm_pub.publish(marker) marker.zScale = 0 marker.z = -tableh marker.id += 200 marker.r = 0 marker.g = 0 marker.b = 0 vm_pub.publish(marker)
def floor(self): marker = VisualizationMarker() marker.header.frame_id = "base" marker.id = self.id + 99999 marker.type = 1 marker.action = 0 marker.x = 0 marker.y = 0 marker.z = -(5 + tableh + .1) marker.yaw = 0 marker.pitch = 0 marker.roll = 0 marker.xScale = 10 marker.yScale = 10 marker.zScale = 10 marker.alpha = 255 marker.r = 0.3 * 255 marker.g = 0.4 * 255 marker.b = 0.7 * 255 marker.points = [] vm_pub.publish(marker)
def linestrip(self, offset, points, color): marker = VisualizationMarker() marker.header.frame_id = "base" marker.id = self.id + offset marker.type = 4 marker.action = 0 marker.x = 0 marker.y = 0 marker.z = 0 marker.yaw = 0 marker.pitch = 0 marker.roll = 0 marker.xScale = .1 marker.yScale = 1 marker.zScale = 1 marker.alpha = 255 marker.r = color[0] marker.g = color[1] marker.b = color[2] marker.points = points vm_pub.publish(marker) marker.points = [Position(p.x, p.y, -tableh) for p in points] marker.id += 200 marker.r = 0 marker.g = 0 marker.b = 0 vm_pub.publish(marker)