Scripting with s.o.a.r.:
1 go forward
2 go backward
3 turn left
4 turn right
5 say a word
6 listen for a response
7 take a picture
Some of these commands would be done on the android phone and some would be done with the robot and it's microcontroller.
With allowing responses to be part of offline script, the robot can be programmed to respond to things autonomously.
Command: "spin in circle"
Response audio: "hello" - say "friendly" say "huh?"
"Spin in circle"
Response audio: null- say "not" say "friendly"
These types of things can be ant to be stored on the robot. They can also be stored in a google spreadsheet or other server based storage to be retrieved by others for sharing purposes. In this way a library of behaviors could be created.
The android phone will need a command interpreter. Commands are received from the google script/ spreadsheet (at first this would probably be via polling the google spreadsheet). This architecture could be changed to interact in a more direct manner in the future but using a googlespreadsheet and googlescript that is polled by the android phone is easy and will allow for it to be easily shared.
The command interpreter:
The commands should come in as "immediate" or "program". This allows the command interpreter to not have to look and update any commands it can just overwrite if it has one of the same name. Possibly a linked list would be a good structure to start with when programming the interpretation of the commands because it allows for chaining the commands together. Some pseudo code for the android command interpreter is:
For programming commands:
//sample command previously received:
string command="program,spin in circle,turn right, turn right, turn right";
//load our existing linked list of commands:
ObjectInputStream oi =newObjectInputStream(newFileInputStream("save.ser"));Object listIn = oi.readObject();
//create linked list from serialized linked list
LinkedList ll = (Linked List) listIn;// add new elements to the linked list
//to do: convert array list into linked list and search through existing list.// If command is the same overwrite existing list otherwise add commands to the list
//the trick is some commands may be existing linked lists and if so we will need to overwrite then
//serialize linked list again:
ObjectOutputStream oo =newObjectOutputStream(newFileOutputStream("save.ser")); oo.writeObject(ll); oo.close();//this is all pseudo code and not complete or working// will spawn many questions I'm sure and I haven't written the actual interpreter that sends commands to arduino or to android routines just idea of serializing and deserializing a linked list with commands badicakky