I am fairly new to coding and new to working with Pepper (2.9.5) and have been struggling to figure out how to make a program for a Pepper robot where Pepper will execute some speech and an animation when it detects the presence of a person and to do this whenever it detects a new person.
At the moment I only know how to make the speech and animation trigger when the app is launched.
I am on a different pc at the moment and don’t have the exact code but essentially what I have at the moment is:
` @Override
public void onRobotFocusGained(QiContext qiContext) {
// The robot focus is gained.
Say say = SayBuilder.with(qiContext)
.withText("Say a thing")
.build();
Animation Do_a_thing = AnimationBuilder.with(qiContext);
.withResources(R.raw.animation)
.build();
Animate Doing_a_thing = AnimateBuilder.with(qiContext);
.withanimation(Do_a_thing);
.build();
say.run();
Doing_a_thing.run();
}`
I basically want it to run this when a person is detected and otherwise look around, or if it’s easier, to trigger this sequence after set time periods. What I would like to achieve is:
- App is launched and Pepper waits to detect someone.
- Person detected.
- Sequence triggered.
- Person leaves.
- Pepper returns to waiting for someone to approach.
I’m guessing I can somehow call the running of the sequence within something that detects the presence of people but having read some of the QiSDK guidance/tutorials available I don’t really understand how this is done.
Any help would be appreaciated on this matter.
Thanks
FDog369 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.