Ejemplo n.º 1
0
if __name__ == "__main__":
    # Load use-case parameters
    config = load_use_case_config()

    # Connection to robot
    host = config['EVA']['comm']['host']
    token = config['EVA']['comm']['token']
    eva = Eva(host, token)

    # Compute grid points and robot joints
    eva_box = EvaGrids(eva, config, show_plot=True)
    joints = eva_box.get_grid_points(config['grids']['names'])

    # Go home before starting
    with eva.lock():
        eva.control_go_to(config['EVA']['home'])

    while True:
        for counter in range(len(joints[(config['grids']['names'][0])]['pick'])):
            joints_home = config['EVA']['home']
            joints_pick = joints[config['grids']['names'][0]]['pick'][counter]
            joints_drop = joints[config['grids']['names'][1]]['pick'][counter]
            joints_pick_hover = joints[config['grids']['names'][0]]['hover'][counter]
            joints_drop_hover = joints[config['grids']['names'][1]]['hover'][counter]

            # USER DEFINED WAY-POINTS
            joints_operation_A = []
            joints_operation_B = []
            joints_operation_C = []

            tool_path_grid_to_grid = {
Ejemplo n.º 2
0
host_ip = "your host"
token = "your token"
eva = Eva(host_ip, token)

# Set some default poses and a default orientation
pose_home = [0.057526037, 0.7658633, -1.9867575, 0.026749607, -1.732109, -0.011505207]
end_effector_orientation = {'w': 0.0, 'x': 0.0, 'y': 1.0, 'z': 0.0}

# Be carefull with this dimension - depending on the type of gripper
grid_z_position: float = 0.27

print("Waiting for Robot lock")
with eva.lock():

    print('Eva moving to home position')
    eva.control_go_to(pose_home)


    for grid_position in my_test_grid1:
        # Calculate joint angles for the grid position and goto those joint angles
        print('Eva going to grid position x={:f}, y={:f}'.format(grid_position.x, grid_position.y))

        # Initial hover position
        hover_position1 = {'x': grid_position.x, 'y': grid_position.y, 'z': grid_z_position+0.1}
        position_hover_angles = eva.calc_inverse_kinematics(pose_home, hover_position1, end_effector_orientation)
        eva.control_go_to(position_hover_angles['ik']['joints'])

        # Target position on the grid
        target_position1 = {'x': grid_position.x, 'y': grid_position.y, 'z': grid_z_position}
        position_joint_angles = eva.calc_inverse_kinematics(pose_home, target_position1, end_effector_orientation)
        eva.control_go_to(position_joint_angles['ik']['joints'])
Ejemplo n.º 3
0
from evasdk import Eva
import json

# This example shows usage of the Eva object, used for controlling Eva,
# reading Eva's current state and responding to different events triggered
# by Eva's operation.

host_ip = input("Please enter a Eva IP: ")
token = input("Please enter a valid Eva token: ")

eva = Eva(host_ip, token)

# Send Eva to a waypoint
with eva.lock():
    eva.control_wait_for_ready()
    eva.control_go_to([0, 0, 0, 0, 0, 0])

# Print Eva's toolpaths
toolpaths = eva.toolpaths_list()
outToolpaths = []
for toolpathItem in toolpaths:
    toolpath = eva.toolpaths_retrieve(toolpathItem['id'])
    outToolpaths.append(toolpath)
print(json.dumps(outToolpaths))

# Create a basic toolpath and execute it
toolpath = {
    "metadata": {
        "version": 2,
        "default_max_speed": 0.25,
        "payload": 0,