You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
3.1 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Unity Robot Controller
Репозиторий с кодом для управления роботом в среде Unity
# 1. Установка
Отдельно выполнить установку Unity-проекта с миром и роботов - https://git.robofob.ru/sirius/sirius_unity_sim
## 1.1. Установка ROS Humble (important!)
## 1.2. Создание рабочего окружения (workspace)
```sh
cd # переход в домашнюю (~) директорию
mkdir sirius_ws # создание папки
cd sirius_ws # переход в папку
mkdir src # создание папки
source /opt/ros/jazzy/setup.bash # указание инструкций сборщику
colcon build # первичная сборка рабочего окружения
echo source ~/sirius_ws/install/setup.bash >> ~/.bashrc # автоматическое указание инструкций сборщику и др. частям ROS при запуске каждой новой консоли
```
## 1.3. Установка пакетов для функционирования
Создать виртуальное окружение
```sh
# из sirius_ws
python3 -m venv sirius_venv
touch sirius_venv/COLCON_IGNORE
. sirius_venv/bin/activate
```
Установить в виртуальное окружение зависимости согласно [описанию](https://git.robofob.ru/sirius/gesture_rec#3-%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0-%D0%B7%D0%B0%D0%B2%D0%B8%D1%81%D0%B8%D0%BC%D0%BE%D1%81%D1%82%D0%B5%D0%B9)
```sh
cd src # если вы в папке sirius_ws
git clone --recurse-submodules https://git.robofob.ru/sirius/unity_robot_controller # скачивание данного репозитория
git clone https://git.robofob.ru/sirius/gen_locations_on_mesh # скачивание репозитория управления очагами возгорания
```
## 1.4. Сборка пакетов
Дополнительные зависимости
```sh
sudo apt install ros-humble-camera-ros
```
(При повторной сборке)
```sh
rm -rf /build /install /log
```
**Terminal 1**
При активированном `sirius_venv` (`. sirius_venv/bin/activate`)
Установить python-colcon (единожды)
```sh
pip install colcon-common-extensions
```
```sh
python3 -m colcon build --packages-select unity_robot_controller wave_rover_controller --symlink-install
```
**Terminal 2**
```sh
colcon build --packages-select ros_tcp_endpoint gen_locations_on_mesh_msgs gen_locations_on_mesh
```
## 1.5. Запуск
```sh
source install/setup.bash # better add to bottom of ~/.bashrc
```
Запустить проект Unity через интерфейс
Запустить взаимодействие ROS2 с Unity
```sh
ros2 launch unity_robot_controller unity.launch.py
```
Запустить на выбор один из способов управления
Джойстик
```sh
ros2 launch unity_robot_controller joy_control.launch.py
```
Базовые жесты
```sh
ros2 launch unity_robot_controller base_gesture_control.launch.py
```
Кастомный проект