modding the inmoov service

I’ve been modifying the inmoov service in my robot lab to make it a bit easier to get my inmoov robot up and running as i haven’t followed the norm and gone with using 4 arduino’s instead of the 2. so needed a way to set the pins for the servos

I will looking at getting the service updated with these changes to help everyone else out.
You can download the modified file.

inmoov service



# a basic script for starting the InMoov service
# and attaching the right hand
# an Arduino is required, additionally a computer
# with a microphone and speakers is needed for voice
# control and speech synthesis

# ADD SECOND STAGE CONFIRMATION
# instead of saying: you said... it would say: did you say...? and I would confirm with yes or give the voice command again
# face tracking in InMoov ... activated by voice ...

inMoov = Runtime.createAndStart("inMoov", "InMoov")

#rightSerialPort = "COM8"
#leftSerialPort = "COM7"

leftHandComPort = "COM34"
rightHandComPort = "COM35"
headComPort = "COM16"
bodyComPort = "COM22"
cameraIndex = 0

# attach an arduinos to InMoov
# possible board types include uno atmega168 atmega328p atmega2560 atmega1280 atmega32u4
# the MRLComm.ino sketch must be loaded into the Arduino for MyRobotLab control

inMoov.attachArduino("body","atmega1280",bodyComPort)

inMoov.attachArduino("right","atmega328p",rightHandComPort)
#-- attach left hand and set servo pins thumb , index , majeure , ringFinger , pinky and wrist
#-- or can be attached using default pins by inMoov.attachHand("right")
inMoov.attachHand("right",3,5,6,9,10,11)
# -- attach right arm to arduinobody set pin bicep , rotate ,shoulder and omplate
# -- this also can be set to right arduino by inMoov.attachArm("right",3,4,5,6)
# -- and can be done by inMoov.attachArm("right") with all the defaults
inMoov.attachArm("right","body",3,4,5,6)
##------------------------------------- need to move wrist to arduino body---------------------------
sleep(2)
wristright.detach()
wristright.setInverted(True)
arduinobody.servoAttach("wristright",2)

# ------------ inverte all servos needed
thumbright.setInverted(True)
indexright.setInverted(True)
majeureright.setInverted(True)
ringFingerright.setInverted(True)

# --------- finsh up and publish state -------
wristright.publishState()

##-------------------- attach left side ----------------------------
inMoov.attachArduino("left","atmega328p", leftHandComPort)
#-- attach left hand and set servo pins thumb , index , majeure , ringFinger , pinky and wrist
inMoov.attachHand("left",3,5,6,9,10,11)
# -- attach left arm to arduinobody set pin bicep , rotate ,shoulder and omplate
inMoov.attachArm("left","body",12,11,10,9)

##------------------------------------- need to move wrist to arduino body ---------------------------
sleep(2)
wristleft.detach()
arduinobody.servoAttach("wristleft",13)

# ------------ invert left boby parts
indexleft.setInverted(True)
ringFingerleft.setInverted(True)
# --------- all right hand fingers have been moved -------
wristleft.publishState()
##-------------------- all done
inMoov.attachArduino("head","atmega328p",headComPort)
## attach to arduino head and set pins for eye x , eye y , neck and rotHead
#-- note that eye x and eye y are not in use at the moment.
inMoov.attachHead("head",3,5,11,6)

# set voice to male
mouth.setGoogleProxy("jarvis","91.243.165.49",8080)
# system check
inMoov.systemCheck()
inMoov.rest()
inMoov.setCameraIndex(cameraIndex)

# new process for verbal commands
ear = inMoov.getEar()
ear.addCommand("rest", inMoov.getName(), "rest")
ear.addCommand("open hand", inMoov.getName(), "handOpen", "both")
ear.addCommand("close hand", inMoov.getName(), "handClose", "both")
ear.addCommand("camera on", inMoov.getName(), "cameraOn")
# ear.addCommand("off camera", inMoov.getName(), "cameraOff") - needs fixing
ear.addCommand("capture gesture", inMoov.getName(), "captureGesture")
ear.addCommand("track", inMoov.getName(), "track")
ear.addCommand("freeze track", inMoov.getName(), "clearTrackingPoints")
ear.addCommand("hello", inMoov.getName(), "hello")
ear.addCommand("giving", inMoov.getName(), "giving")
ear.addCommand("fighter", inMoov.getName(), "fighter")
ear.addCommand("fist hips", inMoov.getName(), "fistHips")
ear.addCommand("look at this", inMoov.getName(), "lookAtThis")
ear.addCommand("victory", inMoov.getName(), "victory")
ear.addCommand("arms up", inMoov.getName(), "armsUp")
ear.addCommand("arms front", inMoov.getName(), "armsFront")
ear.addCommand("da vinci", inMoov.getName(), "daVinci")

ear.addCommand("manual", ear.getName(), "lockOutAllGrammarExcept", "voice control")
ear.addCommand("voice control", ear.getName(), "clearLock")
ear.addCommand("stop listening", ear.getName(), "stopListening")

ear.addCommand("ok", "python", "ok")

ear.addComfirmations("yes","correct","yeah","ya")
ear.addNegations("no","wrong","nope","nah")

ear.startListening()

