The unity sample of ARCore and ROS implementation with ROS#
C. Piyavichayanon and M. Koga, "Validation of Robot Model with Mobile Augmented Reality," 2021 6th Asia-Pacific Conference on Intelligent Robot Systems (ACIRS), 2021, pp. 1-5, doi: 10.1109/ACIRS52449.2021.9519362.
Navigation Interface: https://www.youtube.com/watch?v=b3p2vx0AHW8
Collision Checking: https://www.youtube.com/watch?v=Ybw6PvRQdmY
The software version using in this example are
- Unity 2019.xx LTS
- ROS Melodic on Unbuntu 18.xx LTS
For WSL-ROS installation : https://jack-kawell.com/2020/06/12/ros-wsl2/
- follow quick start guide
https://developers.google.com/ar/develop/unity/quickstart-android
*** The only difference build setting for ROS# is Scripting Backend to Mono and Api to .NET 4.x ***
!! If you need to use IL2CPP backend for arm64 (Ex. Samsung new model) follow the instruction here
- config custom gradle (Test only version 6.5)
https://developers.google.com/ar/develop/unity/android-11-build
Insert the following lines at the top of the file:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
// Must be Android Gradle Plugin 3.6.0 or later. For a list of
// compatible Gradle versions refer to:
// https://developer.android.com/studio/releases/gradle-plugin
classpath 'com.android.tools.build:gradle:3.6.0'
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
- test example
- Unity Setup
- Copy the RosSharp folder from the latest commit of our repository into the Assets folder of your Unity project.
- Check Installation
- Ros Setup
- Create your workspace : https://github.com/gmp-prem/BasicROS
- Copy file_server folder to the src folder of your workspace
- Build the package
- Install ros bridge suit dependencies
sudo apt-get install ros-melodic-rosbridge-server
- Check package by launching (Close it before doing next step)
roslaunch file_server ros_sharp_communication.launch
- Download turtlebot3 package in ROS
- Add URDF export launch file to export Turtlebot3 model
cd ~/catkin_ws/src
code .
<launch>
<include file="$(find file_server)/launch/ros_sharp_communication.launch">
<arg name="port" value="9090" />
</include>
<arg name="urdf_file" default="$(find xacro)/xacro.py '$(find turtlebot3_description)/urdf/turtlebot3_burger.urdf.xacro'" />
<param name="robot/name" value="Turtlebot3" />
<param name="robot_description" command="$(arg urdf_file)" />
</launch>
- Launch Turtlebot3 exporter
roslaunch file_server turtlebot3_description_publisher.launch
- Check your Linux port
hostname -I
In ROS:
- Bring up turtlebot3 rviz and fake node (gazebo is also ok)
roslaunch turtlebot3_fake turtlebot3_fake.launch
- Launch teletop and make its spin
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
- Launch ros bridge to unity
roslaunch file_server ros_sharp_communication.launch
In unity:
-
Create empty object, add ros connector scripts and change ip address
-
Add joint states and odometry subscriber
- Add joint_state_writer to each wheel
- Drag each wheel to joint state write field in joint state subscriber
- Build The Scene. Make sure your phone is connected to same wifi with ROS PC
In ARrosCore-main --> ARrosCore-main --> HelloARcoreRos --> scene
-
Edit ROSConnector URL
-
Try build the scene while connecting to the Turtlebot3 Fake Node
ARCore Depth API: https://github.com/googlesamples/arcore-depth-lab
ROS#: https://github.com/siemens/ros-sharp
CHAMP: https://github.com/chvmp/champ
Turtlebot3: https://github.com/ROBOTIS-GIT/turtlebot3