增加了HSMO整线优化方法,读取数据增加了供料器部分
This commit is contained in:
@@ -22,6 +22,7 @@ import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib
|
||||
import traceback
|
||||
import openpyxl
|
||||
|
||||
matplotlib.use('TkAgg')
|
||||
|
||||
@@ -67,7 +68,16 @@ t_fix_camera_check = 0.12 # 固定相机检测时间
|
||||
T_pp, T_tr, T_nc, T_pl = 2, 5, 25, 0
|
||||
|
||||
# 时间参数 (数据拟合获得)
|
||||
Fit_cy, Fit_nz, Fit_pu, Fit_pl, Fit_mv = 0.326, 0.870, 0.159, 0.041, 0.001
|
||||
# Fit_cy, Fit_nz, Fit_pu, Fit_pl, Fit_mv = 0.326, 0.870, 0.159, 0.041, 0.030
|
||||
Fit_cy, Fit_nz, Fit_pu, Fit_pl, Fit_mv = 0.326, 0.870, 0.159, 0.041, 0.035
|
||||
|
||||
|
||||
class Point:
|
||||
def __init__(self, _x, _y, _r=0, _h=None):
|
||||
self.x = _x
|
||||
self.y = _y
|
||||
self.r = _r
|
||||
self.h = _h
|
||||
|
||||
|
||||
class OptResult:
|
||||
@@ -108,9 +118,12 @@ class OptInfo:
|
||||
print(f'-Pick time: {self.pickup_time: .3f}, Pick distance: {self.pickup_distance: .3f}')
|
||||
print(f'-Place time: {self.place_time: .3f}, Place distance: {self.place_distance: .3f}')
|
||||
print(
|
||||
f'-Round time: {self.total_time - self.place_time - self.place_time: .3f}, Round distance: '
|
||||
f'-Round time: {self.total_time - self.operation_time - self.pickup_time - self.place_time: .3f}, Round distance: '
|
||||
f'{self.total_distance - self.pickup_distance - self.place_distance: .3f}')
|
||||
|
||||
print(f'-Round & place time per cycle: {(self.total_time - self.pickup_time - self.operation_time) * 1000.0 / (self.cycle_counter + 1e-10): .3f}, ', end='')
|
||||
print(f'-Round & place distance per cycle: {(self.total_distance - self.pickup_distance) / (self.cycle_counter + 1e-10): .3f}')
|
||||
|
||||
minutes, seconds = int(self.total_time // 60), int(self.total_time) % 60
|
||||
millisecond = int((self.total_time - minutes * 60 - seconds) * 60)
|
||||
|
||||
@@ -856,3 +869,10 @@ def random_division(num, div):
|
||||
|
||||
def list_range(start, end=None):
|
||||
return list(range(start)) if end is None else list(range(start, end))
|
||||
|
||||
|
||||
def kth_indices_partition(num, kth):
|
||||
if len(num) > kth:
|
||||
return np.argpartition(num, kth)
|
||||
else:
|
||||
return np.array(range(len(num)))
|
Reference in New Issue
Block a user