コード例 #1
0
ファイル: wait.py プロジェクト: jiajia-404/TydingUpProject
#!/usr/bin/env python3

from automata.Eva import Eva
import time
import json
import math

host_ip = '172.16.172.1'
token = '71e699b1-cc5f-4fc5-900a-16e227bcfdd5'

eva = Eva(host_ip, token)

print('connected!')

start_joints_deg = [0.1, 11.16, -74.5, 3.15, -115.14, -114.42]
finish_joints_deg = [-169.83, 31.58, -120.37, -7.65, -93.96, -110.53]
# Convert joint angles from deg to rad
start_joints_rad = []
for joint in start_joints_deg:
    start_joints_rad.append(round(joint * (math.pi / 180), 3))

finish_joints_rad = []
for joint in finish_joints_deg:
    finish_joints_rad.append(round(joint * (math.pi / 180), 3))

# Send Eva to a waypoint
with eva.lock():
    eva.control_wait_for_ready()
    eva.control_go_to(start_joints_rad, True, 0.5, None)
    eva.control_wait_for_ready()
    eva.control_go_to(finish_joints_rad, True, 0.2, None)
コード例 #2
0
z_old = 0.5
def callback(data):
    rospy.loginfo(rospy.get_caller_id() + "I heard %s", data.data)
    global x, y, z, x_old, y_old
    x_old = x
    x = data.data[0]
    y_old = y 
    y = data.data[1]
    z = data.data[2]-62.5
 
################################################################

host_ip = '172.16.172.1'
token = '71e699b1-cc5f-4fc5-900a-16e227bcfdd5'

eva = Eva(host_ip, token)

start_joints_deg = [0.1, 11.16,-74.5,3.15,-115.14,-114.42] # Read from Go-to on choreograph
# start_joints_deg = [8.58,-21.02,-131.61,5.03,-27.68,-91.19]

# Convert joint angles from deg to rad
start_joints_rad = []
for joint in start_joints_deg:
    start_joints_rad.append( round( joint * (math.pi/180),3) )
# "start_joints_rad = [0.15, -0.367, -2.297, 0.088, -0.483, -1.592]"

# Calculate starting end effector position
start_end_eff = eva.calc_forward_kinematics(start_joints_rad)

# !!check the usage of "start_end_eff"
init_orient_quat = start_end_eff['orientation']
コード例 #3
0
y_old = 0.5
z_old = 0.5
def callback(data):
    rospy.loginfo(rospy.get_caller_id() + "I heard %s", data.data)
    global x, y, z, x_old, y_old
    x_old = x
    x = data.data[0]
    y_old = y 
    y = data.data[1]
    z = data.data[2]-62.5
 '''
################################################################
host_ip = '172.16.172.1'
token = '71e699b1-cc5f-4fc5-900a-16e227bcfdd5'

eva = Eva(host_ip, token)

start_joints_deg = [0.1, 11.16, -74.5, 3.15, -115.14,
                    -114.42]  # Read from Go-to on choreograph
# start_joints_deg = [8.58,-21.02,-131.61,5.03,-27.68,-91.19]

# Convert joint angles from deg to rad
start_joints_rad = []
for joint in start_joints_deg:
    start_joints_rad.append(round(joint * (math.pi / 180), 3))
# "start_joints_rad = [0.15, -0.367, -2.297, 0.088, -0.483, -1.592]"

# Calculate starting end effector position
start_end_eff = eva.calc_forward_kinematics(start_joints_rad)

# !!check the usage of "start_end_eff"
コード例 #4
0
#!/usr/bin/env python3

from automata.Eva import Eva
import time
import json
import logging

# 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 = {