Localization Library

wipExperimental feature, still in progress

What is Localization Library

Localization Library is an optional Android library containing high level APIs.

It allows application developers to retrieve maps previously created using the Localization Setup Application.

Prerequisites

  • Robot version compatible with QiSDK API level 4.
  • Localization Setup Application installed on the tablet.
  • Robot language set on one of the supported languages.

Let’s try it

Localization Library allows you to get, synchronously or asynchronously, a previously saved map.

This example shows the asynchronous version.

Step Action

Add the base dependency to your module’s build.gradle file:

implementation 'com.aldebaran:qisdk-localization:0.7.7'

Now you can get your application’s Place.

Each application can have 1 Place, or no Place.

A Place contains an ExplorationMap.

// Don't forget to get the qiContext from onRobotFocusGained.

Localization.async().requestPlace(qiContext).andThenConsume(place -> {
    // The Place is nullable, don't forget to null-check it.
    if (place != null) {
        // Here you can use your Place.
    } else {
        Log.d(TAG, "No Place found.");
    }
});

Get your ExplorationMap:

// Don't forget to get the qiContext from onRobotFocusGained.

place.async().getExplorationMap(qiContext).andThenConsume(explorationMap -> {
    // Here you can use your ExplorationMap.
});

See also