Lego Pong

Post your NXJ projects, project ideas, etc here!

Moderators: 99jonathan, roger, imaqine

Lego Pong

Postby wayneage » Fri Mar 21, 2008 4:58 pm

Hi,
A while back I was asking about the NXTCam( viewtopic.php?t=551 ) for my final yr uni project, Pong.

Well I'm finally finished it, the idea is simple but the implementation was a lot harder than I anticipated!
If anyone is interested in seeing it heres a video
http://www.youtube.com/watch?v=szNq2xXIjwc

The video shows it playing against itself for demo purposes, but i can also play against a remote RCX, controlled by a human.

Wayne
wayneage
New User
 
Posts: 10
Joined: Sun Nov 04, 2007 4:43 pm

Postby lawrie » Mon Mar 24, 2008 12:23 am

That is very impressive. Is the source code for it available?
lawrie
leJOS Team Member
 
Posts: 929
Joined: Mon Feb 05, 2007 1:27 pm

Postby bbagnall » Mon Mar 24, 2008 12:56 am

That is so cool. I would like to see it play shuffle puck against a human.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby wayneage » Mon Mar 24, 2008 4:58 pm

Unfortuneately the source isn't avilable right now...because since its a Uni project I'm told that my uni owns to rights to the code until I graduate, but when that happens( about 4 months) I can release the code!

Honestly though its not majorly complicated once you see it, most of the work was non-programming related, things like lighting conditions/keeping the robot straight/a way of not hitting the wall etc.

As you can see a light sensor monitors the ground.
The idea is just based on 4 Behaviors, one for white paper, one for grey, one for black, and one to keep track of the game for when it plays against a human. The action of the Behaviors is just to keep the robot centred on the ball.( and slow down stop etc based on the coulour of the ground) Thats all there is too it really!

As a matter of interest did anyone have an issue trying to use more that 2 behaviors before? My robot shut down when a 3rd behavior was supposed to kick in and just ceased up! I fixed it by actually setting the suppress boolean manualy from within the takeControl() method, but I was tearing my hair out for a week wondering what was going on... perhaps a concurrency issue no? The suppress and action methods should of set the boolean themselves but it just didn't happen...

I'll try get a video of it playing aginst a human up soon, but it won't be for a few weeks, have to write up all my report for the final grading now...fun fun!
wayneage
New User
 
Posts: 10
Joined: Sun Nov 04, 2007 4:43 pm

Postby JavaMan » Sun Apr 06, 2008 5:40 pm

That is so cool. It works very fast and well! Nice job.

Jman
look up and see the chemtrails
www.carnicom.com
User avatar
JavaMan
Novice
 
Posts: 27
Joined: Tue Apr 01, 2008 1:47 pm
Location: United States


Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff