Open d16310 opened 4 years ago
Hello !
You might do something like this:
say(qiContext, "Please place a 4x4 Aruco Marker on the floor in front of me.").andThenCompose {
Log.d(TAG, "STATE: hold basic awareness")
holder = holdAutonomousAbilities(qiContext, AutonomousAbilitiesType.BASIC_AWARENESS)
holder
}.andThenCompose {
Log.d(TAG, "STATE: detect marker")
displayLine("Detection started", ConversationItemType.INFO_LOG)
waitToDetectAMarkerInFront(qiContext)
}.andThenCompose { marker ->
arucoMarker = marker
displayLine("Detection stopped", ConversationItemType.INFO_LOG)
say(qiContext,"I see marker ${marker.id}, this marker will represent my home position.")
when (marker.id) {
10 -> { say("Hello") }
11 -> {
// ....
}
else -> {
}
}
} // Remove all the code that was here
If you have a hard time understanding the .andThenCompose
syntax, you can read the documentation which is available here: https://developer.softbankrobotics.com/pepper-qisdk/principles/chaining-operations
Hope it helps
Hello
I always use it for the development of pepper. I have one question this time
I want the ”EngageAndReturnToMarkerActivity” program to determine the id and change the behavior depending on the id. What should I do? For example, after reading "id10", move to "id10" and search 1 meter ahead again. For example, if you read "id11", say "Hello".
I generally understand "waitToDetectAMarkerInFront" and "goToFrame" Please tell me how to add "marker.id" to the conditional statement (if).
I'm sorry if it's hard to understand the meaning. There may be a mistake because it was translated by google translate.
Thank you as always. Please be careful about "COVID-19" and do your best in research and development.