PepperのタブレットにJPG等の画像を表示する際に、内部保存領域に自作フォルダーを作りそこから参照しタブレットへ画像表示を行いたいです。
FTPでPepperへ接続し/tmp/の下にpepadというフォルダを作ってそこへjpg画像をアップしました。
下記コードShowImageボックスを使用しています。
実行するとタブレットは真っ暗になり、画像は表示されません。
デフォルトのコードに戻すと表示されますが、
参照先は.lastUploadedChoregrapheBehaviorの中になります。
よろしくお願いします。
Python
1 def onInput_onStart(self): 2 # We create TabletService here in order to avoid 3 # problems with connections and disconnections of the tablet during the life of the application 4 tabletService = self._getTabletService() 5 if tabletService: 6 try: 7 #url = self.getParameter("ImageUrl") 8 #if url == '': 9 # self.logger.error("URL of the image is empty") 10 #if not url.startswith('http'): 11 # url = self._getAbsoluteUrl(url) 12 13 url = "/tmp/pepad/test.jpg" 14 self.logger.info("画像="+url) 15 tabletService.showImageNoCache(url) 16 except Exception as err: 17 self.logger.error("Error during ShowImage : %s " % err) 18 self.onStopped() 19 else: 20 self.logger.warning("No ALTabletService, can't display the image.") 21 self.onStopped()
あなたの回答
tips
プレビュー