"Animation failed." 的本地化和地图错误

Localise And Map errors with "Animation failed."

运行 LocalizeAndMap 我收到以下错误。没有实现其他动画事件(全部注释掉)。我还从 Pepper 删除了以前的应用程序并重新安装。

我刚更新到API6.

public void startMapping() {
        // Create a LocalizeAndMap action.
        localizeAndMap = LocalizeAndMapBuilder.with(qiContext).build();

        // Add an on status changed listener on the LocalizeAndMap action to know when the robot has mapped his environment.
        localizeAndMap.addOnStatusChangedListener(status -> {
            switch (status) {
                case LOCALIZED:
                    Log.i(TAG, "Robot has mapped his environment.");
                    say( "Mapping done");
                    // Dump the ExplorationMap.
                    explorationMap = localizeAndMap.dumpMap();
                    // Cancel the LocalizeAndMap action.
                    localizationAndMapping.requestCancellation();
                    break;
            }
        });

        Log.i(TAG, "Mapping...");
        //say( "Boopity doop");
        // Execute the LocalizeAndMap action asynchronously.
        localizationAndMapping = localizeAndMap.async().run();

        // Add a lambda to the action execution.
        localizationAndMapping.thenConsume(future -> {
            if (future.hasError()) {
                Log.e(TAG, "LocalizeAndMap action finished with error.", future.getError());
                localisationListener.localisationFailed();
            } else if (future.isCancelled()) {
                // The LocalizeAndMap action has been cancelled.
                startLocalizing(qiContext);
            }
        });

    }
12-18 16:59:38.150 9330-9373/com.akqa.peppertest E/LocaliseManager: LocalizeAndMap action finished with error.
    com.aldebaran.qi.QiException: Animation failed.
        at com.aldebaran.qi.Future.qiFutureCallGet(Native Method)
        at com.aldebaran.qi.Future.get(Future.java:238)
        at com.aldebaran.qi.Future.get(Future.java:273)
        at com.aldebaran.qi.Future.getError(Future.java:308)
        at com.akqa.peppertest.LocaliseManager.lambda$startMapping(LocaliseManager.java:79)
        at com.akqa.peppertest.-$$Lambda$LocaliseManager$v5-1peqSlVfNY0haEaORatFr7rU.consume(lambda)

所以,这是因为物理电源端口盖被打开了。关闭后我没有收到此错误。

也许作为教程的一部分,可以添加检查,或者可以包含说明问题的更具描述性的错误消息。

从API6和Naoqi 2.9.4开始,您可以查看充电盖状态(打开或关闭)

public boolean getFlapState() {
    boolean flapState = chargingFlap.async().getState().getValue().getOpen();
    Log.d(TAG, "getFlapState: Is opened ? :" + flapState);
    return flapState;
}

你知道this complete Navigation tutorial for Pepper吗?

每次操作前都会检查充电板状态。