Example #1
0
def test_robot_decor():
    """
    Test importing textures and changing joint colours
    """
    new_rot = gph.RotationalJoint(SE3(), 1.0, g_canvas.scene)

    # Load a sample texture
    new_rot.set_texture(
        texture_link=
        "https://s3.amazonaws.com/glowscript/textures/flower_texture.jpg")

    sleep(5)

    # Green shift the texture
    new_rot.set_texture(
        colour=[0, 0.75, 0],
        texture_link=
        "https://s3.amazonaws.com/glowscript/textures/flower_texture.jpg")

    sleep(5)

    # Remove the texture and red shift
    new_rot.set_texture(colour=[1, 0, 0])

    sleep(5)

    # Remove all details
    new_rot.set_texture()

    # Set transparency
    new_rot.set_transparency(0.3)
Example #2
0
def test_rotational_link():
    """
    This test will create a simple rotational link from (0, 0, 0) to (1, 0, 0).
    """
    arr = array([[0, 0, -1, 0], [0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1]])
    se3 = SE3(arr)

    rot_link = gph.RotationalJoint(se3, 1.0, g_canvas.scene)
    rot_link.draw_reference_frame(True)