Unity x ROS1 x Mini Pupper Tutorial.
(Important!) - You will need to install and Register Unity 3D Software beforehand! (You can use Free version.)
https://unity3d.com/get-unity/download
Slide - Use Unity 3D ROS Engine to control mini pupper -
You can play your Mini Pupper with Unity 3D Engine and ROS!
Unity 3D Engine can also create Windows / MacOS / Android / iOS Apps and so on.
This repository contain a tutorial for connecting Unity and ROS.
You need a Mini Pupper and PC.
(SD Card image: (64bit)v1.0.0.20220219.MiniPupper_ROS&OpenCV_Ubuntu20.04.03.img.zip )
https://drive.google.com/drive/folders/1RXu8dGXx3duYmF6jz4DYGml95TujSjsq
- Ubuntu 20.04
- ROS Noetic
ID: ubuntu / pass: mangdang
- Clone the ROS-TCP-Endpoint repository.
- (You use the new image (20221013_minipupper_roscon2022_trim.img.xz), you do not need this cloning and update-alternatives command.)
sudo apt update
cd ~/catkin_ws/src
git clone https://github.com/Unity-Technologies/ROS-TCP-Endpoint.git
cd ./ROS-TCP-Endpoint
pip3 install -r requirements.txt
cd ../
catkin_make
# for changing default python version 3
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 0
Windows (10 or later) or Ubuntu (I tried Ubuntu20.04)
- Install Unity 3D (I used version 2021) You will need to install and Register Unity 3D Software beforehand. 'Unity Hub' is recommended.
- Install git software (https://git-scm.com/downloads) for importing Unity asset.
- Clone this repository, and Open the project. The first time, some assets downloads would be performed.
- (Optional) If you want to build Android App, Android build Module (via Unity Hub Setting) / Android SDK is required.
- Unity 3D Software
Windows - (https://unity3d.com/get-unity/download)
Ubuntu - (https://docs.unity3d.com/hub/manual/InstallHub.html#install-hub-linux)
These client have to connect the same network.
Open the terminal, Enter this. (Tab No.1)
# check your IP address.
ifconfig
cd ~/catkin_ws
source devel/setup.bash
roslaunch ros_tcp_endpoint endpoint.launch # with roscore
And open new terminal (Tab No.2) (Ctrl-T key)
source devel/setup.bash
# If you try CmdVel sample project
roslaunch mini_pupper bringup.launch
# Or, If you try JointTrajectory sample project,,
roslaunch servo_interface servo_interface.launch
# (If use mini_pupper_ros - ros1 branch (updated Sep, 2022), )
# roslaunch mini_pupper_bringup bringup.launch
# roslaunch mini_pupper_control servo_interface.launch
Open the Unity project. And open the scene file.
(Additional packages will start to download automatically.)
Two scenes can be selected.
-
This example shows two virtual joystick.
-
When connected to ROS, you can move Mini Pupper with CmdVel messages.
Assets/Scenes/MiniPupperJointTrajectory.unity : Example for JointTrajectory message. with IK foot positioning.
-
This example shows 4 foot position box and a body position box.
-
When connected to ROS, you can move Mini Pupper with JointTrajectory messages.
-
And the Leg move with IK (forward to foot position box.)
Enter the Mini Pupper's IP address in the "ROS IP Address" fields.
So click the play button, then Mini Pupper and Unity were connected.
This page will be update.
@devemin
https://github.com/Unity-Technologies/Unity-Robotics-Hub/tree/main/tutorials/ros_unity_integration
MIT License