Getting Started with ARToolKit+ Unity Plugin (Open Source AR)

DAQRIcompany announces a new milestone in the project augmented reality tools open source AR SDK, ARToolKit. The Americans started to open beta ARToolKit-5 on Linux, Android, iOS, macOS, and Unity. New updates abound functional part and distributed Apache v2.0 license so that developers can create their own applications with minimal licensing restrictions.

ARReverie added a new tracking method which will detect an ImageTarget without creating external Marker database by combining multiple tech together such as P3P and optical flow for a more reliable reading key.

The system recognizes and track supports multiple images based on detection initialization at speeds of tens of milliseconds. Calibration, identification, and tracking of fully autonomous kept up to hundreds of detected images; working dynamic loading and saving individual images or sets.

ARTOOlkit+ For Unity:

ARReverie provides ARToolKit+ plugin for Unity brings the full functionality of ARToolKit into the Unity3D visual development environment. It consists of a set of Unity script components which integrate seamlessly with your Unity project, native plugins which implement the underlying core functionality, and a set of examples and accompanying resources that act as starting points.

Note: Plugin cost 45$(One Time) only and this amount will help the ARReverie Technology to explore the latest tech and transfer the knowledge.

System Requirements (Development & Deployment)

# Development Requirements:

Mac OS X min. Sierra (version 10.12.3)

X-Code min. Version 8.2.1 (Optional)

Android Studio v2.1 and later (Optional)

Unity3D (min. 5.5 installed on a macOS X), the free, Personal Edition, is sufficient for a start

Let’s Start Developing an application using ARToolKit + Unity

As a quick start with Unity3D and ARToolKit+, we are using one of the default example scenes shipped with the ARToolKit+ Unity package. This Tutorial describes how to create and demonstrate augment reality application using the Unity3D IDE and the ARToolKit+ for Unity SDK.

For the first tutorial, we’re going start from scratch and create an application that recognizes an image exposed to the computer’s/Mobile’s camera, tracks the image and augments a 3D model in the video feed over the tracked image.

Prerequisite (Tools Needed):

As discussed earlier Support for ARToolKit+ for Unity and the Unity3D IDE on Windows 10 is under test and is forthcoming. “MacOS based Unity3D IDE” is recommended.

If you intend to build and deploy on Android, you’ll need to install Android SDK, which must include the NDK, Android Studio or Android command-line tools (for example, the Android ADB).

If you intend to build and deploy on iOS you’ll need to install XCode.

Here in this tutorial, we are targeting Android as a deployment Platform, We will be using ARToolkit+ AR SDK by ARReverie and Unity 3D engine and Android SDK for this tutorial. Make sure you have downloaded the following before proceeding further.

Select the package you want from Explorer or Finder, and the Import Unity Package dialog box displays, with all the items in the package pre-checked, ready to install. (See Fig 4: New install Import Unity Package dialog box.)

Select Import and Unity puts the contents of the package into the Assets folder, which you can access from your Project View.

If any “API Update” related dialog box appears, just click on “I Made a Backup” and go ahead.

IMP NOTE: ARToolKit+ support Mac, Android, iOS or Linux as a deployment platform so we need to build the project for any of them inside Unity build settings. If there any error occurs like ‘ARToolKit+: Build target not supported’ just ignore it for now.

5. Import 3D model (Spider) from Unity Assets Store:

Now the fun part begins!!! let’s download 3D model with some animations for our augmented reality. For this tutorial, we choose one Green Spider from Unity Asset Store (free).

You can open the Asset Store window by selecting ‘Window > Asset Store’ from the main menu. On your first visit, you will be prompted to create a free user account which you will use to access the Store subsequently.

Navigate to: ‘Window > Asse Store’ OR Select ‘Asset Store Tab’

In Asset Store window search for the keyword “Spider Green” and download the same, as shown in the screenshot below.

6. Add 3D model (Spider) Inside ImageTarget in Unity Scene

Afterward, we introduce our 3D model (downloaded from Asset Store) into parent ImageTarget, to do this:

NOTE: This AR app will work on ImageTarget/Marker_Image even with a black and white image of the stones because the feature points will still remain (they usually depend on other factors like gradient, etc. instead of color).

You can download Marker Image from here. The target image is required that your computer’s camera will recognize and track while demonstrating ARToolKit6 Augmented Realty example applications.

7. Android Deployment Setup to Run App on Device:

We are almost done. Let’s save the scene: File >> Save Scene and move towards deployment step. At this point, if we select “Run” and point a print out of the image towards our webcam, the Spider get augmented over printout.

The last step is to build the project for Android. We need to go to “File >> Build Settings”. We need to add the current scene by selecting “Add Open Scene”. Then, we need to select a platform (Android) and then select “Switch Platform“. Here, we will have multiple options:

Export Project: This will allow us to export the current Unity project to Android Studio so it can be edited and used to add more elements.

Development Build: Enabling this will enable Profiler functionality and also make the Autoconnect Profiler and Script Debugging options available.

Unity provides a number of settings when building for Android devices – select from the menu (File > Build Settings… > Player Settings…) to see/modify the current settings.

Before pressing the Build And Run, we need to make some more changes in the “Player Settings” options in the Inspector panel:

The Company Name needs to be changed; e.g. to “ARReverie”.

Need to change the “Package Name” under “Identification” say, to “com.arreverie.artoolkitdemo”.

Now, we can proceed to “Build and Run”. Other changes like Minimum API Level etc. can be made as per additional requirements. We will need to connect an Android mobile device via USB and enable USB debugging.

NOTE: We will also need to have an Android developer environment set up before we can test our Unity games on the device. This involves downloading and installing the Android SDK with the different Android platforms and adding our physical device to our system (this is done a bit differently depending on whether we are developing on Windows or Mac).

If you get stuck at any point, feel free to post us in the comment section below.

‘If you stuck at any point’ OR ‘Do you have any questions about this tutorial?’ OR ‘Do you have any suggestions for a new AR tutorial?’ Let me know in the comments section below.

Best of luck 🙂

0

About Sanket Prabhu

Sanket Prabhu is Technology Evangelist in XR (MR/AR/VR), Unity3D technology, a software engineer specializing in Unity 3D, Extended Reality (MR/AR/VR) application and game development.
Currently working as a technology evangelist at Mobiliya, India. He runs a website (arreverie.com) which is the online blog and technical consultancy. The main goal of ARReverie is to develop complete open source AR SDK (ARToolKit+)