|
|
@ -58,7 +58,7 @@ Interpolation_points = 20 |
|
|
# 第九段程序封装为函数 |
|
|
# 第九段程序封装为函数 |
|
|
# 第十二段程序封装为函数 |
|
|
# 第十二段程序封装为函数 |
|
|
|
|
|
|
|
|
def program1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
i = 0 |
|
|
i = 0 |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
turn_off_relay() |
|
|
turn_off_relay() |
|
|
@ -113,7 +113,7 @@ def program1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
print("第一段程序执行完") |
|
|
print("第一段程序执行完") |
|
|
|
|
|
|
|
|
def program1_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program1_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
print("第1_1段程序开始执行") |
|
|
print("第1_1段程序开始执行") |
|
|
i = 0 |
|
|
i = 0 |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
@ -179,7 +179,7 @@ def program1_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_star |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
print("第1_1段程序执行完") |
|
|
print("第1_1段程序执行完") |
|
|
|
|
|
|
|
|
def program2(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program2(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
global increments_x, increments_y, increments_z |
|
|
global increments_x, increments_y, increments_z |
|
|
global Coordinate_compensation |
|
|
global Coordinate_compensation |
|
|
global sample_time |
|
|
global sample_time |
|
|
@ -237,7 +237,7 @@ def program2(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, |
|
|
print("第二段程序执行完") |
|
|
print("第二段程序执行完") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def program3(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program3(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
print("第三段程序开始执行") |
|
|
print("第三段程序开始执行") |
|
|
i = 0 |
|
|
i = 0 |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
@ -291,7 +291,7 @@ def program3(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
print("第三段程序执行完") |
|
|
print("第三段程序执行完") |
|
|
|
|
|
|
|
|
def program3_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program3_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
print("第3_1段程序开始执行") |
|
|
print("第3_1段程序开始执行") |
|
|
i = 0 |
|
|
i = 0 |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
@ -357,7 +357,7 @@ def program3_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_star |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
print("第3_1段程序执行完") |
|
|
print("第3_1段程序执行完") |
|
|
|
|
|
|
|
|
def program4(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program4(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
print("第四段程序开始执行") |
|
|
print("第四段程序开始执行") |
|
|
global increments_x, increments_y, increments_z |
|
|
global increments_x, increments_y, increments_z |
|
|
global Coordinate_compensation |
|
|
global Coordinate_compensation |
|
|
@ -400,10 +400,10 @@ def program4(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, |
|
|
"lookahead": lookahead_time, "t": sample_time, "smoothness": 1, "response_enable": 0}) |
|
|
"lookahead": lookahead_time, "t": sample_time, "smoothness": 1, "response_enable": 0}) |
|
|
send_Point(sock, "tt_put_servo_joint_to_buf", {"targetPose": modified_list}) |
|
|
send_Point(sock, "tt_put_servo_joint_to_buf", {"targetPose": modified_list}) |
|
|
time.sleep(sleep_time) |
|
|
time.sleep(sleep_time) |
|
|
if(i >= turn_on_relay_start and i <= turn_on_relay_end): |
|
|
if(i >= ex_turn_on_relay_start and i <= ex_turn_on_relay_end): |
|
|
turn_on_relay() |
|
|
turn_on_relay() |
|
|
print("打开喷枪") |
|
|
print("打开喷枪") |
|
|
if(i >= turn_off_relay_start and i <= turn_off_relay_end): |
|
|
if(i >= ex_turn_off_relay_start and i <= ex_turn_off_relay_end): |
|
|
turn_off_relay() |
|
|
turn_off_relay() |
|
|
print("关闭喷枪") |
|
|
print("关闭喷枪") |
|
|
i = i + 1 |
|
|
i = i + 1 |
|
|
@ -412,7 +412,7 @@ def program4(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, |
|
|
print("第四段程序执行完") |
|
|
print("第四段程序执行完") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def program5(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program5(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
print("第五段程序开始执行") |
|
|
print("第五段程序开始执行") |
|
|
i = 0 |
|
|
i = 0 |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
@ -468,7 +468,7 @@ def program5(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
print("第五段程序执行完") |
|
|
print("第五段程序执行完") |
|
|
|
|
|
|
|
|
def program5_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program5_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
print("第5_1段程序开始执行") |
|
|
print("第5_1段程序开始执行") |
|
|
i = 0 |
|
|
i = 0 |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
@ -534,7 +534,7 @@ def program5_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_star |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
print("第5_1段程序执行完") |
|
|
print("第5_1段程序执行完") |
|
|
|
|
|
|
|
|
def program6(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program6(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
global increments_x, increments_y, increments_z |
|
|
global increments_x, increments_y, increments_z |
|
|
global Coordinate_compensation |
|
|
global Coordinate_compensation |
|
|
global sample_time |
|
|
global sample_time |
|
|
@ -586,7 +586,7 @@ def program6(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, |
|
|
print("第六段程序执行完") |
|
|
print("第六段程序执行完") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def program7(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program7(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
i = 0 |
|
|
i = 0 |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
turn_off_relay() |
|
|
turn_off_relay() |
|
|
@ -640,7 +640,7 @@ def program7(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
print("第七段程序执行完") |
|
|
print("第七段程序执行完") |
|
|
|
|
|
|
|
|
def program7_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program7_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
print("第7_1段程序开始执行") |
|
|
print("第7_1段程序开始执行") |
|
|
i = 0 |
|
|
i = 0 |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
@ -704,7 +704,7 @@ def program7_1(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_star |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
suc, result, id = sendCMD(sock, "tt_clear_servo_joint_buf") |
|
|
print("第7_1段程序执行完") |
|
|
print("第7_1段程序执行完") |
|
|
|
|
|
|
|
|
def program8(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end): |
|
|
def program8(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, turn_off_relay_end, ex_turn_on_relay_start, ex_turn_on_relay_end, ex_turn_off_relay_start, ex_turn_off_relay_end): |
|
|
global increments_x, increments_y, increments_z |
|
|
global increments_x, increments_y, increments_z |
|
|
global Coordinate_compensation |
|
|
global Coordinate_compensation |
|
|
global sample_time |
|
|
global sample_time |
|
|
@ -747,10 +747,10 @@ def program8(sock, turn_on_relay_start, turn_on_relay_end, turn_off_relay_start, |
|
|
"lookahead": lookahead_time, "t": sample_time, "smoothness": 1, "response_enable": 0}) |
|
|
"lookahead": lookahead_time, "t": sample_time, "smoothness": 1, "response_enable": 0}) |
|
|
send_Point(sock, "tt_put_servo_joint_to_buf", {"targetPose": modified_list}) |
|
|
send_Point(sock, "tt_put_servo_joint_to_buf", {"targetPose": modified_list}) |
|
|
time.sleep(sleep_time) |
|
|
time.sleep(sleep_time) |
|
|
if(i >= turn_on_relay_start and i <= turn_on_relay_end): |
|
|
if(i >= ex_turn_on_relay_start and i <= ex_turn_on_relay_end): |
|
|
turn_on_relay() |
|
|
turn_on_relay() |
|
|
print("打开喷枪") |
|
|
print("打开喷枪") |
|
|
if(i >= turn_off_relay_start and i <= turn_off_relay_end): |
|
|
if(i >= ex_turn_off_relay_start and i <= ex_turn_off_relay_end): |
|
|
turn_off_relay() |
|
|
turn_off_relay() |
|
|
print("关闭喷枪") |
|
|
print("关闭喷枪") |
|
|
i = i + 1 |
|
|
i = i + 1 |
|
|
|