-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInMoov.py
76 lines (63 loc) · 3.47 KB
/
InMoov.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
## ___ ________ _____ ______ ________ ________ ___ ___
## |\ \|\ ___ \|\ _ \ _ \|\ __ \|\ __ \|\ \ / /|
## \ \ \ \ \\ \ \ \ \\\__\ \ \ \ \|\ \ \ \|\ \ \ \ / / /
## \ \ \ \ \\ \ \ \ \\|__| \ \ \ \\\ \ \ \\\ \ \ \/ / /
## \ \ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ \ \\\ \ \ / /
## \ \__\ \__\\ \__\ \__\ \ \__\ \_______\ \_______\ \__/ /
## \|__|\|__| \|__|\|__| \|__|\|_______|\|_______|\|__|/
version='1.0.0'
# this will run with versions of MRL above :
mrlCompatible='2685'
# ###################################################################################
# This is the full configurable launcher script for Inmoov service :
# MORE informations here : http://myrobotlab.org/service/InMoov
# At this time configurable things are inside the config folder.
# By default virtual environment is started, so you can test things with no risk !
#
# To start using the Finger Starter with real hardware, set :
# ( The Finger Starter is considered here to be right index,
# so make sure your servo is connected to pin3 of you Arduino )
##
# ScriptType=RightSide | inside config/_InMoov.config
# MyRightPort=COMx | inside config/_service_6_Arduino.config
# isRightHandActivated=True | inside config/skeleton_rightHand.config
# voice command sample : OPEN HAND
##
# Check your configuration inside Inmoov.config
# Change voice and speech engine inside mouth.config
# If you setup 2 arduino + configs in skeleton folder, it can run full Inmoov or separated parts ( right hand / head ... )
# ###################################################################################
##############
# Main inmoov service
i01 = Runtime.createAndStart("i01", "InMoov")
##############
# robot checkup and initialisation ( skeleton & services )
RuningFolder="InMoov"
execfile(RuningFolder+'/system/InitCheckup.py')
# ###################################################################################
# SAMPLE COMMANDS
#
# WARNING : basic vocal commands ( activated only if chatbot is disable inside config/service_A_Chatbot.config )
#
# Go further ! you can find more basic vocal commands into inmoovVocal/ear.addCommand
# Go further !! you can find more associated functions into inmoovGestures
# Go further !!! you can find almost all chatbot vocal command into chatbot\bots\[lang]\aiml\_inmoovGestures.aiml
# ###################################################################################
ear.addCommand("attach your finger", "i01.rightHand.index", "attach") #to remove soon
ear.addCommand("disconnect your finger", "i01.rightHand.index", "detach")
ear.addCommand("open your finger", "python", "fingeropen")
ear.addCommand("close your finger", "python", "fingerclose")
ear.addCommand("finger to the middle", "python", "fingermiddle")
# functions called by the basic vocal commands engine
def fingeropen():
i01.moveHand("right",0,0,0,0,0)
talkBlocking("ok I open my finger")
def fingerclose():
i01.moveHand("right",180,180,180,180,180)
talkBlocking("my finger is closed")
def fingermiddle():
i01.moveHand("right",90,90,90,90,90)
talkBlocking("ok you have my attention")
##############
#Go further !!!! and write some code lines inside custom/InMoov_custom.py
execfile(RuningFolder+'custom/InMoov_custom.py')