I have an application to host a webpage that will be the menu of the robot so I need it to be executing all the time unless my other apps are on use. I have tried with trigger condition = 1:
I solved it by using:
Here is the code that I used (it doesn't work here because you need to download some software before):
var session = new QiSession(function(session) {
console.log("Connection esterblished!");
}, function() {
console.log("Could not connect to the robot");
});
function open_app(behavior_name) {
session.service("ALAutonomousLife").then(function(ALAutonomousLife) {
ALAutonomousLife.switchFocus(behavior_name, 1)
}).then(
console.log('Application cannot be switched to')
)
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Question Page</title>
<script src="/libs/qimessaging/2/qimessaging.js"></script>
</head>
<body>
<button class="app-button" onclick="open_app('mynewapp-5d8038/.')">Open app</button>
<!-- "mynewapp-5d8038/." is the direction to the behavior you want to run, not the app-->
</body>
</html>
Hope that someone else finds this info useful.