Skip to content

Commit

Permalink
Cleaning up useful things i dont need:S
Browse files Browse the repository at this point in the history
  • Loading branch information
santilland committed Jun 27, 2017
1 parent 6deefec commit 03eddea
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 287 deletions.
116 changes: 0 additions & 116 deletions Arduino/roomba_ir/roomba_ir.ino

This file was deleted.

30 changes: 10 additions & 20 deletions configuration.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
{
"insteon" : {
"IP" : "192.168.X.X:25105",
"username" : "<your-username>",
"password" : "<your-password>"
},
"hue" : {
"IP" : "192.168.X.X:80",
"username" : "<your-username>"
},
"hue":{
"IP" : "192.168.X.X:80",
"username" : "<your-username>"
},
"devices" : {
"hue" : {
"kitchenlight" : {
"deviceID" : "3"
}
},
"insteon" : {
"bedroomlight" : {
"deviceID" : "21FA84"
}
}
}
"hue" : {
"kitchenlight" : {
"deviceID" : "3"
}
},
}
}
14 changes: 6 additions & 8 deletions corpus.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
turn on the kitchen light
turn off the kitchen light
turn on the bedroom light
turn off the bedroom light
turn on the roomba
turn off the roomba
roomba clean
roomba go home
turn kitchen on
turn kitchen off
turn sofa on
turn sofa off
turn table on
turn table off
10 changes: 2 additions & 8 deletions dictionary.dic
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
BEDROOM B EH D R UW M
CLEAN K L IY N
GO G OW
HOME HH OW M
KITCHEN K IH CH AH N
LIGHT L AY T
OFF AO F
ON AA N
ON(2) AO N
ROOMBA R UW M B AH
THE DH AH
THE(2) DH IY
SOFA S OW F AH
TABLE T EY B AH L
TURN T ER N
14 changes: 6 additions & 8 deletions grammar.jsgf
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#JSGF V1.0;
grammar commands;

<action> = TURN ON |
TURN OFF ;
<action> = ON |
OFF ;

<object> = KITCHEN LIGHT|
BEDROOM LIGHT |
ROOMBA ;
<object> = KITCHEN |
SOFA |
TABLE ;

public <command> = <action> THE <object> |
ROOMBA CLEAN |
ROOMBA GO HOME ;
public <command> = <object> <action>;
95 changes: 40 additions & 55 deletions language_model.lm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Language model created by QuickLM on Fri Feb 13 02:00:22 EST 2015
Language model created by QuickLM on Tue Jun 27 08:18:33 EDT 2017
Copyright (c) 1996-2010 Carnegie Mellon University and Alexander I. Rudnicky

The model is in standard ARPA format, designed by Doug Paul while he was at MITRE.
Expand All @@ -7,67 +7,52 @@ The code that was used to produce this language model is available in Open Sourc
Please visit http://www.speech.cs.cmu.edu/tools/ for more information

The (fixed) discount mass is 0.5. The backoffs are computed using the ratio method.
This model based on a corpus of 7 sentences and 13 words
This model based on a corpus of 6 sentences and 8 words

\data\
ngram 1=13
ngram 2=18
ngram 3=19
ngram 1=8
ngram 2=12
ngram 3=15

\1-grams:
-1.0894 </s> -0.3010
-1.0894 <s> -0.2586
-1.6335 BEDROOM -0.2803
-1.9345 CLEAN -0.2642
-1.9345 GO -0.2960
-1.9345 HOME -0.2642
-1.6335 KITCHEN -0.2803
-1.3324 LIGHT -0.2642
-1.6335 OFF -0.2750
-1.4574 ON -0.2750
-1.4574 ROOMBA -0.2530
-1.2355 THE -0.2642
-1.2355 TURN -0.2750
-1.0000 </s> -0.3010
-1.0000 <s> -0.2553
-1.4771 KITCHEN -0.2553
-1.3010 OFF -0.2553
-1.3010 ON -0.2553
-1.4771 SOFA -0.2553
-1.4771 TABLE -0.2553
-1.0000 TURN -0.2553

