示例#1
0
    def buildMessage(self, stamp):
        cube = initMarker(baseFrameId=self._frameId, markerNamespace=self._markerNamespace, markerId=self._markerId, stamp=stamp, markerType=Marker.CUBE)
        cube.scale.x = self._scale[0]
        cube.scale.y = self._scale[1]
        cube.scale.z = self._scale[2]
        cube.pose = self._pose
        cube.color = ColorRGBA(*self._color)

        return cube
示例#2
0
    def buildMessage(self, stamp):
        lines = initMarker(baseFrameId=self._frameId, markerNamespace=self._markerNamespace, markerId=self._markerId, stamp=stamp, markerType=Marker.LINE_LIST)
        lines.scale.x = self._lineWidth

        for p, color in itertools.izip(self._points, self._colors):
            lines.points.append(Point(*p))
            lines.colors.append(ColorRGBA(*color))

        return lines
示例#3
0
    def buildMessage(self, stamp):
        spheres = initMarker(baseFrameId=self._frameId, markerNamespace=self._markerNamespace, markerId=self._markerId, stamp=stamp, markerType=Marker.SPHERE_LIST)
        spheres.scale.x = self._radius

        for c, color, time in self._spheres:
            spheres.points.append(Point(*c))
            spheres.colors.append(ColorRGBA(*color))

        
        return spheres
示例#4
0
    def buildMessage(self, stamp):
        triangles = initMarker(baseFrameId=self._frameId, markerNamespace=self._markerNamespace, markerId=self._markerId, stamp=stamp, markerType=Marker.TRIANGLE_LIST)

        for p, color in itertools.izip(self._points, self._colors):
            triangles.points.append(Point(*p))
            triangles.colors.append(ColorRGBA(*color))
            
            # There seems to a be a bug so that the alpha channel for every object is taken from to global color entry
            triangles.color = ColorRGBA(*color)

        return triangles
示例#5
0
    def buildMessage(self, stamp):
        text = initMarker(baseFrameId=self._frameId, 
                          markerNamespace=self._markerNamespace, 
                          markerId=self._markerId, 
                          stamp=stamp, 
                          markerType=Marker.TEXT_VIEW_FACING)
        text.scale.z = self._scale

        text.pose.position.x = self._position[0]
        text.pose.position.y = self._position[1]
        text.pose.position.z = self._position[2]
        
        # This next line is awesome
        text.text = self._text
        return text
示例#6
0
    def buildMessage(self, stamp):
        cframes = initMarker(   baseFrameId=self._frameId, 
                                markerNamespace=self._markerNamespace, 
                                markerId=self._markerId, 
                                stamp=stamp, 
                                markerType=Marker.LINE_LIST)

        cframes.scale.x = self._lineWidth

        for pr in self._edgePointPairs:
            cframes.points.append(pr[0])
            cframes.points.append(pr[1])
            cframes.colors.append(self._defaultColor)
            cframes.colors.append(self._defaultColor)

        return cframes