ExplorationMap


level_3


What is it

An ExplorationMap represents a description of Pepper’s environment, used by Pepper to localize himself relatively to his surroundings.

How to use it

Dumping an ExplorationMap

An ExplorationMap is obtained by dumping a representation of the environment Pepper has explored during the run of a LocalizeAndMap action.

// Build a LocalizeAndMap action.
val localizeAndMap: LocalizeAndMap = ...

// Run it.
localizeAndMap.async().run()

// When localized, dump the current description of the explored environment.
val explorationMap: ExplorationMap = localizeAndMap.dumpMap()

// Build a LocalizeAndMap action.
LocalizeAndMap localizeAndMap = ...;

// Run it.
localizeAndMap.async().run();

// When localized, dump the current description of the explored environment.
ExplorationMap explorationMap = localizeAndMap.dumpMap();

Localizing inside an ExplorationMap

The ExplorationMap can then be used by a Localize action, so that Pepper keeps track of his position relatively to where he was when he started the LocalizeAndMap action.

// Get an exploration map.
val explorationMap: ExplorationMap = ...

// Build a Localize action.
val localize: Localize = LocalizeBuilder.with(qiContext)
                              .withMap(explorationMap)
                              .build()

// Get an exploration map.
ExplorationMap explorationMap = ...;

// Build a Localize action.
Localize localize = LocalizeBuilder.with(qiContext)
                                   .withMap(explorationMap)
                                   .build();

Saving ExplorationMap content for future use

An ExplorationMap can be serialized to text, for example to save it to a file and store it persistently.

// Get an exploration map.
val explorationMap: ExplorationMap = ...

// Serialize the ExplorationMap data.
val mapData: String = explorationMap.serialize()

// Get an exploration map.
ExplorationMap explorationMap = ...;

// Serialize the ExplorationMap data.
String mapData = explorationMap.serialize();

Loading an ExplorationMap from its content

To re-use the content of a serialized ExplorationMap, one can build a new ExplorationMap object from the content.

// Retrieve a serialized ExplorationMap.
val mapData: String = ...

// Build a new ExplorationMap.
val explorationMap: ExplorationMap = ExplorationMapBuilder.with(qiContext)
                                          .withMapString(mapData)
                                          .build()

// Retrieve a serialized ExplorationMap.
String mapData = ...;

// Build a new ExplorationMap.
ExplorationMap explorationMap = ExplorationMapBuilder.with(qiContext)
                                                     .withMapString(mapData)
                                                     .build();

Performance and limitations

The format of a map is not definitive and may change as improvements are made to this functionality. It is advised to remap the environment after a system upgrade.

A map, made by a robot may be shared with another robot provided that their hardware are fully compatible.

See also