2

I have created a sample project in choreograph which is responsible for playing a video on pepper's tablet, it works nicely in choreograph. now i packaged and uploaded it on the robot and called this behavior (by albehaviormanger) in my python code as following:

behaviormanager = session.service("ALBehaviorManager")
if (behaviormanager.isBehaviorRunning(choregraph_Code)):
    behaviormanager.stopBehavior(choregraph_Code)

behaviormanager.runBehavior(choregraph_Code)

It works but sometimes the video stopped suddenly, in every single run in a different moment! so whats the problem with it?

also I tried to play videos from net by:

tabletService.enableWifi()
tabletService.loadUrl(url)
tabletService.showWebview()

but after some time it stops too

so does any one know what's a problem?

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
user9805040
  • 73
  • 1
  • 9

1 Answers1

0

Most likely your problem here is that Autonomous Life is resetting the tablet. And that happens because Autonomous Life doesn't know that your behavior is running.

Autonomous Life has the concept of "focused activity"; of which there can only be one at a time (lower priority activities will not be started, and when a higher activity priority is started, the lower priority one will be stopped). Between activities, Autonomous Life resets the tablet, but won't do so inside an activity.

So instead of doing ALBehaviorManager.runBehavior, you should use ALAutonomousLife.switchFocus (with the same behavior path as a parameter), and AutonomousLife won't reset your tablet.

(Not all behaviors are intended to be activities; some activities have sub-behaviors, and some behaviors may be expected to be running quietly in the background without getting the focus - that's not a good practice, but sometimes happens)

Emile
  • 2,946
  • 2
  • 19
  • 22
  • Thank you so much @Emile for your response, actually i need to play 6 different videos (so six different choregraphe prj) and i used a for loop (i=0 to 5) each time one video would be played. now if a video starts to play then it would be played without stop but in i==2 .. i==3 and so on any video doesn't play! it seems i have to reset something! but i don't know what exactly! – user9805040 Oct 01 '18 at 15:12