我正在创建此应用程序,其中Pepper在其平板电脑上显示一些可点击的图片。通过单击图片,用户将使Pepper做出一些手势。这是我创建的Choregraphe文件:
这是我正在使用的相应JS和HTML文件:
// keeping a pointer to the session is very useful!
var session;
try {
QiSession(function(s) {
console.log('connected!');
session = s;
});
} catch (err) {
console.log("Error when initializing QiSession: " + err.message);
console.log("Make sure you load this page from the robots server.")
}
function addUser(data) {
session.service('ALMemory').then(function(memory) {
memory.raiseEvent('My_App/gesture', data)
}, function(error) {
console.log(error);
})
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="lib/bootstrap-3.3.7-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="lib/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="lib/font-awesome-4.7.0/css/font-awesome.min.css">
<!-- application css -->
<title> Gesture application </title>
<style>
div.gallery {
margin-left: 40px;
border: 1px none #ccc;
float: left;
padding-left: 5px;
}
div.gallery img {
padding: 5px;
padding-bottom: 20px;
width: 260px;
height: auto;
align: center;
}
div.desc {
padding-bottom: 20px;
text-align: center;
font-weight: bold;
font-size: 150%;
}
</style>
</head>
<body>
<div class="page-header">
<div class="row">
<div class="col-sm-6 text-left"><img src="logo.png" width="200"></div>
<div class="col-sm-6 text-right"><img src="logo.png" width="200"></div>
<h1 align="center"> Pepper-Animation </h1>
</div>
</div>
<div class='gallery'>
<img src="aufwachen.JPG" alt="Mountain View" onclick="addUser('aufwachen')">
<div class="desc">Aufwachen </div>
</div>
<div class='gallery'>
<img src="confused.JPG" alt="Mountain View2" onclick="addUser('confused')">
<div class="desc">Verwirrt </div>
</div>
<div class='gallery'>
<img src="elefant.JPG" alt="Mountain View4" onclick="addUser('elefant')">
<div class="desc">Elefant </div>
</div>
<div class='gallery'>
<img src="gorilla.JPG" alt="Mountain View5" onclick="addUser('gorilla')">
<div class="desc">Gorilla </div>
</div>
<div class='gallery'>
<img src="happy.JPG" alt="Mountain View6" onclick="addUser('happy')">
<div class="desc">Happy</div>
</div>
<div class='gallery'>
<img src="happybirthday.JPG" alt="Mountain View7" onclick="addUser('happybirthday')">
<div class="desc">Happy Birthday</div>
</div>
<div class='gallery'>
<img src="helikopter.JPG" alt="Mountain View8" onclick="addUser('helicopter')">
<div class="desc">Hubschrauber</div>
</div>
<div class='gallery'>
<img src="hey.JPG" alt="hey" onclick="addUser('hey1')">
<div class="desc">Hey</div>
</div>
<div class='gallery'>
<img src="hinternkratzen.JPG" alt="hinternkratzen.JPG" onclick="addUser('hintenkratzen')">
<div class="desc">Hintern Kratzen</div>
</div>
<div class='gallery'>
<img src="kungfu.JPG" alt="kungfu.JPG" onclick="addUser('kungfu')">
<div class="desc">Kung Fu</div>
</div>
<div class='gallery'>
<img src="late.JPG" alt="late.JPG" onclick="addUser('late')">
<div class="desc">Zu spät</div>
</div>
<div class='gallery'>
<img src="luftgitarre.JPG" alt="luftgitarre.JPG" onclick="addUser('luftgitarre')">
<div class="desc">Luftgitarre</div>
</div>
<div class='gallery'>
<img src="maus.JPG" alt="maus.JPG" onclick="addUser('maus')">
<div class="desc">Maus</div>
</div>
<div class='gallery'>
<img src="monster.JPG" alt="monster.JPG" onclick="addUser('monster')">
<div class="desc">Monster</div>
</div>
<div class='gallery'>
<img src="muskeln.JPG" alt="muskeln.JPG" onclick="addUser('muskeln')">
<div class="desc">Muskeln</div>
</div>
<div class='gallery'>
<img src="niesen.JPG" alt="niesen.JPG" onclick="addUser('niesen')">
<div class="desc">Niesen</div>
</div>
<div class='gallery'>
<img src="pfeifen.JPG" alt="pfeifen.JPG" onclick="addUser('pfeifen')">
<div class="desc">Komm Pfeifen</div>
</div>
<div class='gallery'>
<img src="sachsofon.JPG" alt="sachsofon.JPG" onclick="addUser('sachsofon')">
<div class="desc">Saxophon</div>
</div>
<div class='gallery'>
<img src="spaceshuttle.JPG" alt="spaceshuttle.JPG" onclick="addUser('spaceshuttle')">
<div class="desc">Spaceshuttle</div>
</div>
<div class='gallery'>
<img src="thaichi.JPG" alt="thaichi.JPG" onclick="addUser('thaichi')">
<div class="desc">Thai Chi</div>
</div>
<div class='gallery'>
<!--<img src="traurig.JPG" alt="traurig.JPG" onclick="addUser('traurig')"><div class="desc">Traurig</div></div><div class='gallery'>-->
<img src="trinken.JPG" alt="trinken.JPG" onclick="addUser('trinken')">
<div class="desc">Trinken</div>
</div>
<div class='gallery'>
<img src="verbeugung.JPG" alt="verbeugung.JPG" onclick="addUser('verbeugung')">
<div class="desc">Verbeugung</div>
</div>
<div class='gallery'>
<img src="waswillstdu.JPG" alt="waswillstdu.JPG" onclick="addUser('waswillstdu')">
<div class="desc">Was willst du?</div>
</div>
<div class='gallery'>
<img src="winner.JPG" alt="winner.JPG" onclick="addUser('winner1')">
<div class="desc">Gewinner</div>
</div>
<div class='gallery'>
</div>
<script src="/libs/qimessaging/2/qimessaging.js"></script>
<script src="js1/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="js1/script.js"></script>
</body>
</html>
问题:当我在Pepper上运行此应用程序时,最初运行良好。我能够从平板电脑中陆续选择不同的手势,它们运行良好。但是选择7-8次后,程序将挂起。平板电脑上的应用卡住了,平板电脑上的任何选择都不会产生任何输出。通常,当其他应用程序发生这种情况时,我可以通过触摸头部触觉传感器3秒钟来退出该应用程序。但是此应用程序卡住得很糟糕,以至于我无法控制它。我尝试让它从Choregraphe入睡并重新启动它,但“自治生活”并未出现。作为最后的方法,我必须从紧急按钮中关闭Pepper。每当我运行此应用程序时,都会发生这种情况。我们认为这可能是Pepper的问题,因此我们删除了Pepper上的所有现有应用程序,进行了出厂重置,然后在重置后仅上传了该应用程序。但是,问题仍然存在。如果您能指出我的任何文件中的任何错误或为我提供解决方案,那就太好了。
答案 0 :(得分:1)
正如Anders_K所说,这可能是资源锁定的问题。您可能有:
...对于测试它的人来说似乎是随机的,因为它看起来像挂在不同的动画上,而实际上只有在不良动画发生在过去时。
如果动画是外部行为,则检查情况的一种方法是将其SSH到机器人上并调用qicli call ALBehaviorManager.getRunningBehaviors
-您会看到应该完成的动画之一是否仍在运行。