Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About id determination of Aruco mark #2

Open
d16310 opened this issue Nov 1, 2020 · 1 comment
Open

About id determination of Aruco mark #2

d16310 opened this issue Nov 1, 2020 · 1 comment

Comments

@d16310
Copy link

d16310 commented Nov 1, 2020

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.

@rhumbert
Copy link
Member

rhumbert commented Dec 11, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants