32,36 €
Design end-to-end AR solutions for domains such as marketing, retail, manufacturing, tourism, automation, and training
Key Features
Book Description
Augmented reality (AR) is expanding its scope from just being used in mobile and game applications to enterprise. Different industries are using AR to enhance assembly line visualization, guide operators performing difficult tasks, attract more customers, and even improve training techniques. In this book, you'll gain comprehensive insights into different aspects of developing AR-based apps for six different enterprise sectors, focusing on market needs and choosing the most suitable tool in each case.
You'll delve into the basics of Unity and get familiar with Unity assets, materials, and resources, which will help you build a strong foundation for working on the different AR projects covered in the book. You'll build real-world projects for various industries such as marketing, retail, and automation in a step-by-step manner. This will give you hands-on experience in developing your own industrial AR apps. While building the projects, you'll explore various AR frameworks used in the enterprise environment such as Vuforia, EasyAR, ARCore, and ARKit, and understand how they can be used by themselves or integrated into the Unity 3D engine to create AR markers, 3D models, and components of an AR app.
By the end of this book, you'll be well versed in using different commercial AR frameworks as well as Unity for building robust AR projects.
What you will learn
Who this book is for
This book is for anyone interested in emerging and interactive technologies or looking to build AR applications for any domain. Although, no prior augmented reality experience is required, having some skills in object-oriented programming (OOP) will be helpful.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 269
Veröffentlichungsjahr: 2019
Copyright © 2019 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor:Pavan RamchandaniAcquisition Editor:Ashitosh GuptaContent Development Editor:Aamir AhmedSenior Editor: Hayden EdwardsTechnical Editor:Jane DsouzaCopy Editor: Safis EditingProject Coordinator:Manthan PatelProofreader: Safis EditingIndexer:Rekha NairProduction Designer:Joshua Misquitta
First published: December 2019
Production reference: 1201219
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78980-740-0
www.packt.com
Packt.com
Subscribe to our online digital library for full access to over 7,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Fully searchable for easy access to vital information
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Jorge R. López Benito is a tech entrepreneur passionate about emerging and exponential technologies with more than 10 years of experience in researching and building Augmented Reality (AR), Virtual Reality (VR), and Artificial Intelligence (AI) products. In 2010, he became the co-founder and CEO ofCreativiTIC, which focused on the research of disruptive technologies, new business models, and market innovation trends. He has been involved in several R&D projects throughout his career, including FP7 and H2020 European projects, and because of that,he was named as a Key Innovator in AR & Deep Learning Technologies by the European Commission; whom he also supports as an independent expert on interactive technologies to explore emerging trends and identify opportunities for impact across the industries, and also as a Jury Member at the European Innovation Council (EIC) Accelerator.
https://www.linkedin.com/in/jrlopezbenito/
Enara Artetxe González is the co-founder and CTO of CreativiTIC, a company dedicated to Mixed Reality (MR) technologies. With a bachelor's degree in telecommunications engineering, she has been working with Augmented Reality (AR) and Virtual Reality (VR) technologies for more than 10 years, developing innovative solutions for desktop, mobile, web, and head-mounted display (HMD) platforms in fields such as industry, healthcare, and education. She has participated in several R&D projects including FP7 and H2020 European research projects, and because of that, she was named as a Key Innovator in AR & Deep Learning Technologies by the European Commission. She actively supports vocational actions to involve girls in science and technology through STEAM methodologies.
https://www.linkedin.com/in/eartetxe/
Ken Crawford is an AR developer and researcher based in the United States with a focus on AR glasses used in enterprise and manufacturing settings. He currently works for an engineering company where he is involved with testing AR software for remote assistance, employee training, and developing the organization's technical capabilities to implement and effectively use AR throughout its operations.
Prior to his engineering position, Ken had an AR start-up called Ear Compass, from 2015 to 2017, that looked to leverage the spatial awareness of the Microsoft HoloLens platform for the visually impaired.
Ken holds a doctorate and a master's degree from Northern Illinois University. He was formerly a combat engineer with the US Marine Corps.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
We would like to acknowledge the amazing staff and editorial team at Packt Publishing: without their talent and dedication, this book would not have turned out to be such a valuable asset. First, we would like to thank Ashitosh Gupta for contacting us and giving us the opportunity of writing about a subject, Augmented Reality, that we love. We also want to thank our editors Aamir Ahmed, Jane D'souza, and Hayden Edwards for their many insightful comments and guiding us through the process of writing. Thanks for your efforts and helpfulness.
A special mention goes to our good friend Aitor Sansebastián for encouraging us to carry out this project out. We would also like to thank all those who've supporting us in this journey since we founded our company, the ones who have been there from the beginning, and those who joined us along the way. You know who you are :)
"I would especially like to thank the two women who have accompanied me along the process of this book. First, to Enara Artetxe, the co-author of this book and a professional colleague, who I consider the best "ninja developer" in augmented reality. Without her, this book could not have been possible. And second, to my better half Ana Laín, for her daily support in every aspect of my life and for helping me to overcome any challenges I encountered." - Jorge R. López Benito
"A special thanks goes to my cat Keiko; without her constant jumping on my keyboard, threatening to write the book herself, or the endless hours of sitting in my lap, leaving me without anything to do but coding and writing, the process of writing this book wouldn't have been the same :)" - Enara Artetxe González
Last but not least, a big THANK YOU to you all, our readers, for investing your time in reading our book. We hope you have learned and enjoyed as much as we have.
Title Page
Copyright and Credits
Enterprise Augmented Reality Projects
Dedication
About Packt
Why subscribe?
Contributors
About the authors
About the reviewer
Packt is searching for authors like you
Acknowledgments
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Introduction to AR and How It Fits the Enterprise
Understanding AR
Short history – the beginnings of a new reality
The magic behind AR
Working with AR 
ARToolKit – the first AR library
Introduction to the AR SDKs 
Vuforia
EasyAR
ARCore
ARKit
Using AR in enterprise
Using AR in industry 4.0
Smart assistance
Virtual prototyping
Logistics and warehouse management
Digital Twins
Using AR in other enterprise areas
AR for manufacturing
AR for training
AR for marketing
AR for retail
AR for automation
AR for tourism
Summary
Introduction to Unity for AR Development
Technical requirements
Introducing Unity
Preparing your system for Unity
Installing Java Development Kit (JDK)
Installing Unity
Understanding the Unity interface
The Toolbar
The Scene view
The Hierarchy window
The Inspector window
The Project window
The Game view
The Asset Store window
The Console window
Changing the layout
Unity's main elements
Assets
GameObjects
Components
Prefabs
Scripts
Scripting – first example in C#
Summary
AR for Manufacturing with ARCore
Technical requirements
Using AR for manufacturing
Exploring ARCore
Creating a prototype AR viewer
Installing the Java Development Kit (JDK)
Installing Android Studio
Creating the application
Enabling ARCore
Adding Sceneform to the project
Adding 3D models to the project
Forming the AR scene
Improving the basic app
Summary
Further reading
AR for Training with WebAR and Augmented Class!
Technical requirements
Using AR for training
Exploring WebAR with Google Web Component <model-viewer>
Working with 3D models
Creating a simple web page
Coding with Glitch
Coding the style sheet
Coding the index.html page
Adding the <model-viewer> Component to our page
Visualizing the 3D models in AR
Exploring Augmented Class!
Preparing the material
Creating a simple project
Adding user interaction
Creating interaction between markers
Sharing the project
What's next?
Summary
AR for Marketing with EasyAR
Technical requirements
Using AR for marketing
Understanding EasyAR
Building image-based AR
Understanding our AR scene
Preparing the target
Obtaining the key
Testing the scene
Troubleshooting
Building the app
Working with custom 3D models
Creating an AR catalog
Modifying the AR scene
Creating the controller script
Creating the interface
Summary
AR for Retail with Vuforia
Technical requirements
Using AR for retail
Exploring Vuforia
AR on the go – using Ground Plane
Enabling ARCore in Vuforia
Creating the Ground Plane scene
Obtaining the key
Testing the app
Creating an AR furniture viewer
Adding elements to our project
Adding the logic of the app
Improving the app
Summary
Further reading
AR for Automation with Vuforia and AR Glasses
Technical requirements
Using AR in automation
Introducing the scenario and process
Exploring Vuforia
Developing image-based AR in Vuforia
Creating the targets
Adding some test cubes
Obtaining the key
Testing the app
Creating an industrial guide for AR glasses
Preparing the material
Adding the UI
Mounting the AR scene
Configuring the AR for glasses
Adding the PDF file
Summary
AR for Tourism with ARKit
Technical requirements
Using AR for tourism
Exploring ARKit
Developing an ARKit app
Creating a new AR project
Main.storyboard
ViewController.swift
Modifying the basic app
Detecting and showing horizontal planes
Adding ARSessionDelegate to track state changes
Adding a label UI element
Sending notifications to the user
Creating an AR portal
Importing the 3D model
Adding the model to the project
Adding the model to our scene
Including user interaction
Adding the walls of the portal
Improving the portal
Summary
Further reading
Other Books You May Enjoy
Leave a review - let other readers know what you think
Augmented reality (AR) is an amazing technology that dates back to the 1990s and was mostly unknown to the general public until the appearance of Google Glass and the release of the AR-based game Pokemon Go. Although, initially, it was mainly used in marketing to get the wow effect, it has since proved to be a natural interface for the user in many other fields, such as tourism, industry, medicine, and education. Its versatility of features (based on image or physical world recognition, GPS location, and more) and target devices (Android/iOS mobile devices, computer, web, and Head Mounted Displays (HMD)) makes it the perfect complement for different sectors and implementations such as industrial guides, live art experiences, and training tools.
Enterprise Augmented Reality Projects aims to take you on a journey of developing and building applications with AR using the best-known frameworks on the market. In this book, we'll explore the aspects of developing AR-based applications for six different enterprise sectors (manufacturing, training, marketing, retail, automation, and tourism) in detail, starting from the market needs and choosing the most suitable tool in each case. Each chapter will cover a new use of AR by using a different framework or target device.
The first chapter will be an introduction to AR so that you will have a good understanding of its uses and potential before starting to code. Next, we'll introduce you to Unity, an amazing 3D tool that will simplify the task of integrating AR frameworks and manipulating 3D objects and scenes in many of the chapters. Then, we'll work with Android Studio and ARCore to create our first augmented project for prototyping. Afterward, we will explore both WebAR with the Google Web Component <model-viewer>, and the emerging AR authoring tool, Augmented Class!, for education. Next, we will start working with Unity to integrate the AR framework, EasyAR, to create an AR catalog for a marketing experience. We will then continue with the Vuforia framework and use it retail. Furthermore, we will use Vuforia combined with AR glasses to create a step-by-step guide for an automation process. We will then end the book with ARKit, developed, in this case, inside Xcode, to implement an augmented dimensional portal for tourism.
Enterprise Augmented Reality Projects is aimed at enthusiasts of emerging and interactive technologies interested in building AR applications for any field step by step, and learning about the latest tools to develop them. No prior AR experience is required. Some object-oriented programming skills would be helpful.
Chapter 1, Introduction to AR and How it Fits the Enterprise, starts off the book by introducing AR and its uses. It covers the origins of the technology, types of AR that can be developed, the frameworks you will be using through the book, and the main uses of AR in different enterprise sectors.
Chapter 2, Introduction to Unity for AR Development, is an introduction to the real-time 3D development platform Unity, where you will learn the nomenclature and uses of the main elements. You will also learn how to create a first script in C# to see the potential of this tool.
Chapter 3, AR for Manufacturing with ARCore, introduces the ARCore technology and how to implement its surface detection features. You will create a prototype viewer for Android using Android Studio and the Sceneform plugin, which will help us to easily integrate 3D models in our project.
Chapter 4, AR for Training with WebAR and Augmented Class!, explores two different tools in a common project for training purposes. With WebAR, you will learn how to develop a simple web app that includes the <model-viewer> web component, which will be used to launch AR from an ARCore-supporting mobile device. Augmented Class! is an authoring tool for Android that's used to easily create interactive educational AR projects.
Chapter 5, AR for Marketing with EasyAR, introduces you to using Unity to develop AR projects with the EasyAR framework. You will learn how to develop an augmented catalog based on image tracking and how to create interfaces in Unity and link them to scripts and objects in the scene.
Chapter 6, AR for Retail with Vuforia, teaches you how to use Vuforia's ground detection features inside Unity to place 3D objects over flat surfaces and move/rotate/scale them, with the possibility of adding ARCore on top of Vuforia. All the while, you will work further with Unity and its components to reinforce previous concepts.
Chapter 7, AR for Automation with Vuforia and AR Glasses, continues developing with the Vuforia framework but oriented in this case to building on AR glasses. You will learn about the similarities and differences between mobile and glasses-oriented apps while creating an augmented guide for an automation process.
Chapter 8, AR for Tourism with ARKit, developed over Xcode and aimed at iOS devices. In this chapter, you will create an augmented portal anchored to the real world that will transport the user to a hidden virtual world. To do this, you will also learn how to work with the SceneKit framework to create 3D scenes and display 3D models.
To get the most of this book, no prior AR or Unity experience is required as they will be covered in detail. Similarly, prior understanding of Android Studio and Xcode would be helpful, but is not required. Object-oriented programming skills would be helpful as we will be using Java, C#, and Swift for our projects. However, if you follow the steps in the book and copy and paste the code, you will be able to build all the projects from scratch. Every chapter will contain the installation instructions and information you will need to implement each project.
VS: Although VS2019 is out, we are using 2017 as it comes integrated with Unity and will ensure it works directly without further configuration.
JDK: Any version of JDK 8 and above from the new OpenJDK should be functional but specifying that to avoid errors, the version 8 works.
You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at
www.packt.com
.
Select the
Support
tab.
Click on
Code Downloads
.
Enter the name of the book in the
Search
box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR/7-Zip for Windows
Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Enterprise-Augmented-Reality-Projects. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781789807400_ColorImages.pdf.
There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Remove the text from it, and change the button name to Home_button."
A block of code is set as follows:
h1 { text-align: center; color: #000000; font-style: bold;}
Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select the ARCamera, and in the Inspector window click on Open Vuforia Engine Configuration."
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packt.com.
This book was written for enthusiasts of emerging and interactive technologies who are interested in building AR applications for any market field from the very beginning, and learning about the latest tools to develop them. No prior AR experience is required.
The idea of this book is to introduce you to different AR frameworks by completing a set of projects in different enterprise environments. Although specific programming skills are not mandatory, minimal knowledge is desirable so that you understand the code in each example. Some object-oriented programming skills would be helpful, but they are not required. This book has been written from scratch, so you'll be able to follow any coding necessities step by step.
In this chapter, we will learn what Augmented Reality (AR) is and we will present a brief tour of its history, types, and how it works. We will also introduce the Software Development Kits (SDKs) that we will work with in this book. Finally, we will look at examples of the use of AR and, in particular, its application inside the enterprise. The main objective of this chapter is to understand how AR is being used today, including markets, technologies, devices, and development tools with a variety of AR recognition modes, such as target images, cloud markers, GPS-based, object or face tracking, and spatial mapping. You will also learn about the main AR tools we are going to use in this book and a brief introduction to their main features.
By the end of this chapter, you will have a basic understanding of how AR works and what its different uses are so that you can follow the technical chapters ahead more easily.
In this chapter, we will cover the following topics:
Understanding AR
Working with AR
Using AR in enterprises
AR is the term that's used to describe the technology that allows users to visualize part of the real world through the camera of a technological device (smartphone, tablet, or AR glasses) with virtual graphical information that's been added by this device. The device adds this virtual information to existing physical information. By doing this, tangible physical elements combine with virtual elements, thus creating augmented reality in real-time. The following image shows how AR works:
Now, we are going to look at the beginnings of AR and learn how AR can be divided according to its functionality.
AR is not a new technology. The beginnings of AR begin with the machine that was invented by Morton Heilig, a philosopher, visionary, and filmmaker, when, in 1957, he began to build a prototype with an appearance similar to the arcade video game machines that were very popular in the 90s. The following image shows a schema of how the prototype worked:
Morton called his invention Sensorama, an experience that projected 3D images, added a surround sound, made the seat vibrate, and created wind that was thrown as air at the viewer. The closest similar experience we can feel today is seeing a movie in a 4D cinema, but these experiences were created more than 60 years ago.
In 1968, Harvard Electrical Engineering professor Ivan Sutherland created a device that would be the key to the future of the AR technology known as the Human-Mounted Display (HMD). Far from the AR glasses that we know of today, this HMD, called the Sword of Damocles, was a huge machine that hung from the ceiling of a laboratory and worked when the user was placed in the right place. In the following image, you can see what this invention looked like:
In 1992, Boeing researcher Tom Caudell invented the term AR, and at the same time, AR technology was boosted from two other works. The first AR system, from L.B. Rosenberg, who works for the United States Air Force, is a device that gives advice to the user on how to perform certain tasks as they are presented, something like a virtual guide. This can be seen in the following image:
The other research in this area was led at Columbia University, where a team of scientists invented an HMD that interacted with a printer. The device, baptized as Karma (AR based on knowledge for maintenance assistance), projected a 3D image to tell the user how to recharge the printer, instead of going to the user manual.
The following diagram is a representation of the continuum of advanced computer interfaces, based on Milgram and Kishino (1994), where we can see the different subdivisions of the MIXED REALITY (MR) that go from the REAL ENVIRONMENT to the VIRTUAL REALITY. AR that's located nearer to the REAL ENVIRONMENT is divided between spatial AR and see-through AR. However, the appearance of mobile devices in the 21st century has allowed a different version of AR, where we can display it using the device screen and camera:
Now that we have introduced the beginnings of AR, let's learn how this technology can be classified depending on the trigger that's used to show virtual elements in the real world.
AR can be created in many ways; the main challenge is how to make the combination of the real and virtual worlds as seamless as possible. Based on what is used to trigger the virtual elements to appear in the real world, AR can be classified as follows:
GPS coordinates
: We use GPS coordinates, compasses, and accelerometers to locate the exact position of the user, including the cardinal point they are looking at. Depending on where the user is pointing to, they will see some virtual objects or others from the same position.
Black and white markers
: We use very simple images, similar to black and white QR codes, to project virtual objects on them. This was one of the first AR examples, although nowadays they are used less often as there are more realistic ways to create the AR experience.
Image markers
: We use the camera of the mobile device to locate predefined images (also called targets or markers) and then project virtual objects over them. This type of AR has substituted black and white markers.
Real-time markers
: The user creates and defines their own images with the mobile camera to project any virtual object in them.
Facial recognition
: Through the camera, we capture the movements of the face to execute certain actions in a request, for example, to give facial expressions to a virtual avatar.
SLAM
: Short for
Simultaneous Localization And Mapping
, this technology understands the physical world through feature points, thereby making it possible for AR applications to recognize 3D objects and scenes, as well as to instantly track the world, and overlay digital interactive augmentations.
Beacons
: eBeacons, RFID, and NFC are identification systems that use radio frequency or bluetooth, similar to GPS coordinates, to trigger the AR elements.
Now, you have a better grasp of what AR is and where it comes from. We have covered the basics of AR by looking at the first prototypes, and classified different types of AR according to the element that triggers the virtual images so that they appear on the screen. The next step is to see what is required to work with it.
AR projects need some basic elements to fulfill its function:
Digital support, mainly tablet, mobile phone, or glasses. These will be the devices we will use to recognize what we are seeing and incorporate the information into AR.
Sensors to perceive reality as a camera, GPS, 3D scanner, and so on. They are usually integrated into mobile devices.
An algorithm or application to understand the reality that is being observed, interpreted, and displayed with the associated information.
Digital content to enrich reality. This is all the information that you incorporate into AR.
The result is an interface in which reality is observed with additional information located in the space it needs to be in. The following subsections present different AR libraries and SDKs, as well as how they function.
ARToolKit was the world's first open source software library and allows the creation of AR applications, in which virtual images overlap in the real world. It uses video tracking capabilities to calculate the position of the camera and the orientation relative to the position of the physical markers in real-time. Once the position of the real camera is established, the virtual camera is placed at the same point and a virtual layer of information, such as a 3D object, is superimposed on the real marker. ARToolKit was originally developed by Hirokazu Kato and the initial release was published in 1999 by the HIT Laboratory of the University of Washington. It is currently maintained as an open source project hosted at SourceForge with commercial licenses available at ARToolworks: http://www.artoolkitx.org/.
Now, we will introduce the AR SDKs that we will use in this book. From the first appearance of ARToolKit, AR SDKs have very much evolved. Let's introduce and describe the different SDKs we are going to use in this book to create our own AR experiences:
Vuforia
EasyAR
ARCore
ARKit
Let's talk a little bit about each of them.
