Here's what I would like my InMoov to do when it powers up after automatically powering down after 120 seconds of inactivity;

Move to a gesture,

Speak a text ,

Scan for humans (face detect)

Lock on to a face and track it;

I've tried a few different things to get this to work but no luck.

Any help would be appreiciated.

Video Link - https://onedrive.live.com/?id=63E242BD53401647%21133&cid=63e242bd53401647&authkey=%21Ao70h-M5o13hZxI&v=3 

 

 

mehtaatur

10 years 5 months ago

 

 

Alessandruino

10 years 5 months ago

This should do the job :

 

 
def input():
    print 'python object is ', msg_clock_pulse
    pin = msg_i01_right_publishPin.data[0]
    print 'pin data is ', pin.pin, pin.value
    if (pin.value == 1):
         i01.powerUp()
         #put here the name of the gesture
         nameofthegestureyouwant()
         #wait for the gesture
         sleep(5)
         i01.mouth.speakBlocking("i am speaking")
         #scan for faces and track a face whene he found one
         i01.headTracking.findFace()
 

GroG

10 years 5 months ago

Alessandruino Python-Fu is very strong...

My guess is that it will probably work ..   I would be interested to know if it does (please use the latest MRL always - you can check for updates in runtime->System->check for updates)

But if it was me - I would want a better interface ...  

This is what I mean ..   def powerUp "should" be called by InMoov so that you should just need to provide that method in Python to do what you want...

The code would simply be :

def powerUp()

       ....  do the things you want here ....

there should probably be similar ones to, where some event in the InMoov service tries to call a pre defined method in Python .. kind of like a "user function hook"

Typicall canidates would be ..

powerUp, powerDown, personFound, somethingHeard, error, others ???

The InMoov service would have "default" activites for these things, but all of them could be replaced if a users Python functions with matching names were found.

What do you think?

bhouston

10 years 5 months ago

So here is what it is doing;
After the PIR is activated, it speaks,"hey, who goes there? I was sleeping and you woke me up"
Then it powers up and says,"power down after 120 seconds is on.
Then no other actions.
 
I have the following line in after the "#starting parts;
i01.setPowerUpText("hey, who goes there?    I was sleeping and you woke me up")
 
 
Below is what I have in the PIR part,
 
i01.startPIR("COM3",12)
def input():
    print 'python object is ', msg_clock_pulse
    pin = msg_i01_right_publishPin.data[0]
    print 'pin data is ', pin.pin, pin.value
    if (pin.value == 1):
         i01.powerUp()
         #put here the name of the gesture
         powerup()
         #wait for the gesture
         sleep(5)
         i01.mouth.speakBlocking("i am speaking")
         #scan for faces and track a face whene he found one
         i01.headTracking.findFace()
 
This is the action I want.
def powerup():
        
        i01.mouth.speak("hey, who is that?")
        lookaroundabit()
        rest()
        ear.clearLock()
        
        ear.resumeListening()

 

bhouston

10 years 5 months ago

It doesn't seem to matter what you put in after;

if ( pin.value == 1):

It always does the same thing!!!