コード例 #1
0
ファイル: helper.py プロジェクト: fhogan/rgrasp
def plotBoxCorners(corner_points,
                   viz_pub=None,
                   color_rgb=None,
                   namespace='corner_points',
                   isFeasible=None):
    if viz_pub != None:
        markers_msg = MarkerArray()
        #~ markers_msg.markers.append(createAllMarker('corner_points'))
        for i in range(0, len(corner_points)):
            #~ if isFeasible[i] is not:
            if color_rgb == None:
                my_rgb = (1, 0, 1, 1)
            else:
                my_rgb = color_rgb
            m = createSphereMarker(offset=tuple(corner_points[i]),
                                   marker_id=(i + 1),
                                   rgba=my_rgb,
                                   orientation=(0.0, 0.0, 0.0, 1.0),
                                   scale=(.015, .015, .015),
                                   frame_id="/map",
                                   ns=namespace)
            markers_msg.markers.append(m)

        viz_pub.publish(markers_msg)
        viz_pub.publish(markers_msg)
        viz_pub.publish(markers_msg)
        viz_pub.publish(markers_msg)
        rospy.sleep(.1)
コード例 #2
0
def vizPoint(pos):
    """point visualization"""
    marker = createSphereMarker(offset=pos,
                                color=[0, 0, 1, 0.5],
                                scale=[0.01, 0.01, 0.01])
    vizpub.publish(marker)
    marker.id = 201
コード例 #3
0
def vizSphere(vizpub, pose, scale, frame_id, rgba=(0.5,0.5,0.5,1), marker_id=2):
    # prepare block visualization
    meshmarker = createSphereMarker(color=rgba,
                 scale = scale,
                 offset=tuple(pose[0:3]),  
                 orientation=tuple(pose[3:7]), frame_id=frame_id, marker_id = marker_id)
    meshmarker.ns = frame_id
    vizpub.publish(meshmarker)
コード例 #4
0
def vizPoint(pos):
    # prepare block visualization
    global vizpub
    marker = createSphereMarker(offset=pos,
                                color=[0, 0, 1, 0.5],
                                scale=[0.01, 0.01, 0.01])
    vizpub.publish(marker)
    rospy.sleep(0.1)
コード例 #5
0
ファイル: helper.py プロジェクト: mcubelab/rgrasp
def plotPickPoints(pick_points,viz_pub=None,special_index=None):
    if viz_pub!=None:
        markers_msg = MarkerArray()
        markers_msg.markers.append(createDeleteAllMarker('picking_points'))
        for i in range(0,len(pick_points)):
            if i==special_index:
                my_rgb=(0,1,0,1)
            else:
                my_rgb=(1,0,1,1)
	    m=createSphereMarker(offset=tuple(pick_points[i]), marker_id = (i+1), rgba=my_rgb, orientation=(0.0,0.0,0.0,1.0), scale=(.03,.03,.03), frame_id="/map", ns = 'picking_points')
	    markers_msg.markers.append(m)
	viz_pub.publish(markers_msg)
	viz_pub.publish(markers_msg)
	viz_pub.publish(markers_msg)
	viz_pub.publish(markers_msg)
	rospy.sleep(.1)
コード例 #6
0
ファイル: contour_follow.py プロジェクト: peterkty/pnpush
def vizPoint(pos):
    # prepare block visualization
    global vizpub
    marker = createSphereMarker(offset=pos, color=[0, 0, 1, 0.5], scale=[0.01,0.01,0.01])
    vizpub.publish(marker)
    rospy.sleep(0.1)