PDA

View Full Version : RSS Robo Chimp Bot



defwheezer
04-10-2010, 10:45 AM
Hacking an animatronic chimp into the Internet via a Serializer interface, some C# code provides a platform for deploying a Pluri Media Group news anchor on par or exceeding commercial broadcast any mere human. The robochimp is fed using an array of RSS feeds with various robot related tags. Mouth movements (using a std servo) synced to text stream using a word parse/length sub. Eye lid movement controlled via original DC motors/potentiometers using H-bridge on the Serialier board.

YouTube- Chimp Autonomous Announcer

zoomkat
04-10-2010, 11:30 AM
You sure this thing isn't just controlled via a hacked "clapper" such that random movements are made when audio is detected in the room? :wink:

defwheezer
04-14-2010, 06:25 PM
You sure this thing isn't just controlled via a hacked "clapper" such that random movements are made when audio is detected in the room? :wink:

No, but thanks anyways. :sad:

It uses code to parse each RSS feed item into a sentence, then each word legth is used to drive the jaw servo duration as follows:
(C# code)

for (int j = 0; j < (arraysize); j++) //array size = # words in sentence
{

int int_moveStep = 2;
pin0.State = true; //LED on
for (int i = -60; i < -30; i++)
{

Servo5Position.Value = i;
Servo5Position.Text = Servo5Position.Value.ToString();
servo5.Position = Servo5Position.Value;
i = i + int_moveStep;
int sleep_time = (word_length_array[j] * 4) + 10;
Thread.Sleep(sleep_time);

}
for (int i = -30; i > -55; i--)
{
Servo5Position.Value = i;
Servo5Position.Text = Servo5Position.Value.ToString();
servo5.Position = Servo5Position.Value;
i = i - int_moveStep;
int sleep_time = (word_length_array[j] * 4) + 10;
pin0.State = false; //LED off
Thread.Sleep(sleep_time);
}

}

kamondelious
04-15-2010, 10:15 AM
Hi defwheezer,

Conceptually, I love this project.

I think your mouth movements could use some work though. Have you considered opening and closing the mouth per syllable? Maybe, depending on the length of the word, you close the mouth 70-80% on the syllable.

I know there are loaeds of free/opensource dictionaries out there, but I'm far too tired just now to go dig something up that you can use in C#. Some googling or blinging might help you out more there.

I hope to see this entertaining work refined in the near future.

Good luck!

defwheezer
04-15-2010, 11:03 AM
Yes indeed- parsing each word for syllables and then using that to modulate jaw servo travel/speed is what I'm currently trying to implement to get more realistic mouth-word synchronization, using word length was a quick code fix just to get a POC of the RSS reading bot:

//C# code

private int SyllableCount(string word)
{
word = word.ToLower().Trim();
string pattern = "[aeiouy]+";
int count = System.Text.RegularExpressions.Regex.Matches(word, pattern).Count;
if (word.EndsWith("e"))
{
//check for wording ending with vowel,consonant,e
if (System.Text.RegularExpressions.Regex.IsMatch(word , "[aeiouy][^aeiouy]e$"))
{
count -= 1;
}
}
if (count < 1)
{
count = 1;
}
return count;
}

zoomkat
04-16-2010, 11:57 AM
No, but thanks anyways. :sad:

I didn't mean to slam all the coding, it is just that the servo movement of the mouth doesn't mimic the level of detail of the audio speech being heard. Probably difficult to do with a single servo. Craig Ferguson now has a very similar animatronic side kick on his show (after letterman).

defwheezer
04-16-2010, 04:29 PM
"the servo movement of the mouth doesn't mimic the level of detail of the audio speech being heard"

Yeh, that has turned out to be a lot harder than I expected coding wise- especially since I know practically Jack about coding in visual C#; trying currently to use the Viseme (Visemes are nothing but images with expression) bit for firing various mouth movement servo actions (instead of calling bitmaps of facial expressions).

I believe the 'Letterman' (http://www.imdb.com/video/cbs/vi927073305/) bot is actually controlled off screen using a joystick (CHEATERz!!!) based on the video by the maker (the robot dude from Mythbusters).

defwheezer
04-26-2010, 05:20 PM
Updated Chimp with realistic mouth movements!

http://forums.trossenrobotics.com/showthread.php?t=4070