This commit is contained in:
Kseninia Mikhaylova 2024-10-29 09:50:37 +03:00
parent e5ecf4c3ec
commit 28a15ab61e
6 changed files with 47 additions and 47556 deletions

47551
app.log

File diff suppressed because it is too large Load Diff

View File

@ -18,4 +18,4 @@ pillow = "^11.0.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"

View File

@ -1,19 +0,0 @@
# run.py
import sys
import os
import time
# Добавляем путь к родительской директории
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'robot')))
from robot.client_socket import SocketRobotArm
if __name__ == "__main__":
robot_arm = SocketRobotArm()
robot_arm.start('GUI')
try:
while True:
time.sleep(1) # Просто удерживаем основной поток активным
except KeyboardInterrupt:
print("Программа завершена.")

27
run.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
# Функция для отображения помощи
usage() {
echo "Usage: $0 [--test]"
exit 1
}
# Разбираем аргументы командной строки
TEST_MODE=0
while [[ "$1" != "" ]]; do
case $1 in
--test ) TEST_MODE=1
;;
* ) usage
exit 1
esac
shift
done
poetry run python utils/pybullet_server.py &
if [ $TEST_MODE -eq 1 ]; then
poetry run python utils/test_socket_server.py &
poetry run python main.py --mode test
else
poetry run python main.py
fi

0
utils/__init__.py Normal file
View File

View File

@ -3,7 +3,7 @@ import pybullet as p
import pybullet_data
import time
def run_server():
def main():
# Подключаемся к графическому серверу в режиме SHARED_MEMORY_SERVER
physicsClient = p.connect(p.SHARED_MEMORY_SERVER)
@ -17,4 +17,4 @@ def run_server():
time.sleep(1./240.)
if __name__ == "__main__":
run_server()
main()