\2-grams:
-0.8451 <s> ROOMBA -0.1249
-0.4472 <s> TURN 0.0000
-0.3010 BEDROOM LIGHT 0.0000
-0.3010 CLEAN </s> -0.3010
-0.3010 GO HOME 0.0000
-0.3010 HOME </s> -0.3010
-0.3010 KITCHEN LIGHT 0.0000
-0.3010 LIGHT </s> -0.3010
-0.3010 OFF THE -0.0792
-0.3010 ON THE 0.0000
-0.7782 ROOMBA </s> -0.3010
-0.7782 ROOMBA CLEAN 0.0000
-0.7782 ROOMBA GO 0.0000
-0.6990 THE BEDROOM 0.0000
-0.6990 THE KITCHEN 0.0000
-1.0000 THE ROOMBA -0.2218
-0.6990 TURN OFF 0.0000
-0.5229 TURN ON 0.0000
-0.3010 <s> TURN 0.0000
-0.6021 KITCHEN OFF 0.0000
-0.6021 KITCHEN ON 0.0000
-0.3010 OFF </s> -0.3010
-0.3010 ON </s> -0.3010
-0.6021 SOFA OFF 0.0000
-0.6021 SOFA ON 0.0000
-0.6021 TABLE OFF 0.0000
-0.6021 TABLE ON 0.0000
-0.7782 TURN KITCHEN 0.0000
-0.7782 TURN SOFA 0.0000
-0.7782 TURN TABLE 0.0000

\3-grams:
-0.6021 <s> ROOMBA CLEAN
-0.6021 <s> ROOMBA GO
-0.6990 <s> TURN OFF
-0.5229 <s> TURN ON
-0.3010 BEDROOM LIGHT </s>
-0.3010 GO HOME </s>
-0.3010 KITCHEN LIGHT </s>
-0.6021 OFF THE BEDROOM
-0.6021 OFF THE KITCHEN
-0.7782 ON THE BEDROOM
-0.7782 ON THE KITCHEN
-0.7782 ON THE ROOMBA
-0.3010 ROOMBA CLEAN </s>
-0.3010 ROOMBA GO HOME
-0.3010 THE BEDROOM LIGHT
-0.3010 THE KITCHEN LIGHT
-0.3010 THE ROOMBA </s>
-0.3010 TURN OFF THE
-0.3010 TURN ON THE
-0.7782 <s> TURN KITCHEN
-0.7782 <s> TURN SOFA
-0.7782 <s> TURN TABLE
-0.3010 KITCHEN OFF </s>
-0.3010 KITCHEN ON </s>
-0.3010 SOFA OFF </s>
-0.3010 SOFA ON </s>
-0.3010 TABLE OFF </s>
-0.3010 TABLE ON </s>
-0.6021 TURN KITCHEN OFF
-0.6021 TURN KITCHEN ON
-0.6021 TURN SOFA OFF
-0.6021 TURN SOFA ON
-0.6021 TURN TABLE OFF
-0.6021 TURN TABLE ON

\end\
19 changes: 3 additions & 16 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
from hue import Hue
from insteon import Insteon

# The following file is imported so that we can send commands to our Arduino which will then be translated into
# IR control commands to be sent to the Roomba
from roomba import Roomba

# This import will give us our wrapper for the Pocketsphinx library which we can use to get the voice commands from the
# user.
Expand All @@ -41,7 +38,6 @@ def runMain():
insteon = Insteon()
hue = Hue()

roomba = Roomba()

# Now we set up the voice recognition using Pocketsphinx from CMU Sphinx.
pocketSphinxListener = PocketSphinxListener()
Expand All @@ -50,25 +46,16 @@ def runMain():
while True:
try:
command = pocketSphinxListener.getCommand().lower()
command = command.replace('the', '')


if command.startswith('turn'):
onOrOff = command.split()[1]
deviceName = ''.join(command.split()[2:])
onOrOff = command.split()[2]
deviceName = command.split()[1]
if deviceName in hueDevices:
deviceId = hueDevices[deviceName]['deviceID']
hue.turn(deviceId=deviceId, onOrOff=onOrOff)
if deviceName in insteonDevices:
deviceId = insteonDevices[deviceName]['deviceID']
insteon.turn(deviceId=deviceId, onOrOff=onOrOff)
if deviceName == 'roomba':
roomba.turn(onOrOff)
elif command.startswith('roomba'):
action = ' '.join(command.split()[1:])
if action == 'clean':
roomba.clean()
if action == 'go home':
roomba.goHome()

# This will allow us to be good cooperators and sleep for a second.
# This will give the other greenlets which we have created for talking
Expand Down
Loading

0 comments on commit 03eddea

Please sign in to comment.