I'm building a project which I wish to trigger some pre-installed behaviors inside my robot (which I downloaded from a developer). Understand that I can import content in behaviors (.xar) format into my current project. Any idea how can I extracting the installed behaviors from the robot to my PC?
It depends what you want to do with the apps, just to run them as part of your app or whether you want to edit or integrate the behaviours into your app somehow.
If you downloaded the apps as .pkg files or Choregraphe projects that you installed to the robot (ie. you can see them installed in the "Robot applications" view in Chorgraphe), you can use Pepper's Autonomous Life API to switch to the app, run it until it finishes, then switch back to your app. The activity name is the app ID (right click the app in Robot applications -> copy Application ID) and the name of the behaviour (defaults to behavior_1). Example 'danceApp/behavior_1'
# in a python box
def __init__(self):
# ...
self.life = ALProxy("ALAutonomousLife")
def onInput_onStart(self):
# 1 means return to this app when the new app is closed
self.life.switchFocus('activityName', 1)
If you don't just want to switch to the app, for example if you want to edit it, or run it while doing something else, you can copy for .xar files from the robot to Choregraphe like so.
scp -r nao@<nao-ip>:/home/nao/.local/PackageManager/apps/app-id <path-to-copy-to>