Currently developping on a Pepper robot (Android dev), I'm trying to use some "basic" animations (from QiSQK lib). For instance, when calling a WS, I'm starting a "think" animation using animation/animate. Then, when the WS call ends, I try to use another animation ("showing the tablet").
I saw that Pepper can't animate twice if the previous animation isn't finished/cancelled.
So, I used requestCancellation()
, but it didn't stop the animation.
I also used cancel(mayInterruptIfRunning)
, didn't stop either.
So, I can't chain 2 animations without waiting the previous animation to stop (my WS call = 3-4s max).
Any idea ?
Example :
private var animate: Future<Animate>? = null
fun animate(animRes: Int) {
animate?.requestCancellation()
AnimationBuilder
.with(qiContext)
.withResources(animRes)
.buildAsync()
.thenConsume { futureAnimation ->
animate = AnimateBuilder
.with(qiContext)
.withAnimation(futureAnimation?.value)
.buildAsync()
animate?.andThenConsume {
it.async().run()
}
}
}
Thx, Bastien.