i am trying to get InMoov2.full.py working on 1.0.26

Markus

10 years 4 months ago

#file : InMoov2.full.py
# this script is provided as a basic guide
# most parts can be run by uncommenting them
# InMoov now can be started in modular pieces
 
leftPort = "COM3"
rightPort = "COM4"
 
i01 = Runtime.createAndStart("i01", "InMoov")
 
# starts everything
i01.startAll(leftPort, rightPort)
 
# how to invert the left hand fingers begin
# i01.leftHand.thumb.setInverted(True)
# i01.leftHand.index.setInverted(True)
# i01.leftHand.majeure.setInverted(True)
# i01.leftHand.ringFinger.setInverted(True)
# i01.leftHand.pinky.setInverted(True)
# how to invert the left hand fingers end
 
i01.leftArm.shoulder.setInverted(True)
i01.rightArm.shoulder.setInverted(True)
i01.leftArm.omoplate.setInverted(True)
i01.rightArm.omoplate.setInverted(True)
i01.leftArm.rotate.setInverted(True)
 
# starting parts
#i01.startMouth()
#i01.startLeftHand(leftPort)
#i01.startLeftArm(leftPort)
#i01.startHead(leftPort)
#starting part with a reference, with a reference
# you can interact further
#opencv = i01.startOpenCV()
#opencv.startCapture()
# or you can use i01's reference
#i01.opencv.startCapture()
 
# after a start you may call detach to detach all
# currently attached servos
#i01.detach()
#i01.attach()
 
i01.systemCheck()
 
# auto detaches any attached servos after 120 seconds of inactivity
# i01.autoPowerDownOnInactivity()
 
# purges any "auto" methods
#i01.purgeAllTasks()
 
# remote control services
# WebGUI - for more information see
 
# XMPP - for more information see
 
# system check - called at anytime
#i01.systemCheck()
 
# take the current position of all attached servos <- FIXME
# and create a new method named "newGesture"
#i01.captureGesture("newGesture")
 
# all ear associations are done python startEar() only starts
# the peer service
# After ear.startListening(), the ear will listen for commands
 
# i01.systemCheck()
 
# verbal commands
ear = i01.ear
 
# commands with i01.getName() use the InMoov service methods
ear.addCommand("attach", i01.getName(), "attach")
ear.addCommand("detach", i01.getName(), "detach")
ear.addCommand("rest", i01.getName(), "rest")
 
ear.addCommand("power down", i01.getName(), "powerDown")
ear.addCommand("power up", i01.getName(), "powerUp")
 
ear.addCommand("open hand", i01.getName(), "handOpen", "both")
ear.addCommand("close hand", i01.getName(), "handClose", "both")
ear.addCommand("camera on", i01.getName(), "cameraOn")
ear.addCommand("off camera", i01.getName(), "cameraOff")
ear.addCommand("capture gesture", i01.getName(), "captureGesture")
 
# FIXME - lk tracking setpoint
ear.addCommand("track", i01.getName(), "track")
ear.addCommand("freeze track", i01.getName(), "clearTrackingPoints")
ear.addCommand("hello", "python", "hello")
ear.addCommand("giving", i01.getName(), "giving")
ear.addCommand("fighter", i01.getName(), "fighter")
ear.addCommand("fist hips", i01.getName(), "fistHips")
ear.addCommand("look at this", i01.getName(), "lookAtThis")
ear.addCommand("victory", i01.getName(), "victory")
ear.addCommand("arms up", i01.getName(), "armsUp")
ear.addCommand("arms front", i01.getName(), "armsFront")
ear.addCommand("da vinci", i01.getName(), "daVinci")
 
ear.addCommand("manual", ear.getName(), "lockOutAllGrammarExcept", "voice control")
ear.addCommand("voice control", ear.getName(), "clearLock")
ear.addCommand("stop listening", ear.getName(), "stopListening")
 
##sets the servos back to full speed, anywhere in sequence or gestures
ear.addCommand("hello robyn", "python", "hellorobyn")
 
 
ear.addComfirmations("yes","correct","ya") 
ear.addNegations("no","wrong","nope","nah")
 
ear.startListening()
 
def hellorobyn():
    mouth.speak("please to meet you")
 
ear.resumeListening()
 

Markus

10 years 4 months ago

Commands that work

ear.addCommand("victory", i01.getName(), "victory")

ear.addCommand("arms front", i01.getName(), "armsFront")

ear.addCommand("giving", i01.getName(), "giving")

Commands that dont work

ear.addCommand("open hand", i01.getName(), "handOpen", "both")

ear.addCommand("close hand", i01.getName(), "handClose", "both")

ear.addCommand("hello robyn", "python", "hellorobyn")

 

Alessandruino

10 years 4 months ago

ear.addCommand("open hand", "python" , "openHand")

def openHand():
 
    i01.leftHand.close()
 
    i01.rightHand.close()

 

bhouston

10 years 4 months ago

Try this for your def.

i01.mouth.speak("please to me you")

 

bhouston

10 years 4 months ago

Alaways check for zommbies before starting up python they will prevent the script from loading properly.

Go into Task Manager/Background Processes and delete any Java binery processes.

For some reason this keeps on coming up everytime I use the script. So everytime I shut it down and then start it up again I check for it and delete it (sometimes there is a couple of them)

Markus

10 years 4 months ago

Robyn says did you say close hand. i say yes robyn say ok but then nothing happens

Markus

10 years 4 months ago

Robyn says did you say close hand. i say yes robyn say ok but then nothing happens

Markus

10 years 4 months ago

Robyn says did you say close hand. i say yes robyn say ok but then nothing happens

Markus

10 years 4 months ago

holy macaroni i figured it out

yes yesyes

when i started python i had to name it python. i wrote pyt