Skip to content

The unity sample of ARCore and ROS implementation with ROS#

Notifications You must be signed in to change notification settings

sjnaj/ARrosCore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARrosCore

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.

Example

Intro : https://www.youtube.com/watch?v=28zOEsvyGYM

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/

Setting Up

Install arcore sdk for unity

  1. 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 *** image

!! If you need to use IL2CPP backend for arm64 (Ex. Samsung new model) follow the instruction here

https://github.com/EricVoll/ros-sharp/issues

  1. config custom gradle (Test only version 6.5)

https://developers.google.com/ar/develop/unity/android-11-build

image

https://gradle.org/releases/

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'
      }
   }
}
  1. test example

Add ROS# package

https://github.com/siemens/ros-sharp

  • Unity Setup
  1. Copy the RosSharp folder from the latest commit of our repository into the Assets folder of your Unity project.
  2. Check Installation

image

  • Ros Setup
  1. Create your workspace : https://github.com/gmp-prem/BasicROS
  2. Copy file_server folder to the src folder of your workspace
  3. Build the package
  4. Install ros bridge suit dependencies
sudo apt-get install ros-melodic-rosbridge-server
  1. Check package by launching (Close it before doing next step)
roslaunch file_server ros_sharp_communication.launch

image

Import Turtlebot3 Model to Unity

  1. Download turtlebot3 package in ROS

https://github.com/gmp-prem/BasicROS/tree/Turtlebot3

  1. 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>

image

  1. Launch Turtlebot3 exporter
roslaunch file_server turtlebot3_description_publisher.launch
  1. Check your Linux port
hostname -I

image

  1. In unity: export robot model to your scene image

image

image

For this example, Enable Kinmatic and Disable Gravity image

Move Turtlebot3 in AR

In ROS:

  1. Bring up turtlebot3 rviz and fake node (gazebo is also ok)
roslaunch turtlebot3_fake turtlebot3_fake.launch
  1. Launch teletop and make its spin
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

image

  1. Launch ros bridge to unity
roslaunch file_server ros_sharp_communication.launch

In unity:

  1. Create empty object, add ros connector scripts and change ip address image

  2. Add joint states and odometry subscriber

image

  1. Add joint_state_writer to each wheel

image

  1. Drag each wheel to joint state write field in joint state subscriber

image

  1. Build The Scene. Make sure your phone is connected to same wifi with ROS PC

Try

  1. Download this respository

  2. Add ARrosCore Folder to Assets in Unity image

  3. Add HelloARROS Scene

In ARrosCore-main --> ARrosCore-main --> HelloARcoreRos --> scene image

  1. Edit ROSConnector URL

  2. Try build the scene while connecting to the Turtlebot3 Fake Node

Acknowledgement

ARCore Depth API: https://github.com/googlesamples/arco

ROS#: https://github.com/siemens/ros-sharp

CHAMP: https://github.com/chvmp/champ

Turtlebot3: https://github.com/ROBOTIS-GIT/turtle

About

The unity sample of ARCore and ROS implementation with ROS#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%