Localize and navigate via a predefined map for specific use case scenarios
The Navigation scene allows you to localize your environment with the point cloud map created earlier using the ARWAY Mapping app and then navigate through the map via the content created on the ARWAY Web Studio within the Developer Portal.
You will need to add the Map_id and Cloud_id beforehand and then on runtime, it looks for feature points via your camera and tries to match those feature points with the point cloud data scanned earlier, thus localizing it to your environment. After localizing, you could select the navigation path which you wish to take.
This scene requires you to firstly map a real-world space with the ARWAY Mapping app and submit the map data.
Pose Setter Script:
Pose Setter is a script that takes ARSpace as input and then tries to localize it to the surrounding area during localization, at the origin (0, 0, 0).
Pose Setter (Script)
NavController and AStar Script:
In order to navigate from the user's current location to the selected destination, NavController.cs and AStar.cs scripts are being used.
You can change the navigation path UI by dragging a new prefab onto the navigation path prefab item.
Also, you can choose whether to show the path during runtime or not via the Show Path toggle.
Expand the Path item see the shortest path to the selected destination from the user's current location i.e. the AR Camera.
For navigation to work, waypoints need to be added "from the origin to the destination at regular intervals" within the Floor Builder page in the Developer Portal.
NavController, AStar (Script)
Content Manager Script:
The Content Manager script allows you to give a predefined MAP_ID and CLOUD_ID to the scene thus allowing you to create single navigational content easier for specific use case scenarios.
Therefore, the user will be able to localize and view a specific map rather than go through a list of all the maps created to date.
Content Manager (Script)
What is ARSpace?
ARSpace is a gameobject present in the Unity scene hierarchy, that localizes any content placed under it as a child, to the localized origin (0, 0, 0).
So, in order to display assets during runtime in the built application, the assets must be made a child of the ARSpace gameobject.
How to add content to ARSpace?
In order to add content to ARSpace, simply drag and drop the assets as a child gameobject to the ARSpace gameobject.
By default there is a Gizmo gameobject as a child of ARSpace, which shows the localized origin in the scene during runtime.
How to Use?
Step 1: Open the Navigation scene found in the Assets/ARWAYSDK/Scenes folder within the Unity project.
Step 2: In the Hierarchy window, look for ARWAYSDK gameobject and then click on it.
Step 3: In the Inspector panel, look for Arway SDK Script and enter your unique Developer Token in the Developer Token field and save the scene.
ARWAY SDK (Script)
Step 4: After saving, add the current scene to the build scenes. Then choose the platform of your choice (Android/iOS) and build the application.
Step 5: Install the built app on your device and open it.
Step 6: Upon opening the app, give it the required permissions when asked. Click on the Select Destination dropdown at the top and you should be able to see all the destinations added defined in the Content Manager script.
Step 7: Select the destination which you want to localize from the list. The app will then download the required map data from the cloud servers.
List of Destination from the dropdown menu
Step 8: Now, press the localize button after selecting your destination, to localize your surroundings with the selected map.
Press the localize button after selecting destination
You will see a localization counter at the top representing the number of times your device has localized and the total number of attempts respectively.