test model
This commit is contained in:
parent
3aa4d6b3ea
commit
9a0f836d62
|
@ -1,9 +1,9 @@
|
|||
X0 Z0
|
||||
X0 Z100
|
||||
X0 Z200
|
||||
X100 Z200
|
||||
X200 Z200
|
||||
X200 Z100
|
||||
X200 Z0
|
||||
X100 Z0
|
||||
X0 Y0
|
||||
X0 Y100
|
||||
X0 Y200
|
||||
X100 Y200
|
||||
X200 Y200
|
||||
X200 Y100
|
||||
X200 Y0
|
||||
X100 Y0
|
||||
X0 Z0
|
Binary file not shown.
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_asyncio.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_asyncio.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_codecs_cn.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_codecs_cn.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_codecs_hk.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_codecs_hk.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_codecs_iso2022.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_codecs_iso2022.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_codecs_jp.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_codecs_jp.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_codecs_kr.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_codecs_kr.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_codecs_tw.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_codecs_tw.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_contextvars.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_contextvars.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_ctypes.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_ctypes.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_decimal.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_decimal.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_hashlib.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_hashlib.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_lzma.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_lzma.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_multibytecodec.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_multibytecodec.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_multiprocessing.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_multiprocessing.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_opcode.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_opcode.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_posixshmem.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_posixshmem.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/_queue.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/_queue.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/resource.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/resource.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
BIN
dist/client/_internal/lib-dynload/termios.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
BIN
dist/client/_internal/lib-dynload/termios.cpython-310-x86_64-linux-gnu.so
vendored
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
line,0,0,277.8,0,0,0
|
||||
line,0,-50,50,0,0,0
|
|
@ -0,0 +1 @@
|
|||
urdf_support/
|
|
@ -78,7 +78,7 @@ class MainContentComponent(QWidget):
|
|||
layout.addWidget(self.rightPanel)
|
||||
|
||||
self.setLayout(layout)
|
||||
self.setFixedSize(800, 600)
|
||||
self.setFixedSize(800, 800)
|
||||
self.initUI()
|
||||
|
||||
def initUI(self):
|
||||
|
|
4
main.py
4
main.py
|
@ -135,7 +135,9 @@ class MyApp:
|
|||
return self.robot_app.set_command_type(type)
|
||||
|
||||
@check_robot_app
|
||||
def command_wrapper(self):
|
||||
def command_wrapper(self, *args, **kwargs):
|
||||
logger.info(args)
|
||||
logger.info(kwargs)
|
||||
return self.robot_app.cycle_start()
|
||||
|
||||
@check_robot_app
|
||||
|
|
|
@ -36,7 +36,7 @@ class SocketRobotArm:
|
|||
start_world_coordinates = []
|
||||
remote_command_count = []
|
||||
|
||||
command_type = 'base'
|
||||
command_type = "base"
|
||||
command_data = None
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
@ -73,6 +73,7 @@ class SocketRobotArm:
|
|||
p.loadURDF("urdf/plane.urdf", physicsClientId=self.physics_client)
|
||||
|
||||
urdf_path = os.path.join("urdf", f"{self.urdf_filename}.urdf")
|
||||
logger.info(urdf_path)
|
||||
self.body_id = p.loadURDF(
|
||||
urdf_path, [0, 0, 0], useFixedBase=1, physicsClientId=self.physics_client
|
||||
)
|
||||
|
@ -141,7 +142,7 @@ class SocketRobotArm:
|
|||
self.get_world()
|
||||
self.set_text(text=f"Мировые координаты {self.start_world_coordinates}")
|
||||
time.sleep(0.5)
|
||||
self.set_joint(self.convert_to_joint(self.start_world_coordinates[0:3]))
|
||||
# self.set_joint(self.convert_to_joint(self.start_world_coordinates[0:3]))
|
||||
|
||||
self._get_command_count()
|
||||
self.set_text(text=f"Команд в очереди {self.remote_command_count}")
|
||||
|
@ -160,7 +161,9 @@ class SocketRobotArm:
|
|||
time.sleep(0.5)
|
||||
|
||||
commands = (
|
||||
self.steps_from_file() if self.command_type == "base" else self.convert_file_to_join()
|
||||
self.steps_from_file()
|
||||
if self.command_type == "base"
|
||||
else self.convert_file_to_join()
|
||||
)
|
||||
|
||||
self.add_rcc_list = (
|
||||
|
@ -193,7 +196,7 @@ class SocketRobotArm:
|
|||
[float(point) for point in [point["m0"], point["m1"], point["m2"]]]
|
||||
)
|
||||
# logger.info(f"point {point} {angles}")
|
||||
self.set_joint(angles)
|
||||
self.set_joint((*angles, point["m2"], point["m3"], point["m4"]))
|
||||
time.sleep(1)
|
||||
|
||||
def convert_to_joint(self, coordinates):
|
||||
|
|
|
@ -10,5 +10,11 @@
|
|||
"host": "192.168.70.65",
|
||||
"slave_id": 22,
|
||||
"urdf": "sample"
|
||||
},
|
||||
{
|
||||
"name": "test (ip small)",
|
||||
"host": "192.168.70.55",
|
||||
"slave_id": 11,
|
||||
"urdf": "borunte_macro"
|
||||
}
|
||||
]
|
|
@ -0,0 +1,82 @@
|
|||
import subprocess
|
||||
import argparse
|
||||
import sys
|
||||
import signal
|
||||
|
||||
# Параметры для процессов
|
||||
server_process = None
|
||||
test_server_process = None
|
||||
|
||||
|
||||
def usage():
|
||||
"""Функция для отображения помощи"""
|
||||
print("Usage: run_all.py [--test]")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
# Обработчик для сигналов выхода
|
||||
def cleanup():
|
||||
"""Функция для остановки серверов при выходе"""
|
||||
print("Остановка серверов...")
|
||||
if server_process:
|
||||
server_process.terminate()
|
||||
server_process.wait()
|
||||
if test_server_process:
|
||||
test_server_process.terminate()
|
||||
test_server_process.wait()
|
||||
print("Серверы остановлены.")
|
||||
|
||||
|
||||
# Назначаем функции очистки для сигналов
|
||||
signal.signal(signal.SIGINT, lambda *_: cleanup())
|
||||
signal.signal(signal.SIGTERM, lambda *_: cleanup())
|
||||
|
||||
# Парсер аргументов командной строки
|
||||
parser = argparse.ArgumentParser(description="Python launcher script.")
|
||||
parser.add_argument("--test", action="store_true", help="Запуск в режиме тестирования")
|
||||
args = parser.parse_args()
|
||||
|
||||
# Установка команды для pybullet_server
|
||||
pybullet_command = [
|
||||
"poetry",
|
||||
"run",
|
||||
"python",
|
||||
"utils/pybullet_server.py",
|
||||
"--test",
|
||||
] # Путь к исполняемому файлу
|
||||
|
||||
# Если включен режим тестирования, добавляем флаг --test
|
||||
if args.test:
|
||||
pybullet_command.append("--test")
|
||||
|
||||
# Запуск pybullet_server.exe
|
||||
print("Запуск pybullet_server...")
|
||||
server_process = subprocess.Popen(pybullet_command)
|
||||
|
||||
# Проверяем успешный запуск сервера
|
||||
if server_process.poll() is not None:
|
||||
print("Ошибка при запуске pybullet_server")
|
||||
sys.exit(1)
|
||||
|
||||
# Если включен режим тестирования, запускаем test_socket_server.exe
|
||||
if args.test:
|
||||
print("Запуск test_socket_server...")
|
||||
test_server_process = subprocess.Popen(
|
||||
["poetry", "run", "python", "utils/test_socket_server.py"]
|
||||
) # Путь к исполняемому файлу
|
||||
|
||||
# Проверка успешного запуска тестового сервера
|
||||
if test_server_process.poll() is not None:
|
||||
print("Ошибка при запуске test_socket_server")
|
||||
sys.exit(1)
|
||||
|
||||
# Запуск основного скрипта main.exe в режиме тестирования
|
||||
subprocess.run(
|
||||
["poetry", "run", "python", "main.py", "--mode", "test"]
|
||||
) # Путь к исполняемому файлу
|
||||
else:
|
||||
# Запуск основного скрипта main.exe
|
||||
subprocess.run(["poetry", "run", "python", "main.py"]) # Путь к исполняемому файлу
|
||||
|
||||
# Очистка после завершения
|
||||
cleanup()
|
|
@ -10,14 +10,14 @@
|
|||
<link name="base_link">
|
||||
<visual>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/base_link.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/base_link.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0.0 0 0.0" xyz="0 0 0"/>
|
||||
<material name="Black"/>
|
||||
</visual>
|
||||
<collision>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/base_link_collision.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/base_link_collision.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0.0 0 0.0" xyz="0 0 0"/>
|
||||
</collision>
|
||||
|
@ -25,14 +25,14 @@
|
|||
<link name="link_1">
|
||||
<visual>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_1.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_1.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0.0 0 0.0" xyz="0 0 0"/>
|
||||
<material name="DarkRed"/>
|
||||
</visual>
|
||||
<collision>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_1_collision.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_1_collision.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0.0 0 0.0" xyz="0 0 0"/>
|
||||
</collision>
|
||||
|
@ -44,14 +44,14 @@
|
|||
<link name="link_2">
|
||||
<visual>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_2.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_2.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0.0 0 0.0" xyz="0 0 0"/>
|
||||
<material name="DarkRed"/>
|
||||
</visual>
|
||||
<collision>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_2_collision.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_2_collision.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0.0 0 0.0" xyz="0 0 0"/>
|
||||
</collision>
|
||||
|
@ -63,14 +63,14 @@
|
|||
<link name="link_3">
|
||||
<visual>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_3.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_3.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0.0 0 0.0" xyz="0 0.01 0"/>
|
||||
<material name="DarkRed"/>
|
||||
</visual>
|
||||
<collision>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_3_collision.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_3_collision.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0.0 0 0.0" xyz="0 0.01 0"/>
|
||||
</collision>
|
||||
|
@ -82,14 +82,14 @@
|
|||
<link name="link_4">
|
||||
<visual>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_4.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_4.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0.0 0.0 0.0" xyz="0 0 0"/>
|
||||
<material name="DarkRed"/>
|
||||
</visual>
|
||||
<collision>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_4_collision.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_4_collision.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0.0 0 0.0" xyz="0 0 0"/>
|
||||
</collision>
|
||||
|
@ -101,14 +101,14 @@
|
|||
<link name="link_5">
|
||||
<visual>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_5.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_5.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||
<material name="DarkRed"/>
|
||||
</visual>
|
||||
<collision>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_5_collision.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_5_collision.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||
</collision>
|
||||
|
@ -120,14 +120,14 @@
|
|||
<link name="link_6">
|
||||
<visual>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_6.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_6.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0 0 0.0" xyz="0 0 0"/>
|
||||
<material name="DarkRed"/>
|
||||
</visual>
|
||||
<collision>
|
||||
<geometry>
|
||||
<mesh filename="/home/aarizona/projects/modbus_test/urdf_support/borunte_support/meshes/link_6_collision.stl"/>
|
||||
<mesh filename="../urdf_support/borunte_support/meshes/link_6_collision.stl"/>
|
||||
</geometry>
|
||||
<origin rpy="0 0 0.0" xyz="0 0 0"/>
|
||||
</collision>
|
||||
|
|
|
@ -108,18 +108,18 @@
|
|||
</link>
|
||||
<!-- joints: main serial chain -->
|
||||
<joint name="joint_1" type="revolute">
|
||||
<limit effort="0" lower="-2.7925" upper="2.7925" velocity="3.1415" />
|
||||
<origin rpy="0 0 0" xyz="0 0 0" />
|
||||
<parent link="base_link" />
|
||||
<child link="link_1" />
|
||||
<axis xyz="0 0 1" />
|
||||
<limit effort="0" lower="-2.7925" upper="2.7925" velocity="3.1415" />
|
||||
</joint>
|
||||
<joint name="joint_2" type="revolute">
|
||||
<origin rpy="0 0 0" xyz="0.0170450 0 0.494600" />
|
||||
<limit effort="0" lower="-0.5759" upper="2.6529" velocity="3.1415" />
|
||||
<parent link="link_1" />
|
||||
<child link="link_2" />
|
||||
<axis xyz="0 1 0" />
|
||||
<limit effort="0" lower="-0.5759" upper="2.6529" velocity="3.1415" />
|
||||
<axis xyz="0 -1 0" />
|
||||
<origin rpy="0 0 0" xyz="0.0170450 0 0.494600" />
|
||||
</joint>
|
||||
<joint name="joint_3" type="revolute">
|
||||
<origin rpy="0 1.5708 0" xyz="0 0 0.729921" />
|
||||
|
@ -129,24 +129,24 @@
|
|||
<limit effort="0" lower="-2.6145" upper="2.8797" velocity="3.9269" />
|
||||
</joint>
|
||||
<joint name="joint_4" type="revolute">
|
||||
<origin rpy="0 0 0" xyz="0 0 0.098277" />
|
||||
<limit effort="0" lower="-3.3161" upper="3.3161" velocity="6.9813" />
|
||||
<parent link="link_3" />
|
||||
<child link="link_4" />
|
||||
<axis xyz="-1 0 0" />
|
||||
<limit effort="0" lower="-3.3161" upper="3.3161" velocity="6.9813" />
|
||||
<axis xyz="0 0 1" />
|
||||
<origin rpy="0 0 0" xyz="0 0 0.098277" />
|
||||
</joint>
|
||||
<joint name="joint_5" type="revolute">
|
||||
<origin rpy="0 0 0" xyz="0.0 0 1.109039" />
|
||||
<limit effort="0" lower="-2.0943" upper="2.0943" velocity="5.7595" />
|
||||
<parent link="link_4" />
|
||||
<child link="link_5" />
|
||||
<axis xyz="0 -1 0" />
|
||||
<limit effort="0" lower="-2.0943" upper="2.0943" velocity="5.7595" />
|
||||
<axis xyz="0 1 0" />
|
||||
<origin rpy="0 0 0" xyz="0.0 0 1.109039" />
|
||||
</joint>
|
||||
<joint name="joint_6" type="revolute">
|
||||
<origin rpy="0 0 0" xyz="0.0 0 0.117" />
|
||||
<limit effort="0" lower="-6.2831" upper="6.2831" velocity="8.3775" />
|
||||
<parent link="link_5" />
|
||||
<child link="link_6" />
|
||||
<axis xyz="-1 0 0" />
|
||||
<limit effort="0" lower="-6.2831" upper="6.2831" velocity="8.3775" />
|
||||
<axis xyz="0 0 1" />
|
||||
<origin rpy="0 0 0" xyz="0.0 0 0.117" />
|
||||
</joint>
|
||||
</robot>
|
|
@ -32,5 +32,5 @@ if __name__ == "__main__":
|
|||
|
||||
# Если передан аргумент --test, устанавливаем тип подключения SHARED_MEMORY_SERVER
|
||||
connection_type = "GUI_SERVER" if args.test else "SHARED_MEMORY_SERVER"
|
||||
connection_type = "SHARED_MEMORY_SERVER"
|
||||
# connection_type = "SHARED_MEMORY_SERVER"
|
||||
main(connection_type)
|
||||
|
|
Loading…
Reference in New Issue