poetry
This commit is contained in:
parent
eb73098984
commit
a6f60083c5
|
@ -7,3 +7,4 @@ data/*
|
||||||
app.log
|
app.log
|
||||||
dist.zip
|
dist.zip
|
||||||
.venv
|
.venv
|
||||||
|
*.log
|
|
@ -1,19 +1,6 @@
|
||||||
X0 Y0 Z0 U0
|
X-300 Y0 Z0
|
||||||
X0 Y0 Z0 U-33.333
|
X0 Y0 Z0
|
||||||
X100 Y0 Z0 U-33.333
|
X0 Y-300 Z0
|
||||||
X200 Y0 Z0 U-33.333
|
X0 Y0 Z0
|
||||||
X200 Y100 Z0 U-33.333
|
X0 Y0 Z-300
|
||||||
X200 Y200 Z0 U-33.333
|
X0 Y0 Z0
|
||||||
X100 Y200 Z0 U-33.333
|
|
||||||
X0 Y200 Z0 U-33.333
|
|
||||||
X0 Y100 Z0 U-33.333
|
|
||||||
X0 Y0 Z0 U-33.333
|
|
||||||
X0 Y0 Z-100 W-33.333
|
|
||||||
X100 Y0 Z-100 W-33.333
|
|
||||||
X200 Y0 Z-100 W-33.333
|
|
||||||
X200 Y100 Z-100 W-33.333
|
|
||||||
X200 Y200 Z-100 W-33.333
|
|
||||||
X100 Y200 Z-100 W-33.333
|
|
||||||
X0 Y200 Z-100 W-33.333
|
|
||||||
X0 Y100 Z-100 W-33.333
|
|
||||||
X0 Y0 Z-100 W-33.333
|
|
|
@ -1,4 +1,5 @@
|
||||||
import time
|
import time
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy
|
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy
|
||||||
from PyQt6.QtGui import QImage, QPixmap
|
from PyQt6.QtGui import QImage, QPixmap
|
||||||
|
@ -34,8 +35,7 @@ class Visualize(QWidget):
|
||||||
return
|
return
|
||||||
|
|
||||||
(rgb, width, height) = res
|
(rgb, width, height) = res
|
||||||
|
image = QImage(np.asarray(rgb), width, height, QImage.Format.Format_RGBA8888)
|
||||||
image = QImage(rgb, width, height, QImage.Format.Format_RGBA8888)
|
|
||||||
image = image.convertToFormat(QImage.Format.Format_RGB888)
|
image = image.convertToFormat(QImage.Format.Format_RGB888)
|
||||||
pixmap = QPixmap.fromImage(image)
|
pixmap = QPixmap.fromImage(image)
|
||||||
|
|
||||||
|
|
|
@ -284,6 +284,8 @@ class SocketRobotArm:
|
||||||
if self.command_type == "base"
|
if self.command_type == "base"
|
||||||
else self.convert_file_to_joint()
|
else self.convert_file_to_joint()
|
||||||
)
|
)
|
||||||
|
with open(f"{self.command_type}.log", "w") as myfile:
|
||||||
|
myfile.write(json.dumps(commands))
|
||||||
|
|
||||||
self.add_rcc_list = (
|
self.add_rcc_list = (
|
||||||
[self.set_physical_speed(True), self.set_output_laser(True)]
|
[self.set_physical_speed(True), self.set_output_laser(True)]
|
||||||
|
@ -294,8 +296,8 @@ class SocketRobotArm:
|
||||||
step = 4
|
step = 4
|
||||||
empty = 1
|
empty = 1
|
||||||
for i in range(0, len(self.add_rcc_list), step):
|
for i in range(0, len(self.add_rcc_list), step):
|
||||||
if not self.socket:
|
# if not self.socket:
|
||||||
return
|
# return
|
||||||
|
|
||||||
self.command_data = f"Отправка данных {i}...{i+step-1}"
|
self.command_data = f"Отправка данных {i}...{i+step-1}"
|
||||||
|
|
||||||
|
|
30
run_local.py
30
run_local.py
|
@ -33,13 +33,19 @@ signal.signal(signal.SIGTERM, lambda *_: cleanup())
|
||||||
|
|
||||||
# Парсер аргументов командной строки
|
# Парсер аргументов командной строки
|
||||||
parser = argparse.ArgumentParser(description="Python launcher script.")
|
parser = argparse.ArgumentParser(description="Python launcher script.")
|
||||||
parser.add_argument("--test-socket", action="store_true", help="Запуск в режиме тестирования")
|
parser.add_argument(
|
||||||
parser.add_argument("--bullet-gui", action="store_true", help="Вывод визуального pybullet")
|
"--test-socket", action="store_true", help="Запуск в режиме тестирования"
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--bullet-gui", action="store_true", help="Вывод визуального pybullet"
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
poetry_path = "poetry"
|
||||||
|
|
||||||
# Установка команды для pybullet_server
|
# Установка команды для pybullet_server
|
||||||
pybullet_command = [
|
pybullet_command = [
|
||||||
"C://Users//user//AppData//Local//Packages//PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0//LocalCache//local-packages//Python310//Scripts\poetry.exe",
|
poetry_path,
|
||||||
"run",
|
"run",
|
||||||
"python",
|
"python",
|
||||||
"utils/pybullet_server.py",
|
"utils/pybullet_server.py",
|
||||||
|
@ -63,7 +69,7 @@ if args.test_socket:
|
||||||
print("Запуск test_socket_server...")
|
print("Запуск test_socket_server...")
|
||||||
test_server_process = subprocess.Popen(
|
test_server_process = subprocess.Popen(
|
||||||
[
|
[
|
||||||
"C://Users//user//AppData//Local//Packages//PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0//LocalCache//local-packages//Python310//Scripts//poetry.exe",
|
poetry_path,
|
||||||
"run",
|
"run",
|
||||||
"python",
|
"python",
|
||||||
"utils/test_socket_server.py",
|
"utils/test_socket_server.py",
|
||||||
|
@ -77,14 +83,20 @@ if args.test_socket:
|
||||||
|
|
||||||
# Запуск основного скрипта main.exe в режиме тестирования
|
# Запуск основного скрипта main.exe в режиме тестирования
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[ "C://Users//user//AppData//Local//Packages//PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0//LocalCache//local-packages//Python310//Scripts//poetry.exe",
|
[
|
||||||
"run", "python", "main.py", "--mode", "test"]
|
poetry_path,
|
||||||
|
"run",
|
||||||
|
"python",
|
||||||
|
"main.py",
|
||||||
|
"--mode",
|
||||||
|
"test",
|
||||||
|
]
|
||||||
) # Путь к исполняемому файлу
|
) # Путь к исполняемому файлу
|
||||||
else:
|
else:
|
||||||
# Запуск основного скрипта main.exe
|
# Запуск основного скрипта main.exe
|
||||||
subprocess.run([
|
subprocess.run(
|
||||||
"C://Users//user//AppData//Local//Packages//PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0//LocalCache//local-packages//Python310//Scripts//poetry.exe",
|
[poetry_path, "run", "python", "main.py",]
|
||||||
"run", "python", "main.py"]) # Путь к исполняемому файлу
|
) # Путь к исполняемому файлу
|
||||||
|
|
||||||
# Очистка после завершения
|
# Очистка после завершения
|
||||||
cleanup()
|
cleanup()
|
||||||
|
|
Loading…
Reference in New Issue