Bonjour à tous,
Sur le petit script (ci-dessous) de Gaël : InMoov3.minimalArm.py qui fonctionne bien je ne trouve pas où on va chercher les infos de position des servos quand les bras sont en avant, à fortiori ceux de la position « da Vinci » qui elle ne fonctionne pas. En fin de script on trouve les positions pour « rest », çà c’est ok!
Dans quel autre fichier de mon dossier MRL va-t-on pêcher ces positions ????
MERCI D’AVANCE
# this will run with versions of MRL above 1695
# a very minimal script for InMoov
# although this script is very short you can still
# do voice control of a right Arm
# It uses WebkitSpeechRecognition, so you need to use Chrome as your default browser for this script to work
# Start the webgui service without starting the browser
webgui = Runtime.create(« WebGui », »WebGui »)
webgui.autoStartBrowser(False)
webgui.startService()
# Then start the browsers and show the WebkitSpeechRecognition service named i01.ear
webgui.startBrowser(« http://localhost:8888/#/service/i01.ear »)
# As an alternative you can use the line below to show all services in the browser. In that case you should comment out all lines above that starts with webgui.
# webgui = Runtime.createAndStart(« webgui », »WebGui »)
leftPort = « COM13 » #modify port according to your board
rightPort = « COM17 » #modify port according to your board
i01 = Runtime.createAndStart(« i01 », « InMoov »)
i01.startEar()
# starting parts
i01.startMouth()
#to tweak the default voice
i01.mouth.setVoice(« Ryan »)
##############
i01.startLeftArm(leftPort)
#tweak defaults LeftArm
#i01.leftArm.bicep.setMinMax(0,90)
#i01.leftArm.rotate.setMinMax(46,160)
#i01.leftArm.shoulder.setMinMax(30,100)
#i01.leftArm.omoplate.setMinMax(10,75)
#################
i01.startRightArm(rightPort)
# tweak default RightArm
#i01.rightArm.bicep.setMinMax(0,90)
#i01.rightArm.rotate.setMinMax(46,160)
#i01.rightArm.shoulder.setMinMax(30,100)
#i01.rightArm.omoplate.setMinMax(10,75)
#################
# verbal commands
ear = i01.ear
ear.addCommand(« attach everything », « i01 », « attach »)
ear.addCommand(« disconnect everything », « i01 », « detach »)
ear.addCommand(« attach left arm », « i01.leftArm », « attach »)
ear.addCommand(« disconnect left arm », « i01.leftArm », « detach »)
ear.addCommand(« attach right arm », « i01.rightArm », « attach »)
ear.addCommand(« disconnect right arm », « i01.rightArm », « detach »)
ear.addCommand(« rest », « python », « rest »)
ear.addCommand(« arms front », i01.getName(), « armsFront »)
ear.addCommand(« da vinci », i01.getName(), « daVinci »)
ear.addCommand(« capture gesture », ear.getName(), « captureGesture »)
ear.addCommand(« manual », ear.getName(), « lockOutAllGrammarExcept », « voice control »)
ear.addCommand(« voice control », ear.getName(), « clearLock »)
# Confirmations and Negations are not supported yet in WebkitSpeechRecognition
# So commands will execute immediatley
ear.addComfirmations(« yes », »correct », »ya », »yeah », « yes please », « yes of course »)
ear.addNegations(« no », »wrong », »nope », »nah », »no thank you », « no thanks »)
ear.startListening()
def rest():
i01.setArmSpeed(« left », 1.0, 1.0, 1.0, 1.0)
i01.setArmSpeed(« right », 1.0, 1.0, 1.0, 1.0)
i01.moveArm(« left »,5,90,30,10)
i01.moveArm(« right »,5,90,30,10)