Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
Learning Color Sorter
Some of you might remember the sorter I posted about a year ago (and still never finished explaining... darned procrastination.) I mentioned that my goal had been to make it able to learn where the colors belong as it goes, and a short while later I posted some learning code.
These two projects have accumulated into this sorter, which I call.... Learning Color Sorter. I stink at names.
Unlike my past sorter which did only use one NXT, but also 7 extra motors beyond the three NXT ones, this has only three motors and sensors. Plus a PF light and battery box. This simplification did not, unfortunately, allow me to have it auto-loading. However, as I was stretched for time as I was building this only days before Brickworld, I kept it manual.
This is the part where it scans the brick. The motor with the wheel on it pulls the stack down until a brick breaks the light beam from the PF LED (not visible here), then the motor with the beam on it lowers and stops all but the brick being pulled by the wheel.
The sled is then pulled into position by this motor, and the brick is dropped in. It waits for you to press the red (incorrect) or the green (correct) button if it doesn't know whether it made the right move or not.
switch(SensorValue[ClrSns]) { case BLACKCOLOR: PlaySoundFile("Black.rso"); break; case WHITECOLOR: PlaySoundFile("White.rso"); break; case YELLOWCOLOR: PlaySoundFile("Yellow.rso"); break; case REDCOLOR: PlaySoundFile("Red.rso"); break; case GREENCOLOR: PlaySoundFile("Green.rso"); break; case BLUECOLOR: PlaySoundFile("Blue.rso"); break; }
switch(random[6]) { case 0: PlaySoundFile("Woops.rso"); break; case 1: PlaySoundFile("Sorry.rso"); break; case 3: PlaySoundFile("Crying 02.rso"); break; case 4: PlaySoundFile("Ahnoo.rso"); break; case 5: PlaySoundFile("Buuuhh.rso"); break; } while(bSoundActive); } } } else { motor[ScannerMtr] = 0;
PlaySound(soundException);
eraseDisplay(); nxtDisplayCenteredTextLine(0, "Out of bricks!"); nxtDisplayCenteredTextLine(2, "After reloading,"); nxtDisplayCenteredTextLine(3, "press the green"); nxtDisplayCenteredTextLine(4, "button. If done"); nxtDisplayCenteredTextLine(5, "using, press"); nxtDisplayCenteredTextLine(6, "the red button.");
And, of course, the video. Note about the video, this is my first attempt at making a more professional looking video, so all comments about it are appreciated. I know I'm not gonna be Sariel, but I hope it's at least better than what I've had in the past.
_________________ A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder "Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
Mon Jul 15, 2013 10:25 am
Coder A
Moderator
Joined: Thu Jan 03, 2013 5:10 pm Posts: 207 Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Re: Learning Color Sorter
So, after you have taught the robot where to drop the bricks, if in program you switch the dropboxes around, will it relearn, or will it take some time? In other words, is the learning local(learning mainly over the past few actions) or global(learning over the entire actions, being better for long term learning but terrible for exception management, such as the aforementioned switching of dropboxes)?
_________________ I'm not a robot! I'm british! ~ quote from an asparagus I am not a robot! I am a unicorn! ~ quote from a robot
Thu Aug 22, 2013 6:24 pm
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
Re: Learning Color Sorter
You can switch the boxes, but only in between runs. It has no way to know where the colors go besides your input, and I never added any code to re-learn mid-run.
_________________ A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder "Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
Thu Aug 22, 2013 7:18 pm
Coder A
Moderator
Joined: Thu Jan 03, 2013 5:10 pm Posts: 207 Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Re: Learning Color Sorter
If you make the program only learn and act based on the past 50 actions or so, and add code for trial and error, like an action being correct once but wrong twice, thus making the action perceived as wrong, then the program would be able to relearn mid-run.
_________________ I'm not a robot! I'm british! ~ quote from an asparagus I am not a robot! I am a unicorn! ~ quote from a robot
Thu Aug 22, 2013 7:26 pm
Coder A
Moderator
Joined: Thu Jan 03, 2013 5:10 pm Posts: 207 Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Re: Learning Color Sorter
And what happens if you either always hit correct or always hit incorrect? Have you tried those?
Does it get mad if all you ever hit is incorrect?
_________________ I'm not a robot! I'm british! ~ quote from an asparagus I am not a robot! I am a unicorn! ~ quote from a robot
Fri Aug 23, 2013 11:57 am
Coder A
Moderator
Joined: Thu Jan 03, 2013 5:10 pm Posts: 207 Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Re: Learning Color Sorter
[ deleted comment due to accidental double post -Coder A]
_________________ I'm not a robot! I'm british! ~ quote from an asparagus I am not a robot! I am a unicorn! ~ quote from a robot
Fri Aug 23, 2013 11:58 am
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
Re: Learning Color Sorter
The universe implodes.
You can delete posts. There's a little 'x' in the bottom right corner of the post. It deletes it. Actually, it'll just get the program stuck in an infinite, unsolvable loop.
_________________ A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder "Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
Fri Aug 23, 2013 12:02 pm
Coder A
Moderator
Joined: Thu Jan 03, 2013 5:10 pm Posts: 207 Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Re: Learning Color Sorter
I don't see an "x." I do see an '!,' though. Haha! I love prooving things aren't fool(or jerk) proof! Computer bug exploitation should be a class in school!
Like in minecraft PE, which I have recently become addicted to, there is currently a bug that allows for infinite iron, gold, diamond, and quartz at the tap of a finger! So nice!
_________________ I'm not a robot! I'm british! ~ quote from an asparagus I am not a robot! I am a unicorn! ~ quote from a robot
Fri Aug 23, 2013 12:06 pm
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
Re: Learning Color Sorter
Hmm. Maybe it's only available for a certain amount of time after you make the post.
_________________ A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder "Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum