Hi Guy's,
Here a link to the last stable MRL version 1834:
https://www.dropbox.com/s/rylahsmmprtkss1/myrobotlab1834.jar?dl=0
This link will be active, until there is a new stable release.
Regards,
Marten
Hi Guy's,
Here a link to the last stable MRL version 1834:
https://www.dropbox.com/s/rylahsmmprtkss1/myrobotlab1834.jar?dl=0
This link will be active, until there is a new stable release.
Regards,
Marten
This script is having issues
This script is having issues with NaturalReaderSpeech.
It's a full script but you will see how the voice is working through ProgramAB.
from java.lang import String
import threading
import time
import random
from org.myrobotlab.net import BareBonesBrowserLaunch
##
import urllib, urllib2
import json
from datetime import datetime
#######################
import io
import itertools
import textwrap
import codecs
import socket
import os
import shutil
import hashlib
import subprocess
import csv
from subprocess import Popen, PIPE
#############################################################
# This is the InMoov script
# InMoov is powered by MyRobotLab
# Initially we'll start simple
# It will use ProgramAB & Webkit for all interactions with
# the bot.
#############################################################
# All bot specific hardware configuration goes here.
leftPort = "COM20"
rightPort = "COM7"
headPort = leftPort
gesturesPath = "C:\Myrobotlab\ProgramAB bots\gestures"
mp3Path = "C:\Myrobotlab\myrobotlab.1.0.1834/audiofile\MP3/"
aimlPath = "C:\Myrobotlab\myrobotlab.1.0.1834\ProgramAB"
aimlBotName = "inmoovSuper"
aimlUserName = "Gael"
#############################################################
#############################################################
#CounterTraking = 0
#TRACKING= False #True
#servoPin = 8
#MODEVIDEO = 0 # 0= arret 1= traking visage 2= reconnaissance
#USER = "Default"
#############################
# LANGUAGE ( FR/EN )
lang="EN" #for NaturalReaderSpeech
#lang="en_US" #for MarySpeech
Voice="Ryan" # Bruno in French for NaturalReaderSpeech
#Voice="cmu-bdl" #for MarySpeech
#Voice="upmc-pierre-hsmm" #French voice
voiceType = Voice
client_id = "90a98ba0-a028-4b61-9e7a-10a22b186944"
client_secret = "SZDqSTcKxwUMiPEievXKWleXAYMWuD1Tm1D2igskvus"
global human
global inmoov
global weathervar
global walkingThread
MoveHeadRandom=0
MoveBodyRandom=0
#############################################################
# toggle to only load program ab and skip the inmoov services
startInMoov = True
######################################################################
# helper function help debug the recognized text from webkit/sphinx
######################################################################
def heard(data):
print "Speech Recognition Data:"+str(data)
######################################################################
#
# MAIN ENTRY POINT - Start and wire together all the services.
#
######################################################################
# launch the swing gui?
# gui = Runtime.createAndStart("gui", "GUIService");
######################################################################
# Create ProgramAB chat bot ( This is the inmoov "brain" )
######################################################################
#neopixel = Runtime.createAndStart("neopixel","Serial")
#neopixel.connect("COM3", 57600, 8, 1, 0)
inmoovSuper = Runtime.createAndStart("inmoovSuper", "ProgramAB")
# mouth service, speech synthesis
mouth = Runtime.createAndStart("i01.mouth", "NaturalReaderSpeech")
#mouth.setVoice(botVoice)
mouth.setVoice(voiceType)
#Volume(amount=2.0)
#TractScaler(amount=1.4)
#F0Scale(f0Add=2.0)
#F0Add(f0Add=60.0)
#Robot(amount=0.0)
#Rate(amount=3.75)
#Whisper(amount=100.0)
#Stadium(amount=100.0)
#Chorus(delay=1.466;amp1=0.54)
#FIRFilter(type=3;fc1=500.0;fc2=2)
#mouth.setAudioEffects("Volume(amount=1.70) + TractScaler(amount=0.95) + F0Scale(f0Add=3.0)")
mouth.setLanguage(lang)
######################################################################
# the "ear" of the inmoov TODO: replace this with just base inmoov ear?
ear = Runtime.createAndStart("i01.ear", "WebkitSpeechRecognition")
ear.addListener("publishText", python.name, "heard");
ear.addMouth(mouth)
#inmoovSuper.setPath(aimlPath)
inmoovSuper.startSession(aimlUserName, aimlBotName)
######################################################################
# Html filter to clean the output from programab. (just in case)
htmlfilter = Runtime.createAndStart("htmlfilter", "HtmlFilter")
############################
audiofile = Runtime.createAndStart("audiofile", "AudioFile")
######################################################################
WebkitSpeechRecognitionFix = Runtime.start("WebkitSpeechRecognitionFix","Clock")
WebkitSpeechRecognitionFix.setInterval(1000)
WebkitSpeechRecognitionFix.startClock()
######################################################################
# MRL Routing webkitspeechrecognition/ear -> program ab -> htmlfilter -> mouth
######################################################################
ear.addTextListener(inmoovSuper)
inmoovSuper.addTextListener(htmlfilter)
htmlfilter.addTextListener(mouth)
######################################################################
#Gets the battery level
level = Runtime.getBatteryLevel()
######################################################################
# Start up the inmoov and attach stuff.
######################################################################
i01 = Runtime.create("i01", "InMoov")
##############
head = Runtime.create("i01.head","InMoovHead")
##############
# tweaking default settings of jaw
head.jaw.setMinMax(42,101)
head.jaw.map(0,180,42,101)
head.jaw.setRest(42)
# tweaking default settings of eyes
head.eyeY.map(0,180,85,110)
head.eyeY.setMinMax(0,180)
head.eyeY.setRest(90)
head.eyeX.map(0,180,75,120)
head.eyeX.setMinMax(0,180)
head.eyeX.setRest(90)
head.neck.map(0,180,75,128)
head.neck.setMinMax(0,180)
head.neck.setRest(90)
head.rothead.map(0,180,60,130)
head.rothead.setMinMax(0,180)
head.rothead.setRest(90)
##############
torso = Runtime.create("i01.torso", "InMoovTorso")
# tweaking default torso settings
#torso.topStom.setMaxVelocity(13)
torso.topStom.setMinMax(60,120)
torso.topStom.map(0,180,60,120)
#torso.midStom.setMaxVelocity(13)
torso.midStom.setMinMax(0,180)
torso.midStom.map(0,180,50,130)
#torso.lowStom.setMaxVelocity(13)
#torso.lowStom.setMinMax(0,180)
#torso.lowStom.map(0,180,60,120)
torso.topStom.setRest(90)
torso.midStom.setRest(90)
#torso.lowStom.setRest(90)
##############
leftHand = Runtime.create("i01.leftHand","InMoovHand")
# tweaking default settings of left hand
#leftHand.thumb.setMaxVelocity(250)
leftHand.thumb.setMinMax(0,180)
#leftHand.index.setMaxVelocity(250)
leftHand.index.setMinMax(0,180)
#leftHand.majeure.setMaxVelocity(250)
leftHand.majeure.setMinMax(0,180)
#leftHand.ringFinger.setMaxVelocity(250)
leftHand.ringFinger.setMinMax(0,180)
#leftHand.pinky.setMaxVelocity(250)
leftHand.pinky.setMinMax(0,180)
#leftHand.wrist.setMaxVelocity(250)
leftHand.wrist.setMinMax(0,180)
leftHand.thumb.map(0,180,62,150)
leftHand.index.map(0,180,35,135)
leftHand.majeure.map(0,180,35,180)
leftHand.ringFinger.map(0,180,45,150)
leftHand.pinky.map(0,180,50,170)
leftHand.wrist.map(0,180,40,130)
###############
leftArm = Runtime.create("i01.leftArm","InMoovArm")
#tweak defaults LeftArm
#leftArm.bicep.setMaxVelocity(26)
leftArm.bicep.setMinMax(5,95)
leftArm.bicep.map(0,180,45,140)
#leftArm.rotate.setMaxVelocity(18)
leftArm.rotate.setMinMax(40,180)
leftArm.rotate.map(40,180,60,142)
#leftArm.shoulder.setMaxVelocity(14)
leftArm.shoulder.setMinMax(0,180)
leftArm.shoulder.map(0,180,42,150)
#leftArm.omoplate.setMaxVelocity(15)
leftArm.omoplate.setMinMax(10,82)
leftArm.omoplate.map(0,180,36,135)
################
rightHand = Runtime.create("i01.rightHand","InMoovHand")
# tweaking defaults settings of right hand
#rightHand.thumb.setMaxVelocity(250)
rightHand.thumb.setMinMax(0,180)
#rightHand.index.setMaxVelocity(250)
rightHand.index.setMinMax(0,180)
#rightHand.majeure.setMaxVelocity(250)
rightHand.majeure.setMinMax(0,180)
#rightHand.ringFinger.setMaxVelocity(250)
rightHand.ringFinger.setMinMax(0,180)
#rightHand.pinky.setMaxVelocity(250)
rightHand.pinky.setMinMax(0,180)
#rightHand.wrist.setMaxVelocity(250)
rightHand.wrist.setMinMax(0,180)
rightHand.thumb.map(0,180,64,135)
rightHand.index.map(0,180,42,160)
rightHand.majeure.map(0,180,35,165)
rightHand.ringFinger.map(0,180,40,140)
rightHand.pinky.map(0,180,45,130)
rightHand.wrist.map(0,180,30,135)
#################
rightArm = Runtime.create("i01.rightArm","InMoovArm")
# tweak default RightArm
#rightArm.bicep.setMaxVelocity(26)
rightArm.bicep.setMinMax(5,95)
rightArm.bicep.map(0,180,45,140)
#rightArm.rotate.setMaxVelocity(18)
rightArm.rotate.setMinMax(40,180)
rightArm.rotate.map(40,180,75,130)
#rightArm.shoulder.setMaxVelocity(14)
rightArm.shoulder.setMinMax(0,180)
rightArm.shoulder.map(0,180,42,150)
#rightArm.omoplate.setMaxVelocity(15)
rightArm.omoplate.setMinMax(10,82)
rightArm.omoplate.map(0,180,45,135)
#################
i01 = Runtime.start("i01","InMoov")
i01.setMute(False)
#################
if startInMoov:
i01.startAll(leftPort, rightPort)
#i01.startMouth()
#i01.startMouthControl(leftPort)
i01.mouthControl.setmouth(43,95)
#################
#i01.startEyesTracking(leftPort)
#i01.startHeadTracking(leftPort)
#################
#to tweak the default PID values
i01.eyesTracking.pid.setPID("eyeX",12.0,1.0,0.1)
i01.eyesTracking.pid.setPID("eyeY",12.0,1.0,0.1)
i01.headTracking.pid.setPID("rothead",5.0,1.0,0.1)
i01.headTracking.pid.setPID("neck",5.0,1.0,0.1)
#################
#i01.startEar()
#i01.startRightArm(rightPort)
#i01.startRightHand(rightPort,"atmega2560")
#i01.startLeftArm(leftPort)
#i01.startLeftHand(leftPort)
i01.startTorso("COM20")
#################
#i01.startPIR("COM20",30)
else:
i01.mouth = mouth
# InMoov has a forward servo, i'm adding
forwardServo = Runtime.start("forwardServo","Servo")
directionServo = Runtime.start("directionServo","Servo")
rollneck = Runtime.start("rollneck","Servo")
right = Runtime.start("i01.right", "Arduino")
right.connect("COM7")
directionServo.attach(right, 24)
forwardServo.attach(right, 26)
rollneck.attach(right,12)
rollneck.map(0,180,55,135)
rollneck.setRest(90)
rollneck.moveTo(90)
#################
#Sets FaceRecognizer
#fr=i01.opencv.addFilter("FaceRecognizer")
#lastName=fr.getLastRecognizedName()
#################
##Velocity settings
head.eyeX.setVelocity(0)
head.eyeY.setVelocity(0)
head.neck.setVelocity(0)
head.rothead.setVelocity(0)
head.jaw.setVelocity(0)
torso.topStom.setVelocity(0)
torso.midStom.setVelocity(0)
#torso.lowStom.setVelocity(5)
rightHand.thumb.setVelocity(25)
rightHand.index.setVelocity(25)
rightHand.majeure.setVelocity(25)
rightHand.ringFinger.setVelocity(25)
rightHand.pinky.setVelocity(25)
rightHand.wrist.setVelocity(25)
leftHand.thumb.setVelocity(25)
leftHand.index.setVelocity(25)
leftHand.majeure.setVelocity(25)
leftHand.ringFinger.setVelocity(25)
leftHand.pinky.setVelocity(25)
leftHand.wrist.setVelocity(25)
leftArm.bicep.setVelocity(30)
leftArm.rotate.setVelocity(30)
leftArm.shoulder.setVelocity(30)
leftArm.omoplate.setVelocity(30)
rightArm.bicep.setVelocity(30)
rightArm.rotate.setVelocity(30)
rightArm.shoulder.setVelocity(30)
rightArm.omoplate.setVelocity(30)
######################################################################
# Launch the web gui and create the webkit speech recognition gui
# This service works in Google Chrome only with the WebGui
#################################################################
#webgui = Runtime.create("webgui","WebGui")
webgui.autoStartBrowser(False)
webgui.startService()
BareBonesBrowserLaunch.openURL("http://localhost:8888/#service/i01.ear")
######################################################################
# END MAIN SERVICE SETUP SECTION
######################################################################
if lang=="EN":
ear.setLanguage("en-EN")
python.subscribe(ear.getName(),"publishText")
######################################################################
######################################################################
# Helper functions and various gesture definitions
######################################################################
i01.loadGestures(gesturesPath)
#file :
#file : InMoov3.minimalFingerStarter.py
# 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 finger starter
# It uses WebkitSpeechRecognition, so you need to use Chrome as your default browser for this script to work
#The Finger Starter is considered here to be right index,
#so make sure your servo is connected to pin3 of you Arduino
# 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")
# Change to the port that you use
rightPort = "COM7"
i01 = Runtime.createAndStart("i01", "InMoov")
i01.startEar()
# starting parts
i01.startMouth()
#to tweak the default voice
i01.mouth.setVoice("Ryan")
##############
# verbal commands
ear = i01.ear
ear.addCommand("attach finger", "i01.rightHand.index", "attach")
ear.addCommand("disconnect finger", "i01.rightHand.index", "detach")
ear.addCommand("rest", i01.getName(), "rest")
ear.addCommand("open finger", "python", "fingeropen")
ear.addCommand("close finger", "python", "fingerclose")
ear.addCommand("finger to the middle", "python", "fingermiddle")
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","yeah","ya")
ear.addNegations("no","wrong","nope","nah")
ear.startListening()
i01.startRightHand(rightPort)
def fingeropen():
i01.moveHand("right",0,0,0,0,0)
i01.mouth.speak("ok I open my finger")
def fingerclose():
i01.moveHand("right",180,180,180,180,180)
i01.mouth.speak("my finger is closed")
def fingermiddle():
i01.moveHand("right",90,90,90,90,90)
i01.mouth.speak("ok you have my attention")
Hi !from 1834 to later
Hi !
from 1834 to later tested , natural service wont launch : No such filed error : INSTANCE ( error from swing , from python wont launch too )
The INSTANCE error is almost
The INSTANCE error is almost always when you mix Apache HttpClient versions....
delete the file mrl/libraries/jar/httpcore-4.1.jar
Captain GroG is absolutely correct. Turned out that MarySpeech 5.2 upgrade was including the file httpcore-4.1.jar and that was conflicting with another version that we already have.
The ivy.xml has been updated for the mary speech service, a clean install now should not have that problem. (This was an issue with the repo, not with the myrobotlab.jar file.. so a fresh / clean install and it should be worky now because the repo is updated.)