I'm trying to make pepper robot to listen to basic voice commands. The trouble is that the language is not supported and I have to use google speech to text for this instead of robot's default recognition libraries. It would be more convenient to test this with emulator rather than installing each time on the real robot. But I can't find any information about how to simulate a person appearing in front of robot in the emulator. If that's impossible, maybe there are some workarounds?
override fun onRobotFocusGained(qiContext: QiContext) {
this.qiContext = qiContext
Utils.defaultHolderBuilder(qiContext).build().async()?.release()
qiContext.humanAwareness?.addOnHumansAroundChangedListener { humansAround ->
if (humansAround.isNotEmpty()) {
listenToHuman(qiContext, humansAround)
}
}
}
Perhaps I can do with just calling that function, supplied to addOnUpdatedListener
, but how should I call it? Maybe simulate some test broadcast from within a program?
The listenToHuman function:
private fun listenToHuman(qiContext: QiContext, humansAround: MutableList<Human>) {
val actuation: Actuation = qiContext.actuation
val robotFrame: Frame = actuation.robotFrame()
val closestHuman = ...get closest human
closestHuman?.headFrame?.addOnUpdatedListener {
val distance: Double = ...computeDistance
if (availableForListening) {
availableForListening = false
Qi.onUiThread {
mLastResultTextView.text = "Listening"
mSpeechRecognizer.startListening(speechIntent)
}
}
}
}