Ejemplo n.º 1
0
def camera_obj():
    cam_obj = web_camera()
    yield cam_obj
    cam_obj.destroy()
Ejemplo n.º 2
0
    global lr, br
    # then define the marker id for the object
    markers = {0: 3.9, 6: 2.5, 2: 2.9, 5: 1.9, 20: 3.0}
    avm = april_tag_detection.ApriltagVisionModule(markers)

    # select an appropriate camera first
    camera_selection = 3
    cam = None
    if camera_selection == 0:
        pass
    elif camera_selection == 1:
        from cameras.realsense import realsense
        cam = realsense()
    elif camera_selection == 2:
        from cameras.web_camera import web_camera
        cam = web_camera()
    elif camera_selection == 3:
        from cameras.realsense_TX2 import realsenseTX2
        cam = realsenseTX2()

    # then select a robot
    rospy.init_node("visualrender", anonymous=True)
    #robot = Ginger()
    #robot.rate.sleep()

    _GINGER = 'BUTTERFLY'
    g_camera_head = None
    if _GINGER == 'OLD':
        g_camera_head = tf.transformations.euler_matrix(
            0, -np.pi / 5.5, np.pi / 2, 'syxz')  # y-x-z axis
        g_camera_head[0, -1] = 0.14