def ok():
inMoov.setHandSpeed("left", 0.30, 0.30, 1.0, 1.0, 1.0, 1.0)
inMoov.setHandSpeed("right", 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
inMoov.setArmSpeed("left", 0.75, 0.75, 0.75, 0.95)
inMoov.setArmSpeed("right", 1.0, 1.0, 1.0, 1.0)
inMoov.setHeadSpeed(0.65, 0.75)
inMoov.moveHead(88,79)
inMoov.moveArm("left",89,75,93,11)
inMoov.moveArm("right",0,91,0,17)
inMoov.moveHand("left",126,7,158,140,148,0)
inMoov.moveHand("right",100,128,134,154,166,0)

Inmoov Mouth moving

iv been working on getting the mouth on my inmoov robot to move, i had to work out how to program python to do it so my first script you can see working in the video.

the code is :



from time import sleep
from org.myrobotlab.service import Arduino
from org.myrobotlab.service import Speech
from org.myrobotlab.service import Runtime

def talk (sent): # this is the bit that makes the mouth move up and down 
  speech.speak(sent)
  ison = False
  a = sent.split()
  for word in a:
    if word[len(word)-2:] == "es" : # removing es at the end of the word
      testword = word[:-2] +'xx' # adding x's to help keep the timing
    elif word[len(word)-1:] == "e" : # removing the silant e at the end of the word
      testword = word[:-1] +'x'
    else:
      testword = word
        
    for x in range(0, len(testword)):
    
      if testword[x] in ('a', 'e', 'i', 'o', 'u', 'y' ) and ison == False :
        #arduino.digitalWrite(13, Arduino.HIGH)
        mouth.moveTo(6) # move the servo to the open spot
        ison = True
        sleep(0.15)
        mouth.moveTo(20) # close the servo 
      elif testword[x] in ('.') :
        #arduino.digitalWrite(13, Arduino.LOW)
        
        ison = False
        sleep(.95)
      else: #sleep(0.5)  sleep half a second
        #arduino.digitalWrite(13, Arduino.LOW)
        
        ison = False
        sleep(0.06) # sleep half a second
  
    #arduino.digitalWrite(13, Arduino.LOW)
    
    sleep(0.08)
# end of talk function

  

# create an Arduino service named arduino
arduino = runtime.createAndStart("arduino","Arduino")
speech = Runtime.create("speech","Speech")
runtime.createAndStart("mouth","Servo")
speech.startService()

if arduino.isConnected() == False :
  
# set the board type
  arduino.setBoard("atmega328") # atmega168 | mega2560 | etc
# set serial device
  arduino.setSerialDevice("COM16",57600,8,1,0)
sleep(1) # give it a second for the serial device to get ready
arduino.servoAttach("mouth",9)
# update the gui with configuration changes
arduino.publishState()
mouth.publishState()
# set the pinMode of pin 13 to output
arduino.pinMode(13, Arduino.OUTPUT)
#words = 
# Speak with initial defaults - Google en
sleep(5)

talk ("Hello. i am inmoov")
sleep (2)
talk ("this is a test to see if my mouth moves correctly")
sleep (2)
talk ("j-hack has made as script to make me talk.")
sleep (2)
talk ("its not perfect but it will do for now")
sleep (2)
talk ("i think it would be nice if i had a mans voice")
sleep (2)
talk ("thank you for  watching")
sleep (2)
talk ("till next time. bye")

# disconnect the arduino
arduino.disconnect()

Inmoov finger sensor is here!!!

Hi all

I thought it was time to release this to the world, after countless failures and bad prints I have a working design, as it’s the first design I believe  there will be modifications to it by me and others. I welcome all mods and only hope you will post them up for everyone to see.

This was design for the left arm and has not been tested/ design for the right however simply mirroring base and cover should get it to fit.

sadly there has to be modification done to arm to get everything to fit in the following photos highlights were some plastic needs to be removed. i had to cut a bit out for wired to pass under the servo base this isn’t shown on the photo but its only needed if you wire this up the same way.

IMG_1125_mark

IMG_1115_mark

 

Once the plactic has been removed, i added an arduino mini pro (Atmega328 5v) you can see in the photo, the arduino only has 6 pwm outputs so i have wired  the rist to come from the arduino controling the arm (yet to be added),IMG_1116 the next photo shows the extreme amount of wires in the arm some how they all fit, the small yellow wires are the sensor wires(ill go into  IMG_1118more detail on how to wire them in my next post)

 

 

 

servo bracket installed.

 

 

IMG_1117 IMG_1119

 

the servo pulleys i used are from http://www.thingiverse.com/thing:68551 one of my designs the size I used is 22mm as this just rubs together on the back two servos, i need to sorten the screw as show here.

 

 

 

 

 

 

 

IMG_1124

this is the servo bracket read for use with the tendons guides glued on.

 

video of it working.http://youtu.be/50necbOJpME

Trial and Error

taking the path of trial and error isn’t a bad thing however im my case i seem to go though lots of parts and time this is just some of the prototyping i keeped trying to design a finger sensor for the Inmoov robot.

IMG_1109[1]

Inmoov sensor v2

I’ve been working on the finger sensor for some time an version one was getting to fragile at the tips and I didn’t want to upset the design of the hand to much as Gael has done a fantastic  job with the design. so when Gael released “Simple Servo Bed for InMoov”  it gave me an idea to attempted to add the sensors inside the arm.  I designed a spring loaded servo mount that still incorporates  Hall Effect sensors and Rare Earth Neodymium  Magnets.

Inmoov finger sensor v1

Hi

I’m building a inmoov robot (http://inmoov.blogspot.fr/) and trying to build a sensor for the fingers this is my first a temped at it, and my first blog so here I go.
I looking at using a cheap sensor as there will need to be ten of them, so the A1302 Ratiometric Hall Effect sensor seems like a good start found here  and needed some magnets to go with 2mm x 1mm Super Strong Disc Rare Earth Neodymium  Magnets found here and an o-ringinmoov finger sensor apart , I had laying around.

the idea behind the parts is the hall sensor needs a magnet to move to or away from it, with no magnet near the sensor its output voltage is 2.5v and when a magnet move closer to it, the voltage will move up or down depending if it’s the north or south pole . the o-ring is used as a spring to resist the movement of the finger tip.

 

inmoov finger sensori made a video showing the movment of the voltage to the finger at the moment the o-ring seems too hard and needs to be replaced with a  softer rubber.

the movment in the voltage is about 0.4v I’m hoping this will be ok, will need to do more testing.